VHDL中std_logic_vector与std_logic有什么区别?
的有关信息介绍如下:一、意思不同
std_logic_vector 是标准逻辑矢量,定义的是长度大于1的变量,需要确定赋值方向 (n downto 0) or (0 downto n)。
std_logic 是长度为1的逻辑。
二、用法不同
std_logic_arith程序包里定义的数据转换函数:conv_std_logic_vector(A,位长)--INTEGER,SINGER,UNSIGNED转换成std_logic_vector。
如:a<=conv_std_logic_vector(-79,6)----(-79)2c=(10110001)
b<=conv_std_logic_vector(-2,6)-----(-2)2c=(11111110)
c<=conv_std_logic_vector(100,6)-----(100)2c=(01100100)
输出结果:a=110001,b=111110,c=100100。
三、包含
The function provided by the std_logic_arith library can't convert a std_logic_vector to an integer because it is impossible to determine if it represents an unsigned or signed value.
Functions that do this are included in the std_logic_unsigned and std_logic_signed libraries.
前一个包含在std_logic_arith.all程序包中,后一个在std_logic_unsigned 和std_logic_signed 中都有包含。