本文介绍了VHDL _ TO_INTEGER的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对VHDL中的问题感到困惑.

I'm confused about a problem I have in VHDL.

我做一个VGA_display_ characters,所以我想用to_integer无符号将一些std_logic_vectors转换成整数,然后我想恢复健康,这样,我无法同时使用这些库.

I make one VGA_display_ characters, so I wanna convert some std_logic_vectors into integer by to_integer unsigned, then I wanna recuperate, in this way I can't use those libraries in the same time.

ieee.std_logic_arith.allieee.numeric_std.allquartus给出的错误:

ieee.std_logic_arith.all and ieee.numeric_std.allThe error given by quartus:

to_integer

conv_std_logic_vector

推荐答案

我的建议是:不要使用ieee.std_logic_arith.它是专有的(不是VHDL的正式组成部分),并且引起的问题远远超过其解决的问题.

My advice is: don't use ieee.std_logic_arith. It's proprietary (not officially part of VHDL) and causes far, far more problems than it solves.

仅使用numeric_std,您就可以做所需的一切:

Use only numeric_std and you can do everything you need:

to_integer(unsigned(X))to_integer(signed(X)),其中Xstd_logic_vector.

要向另一个方向转换:

std_logic_vector(to_unsigned(K, N))std_logic_vector(to_signed(K, N)),其中K是要转换的整数,N是位数.

std_logic_vector(to_unsigned(K, N)) and std_logic_vector(to_signed(K, N)) where K is the integer to convert and N is the number of bits.

这篇关于VHDL _ TO_INTEGER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 21:11