我正在尝试将阵列内的数据输出到DE1-SoC板上的7段显示器。
这是我的变量:
display : out std_logic_vector (6 downto 0);
type bigDisplay is array (0 to 4, 0 to 6) of bit;
signal displayArray : bigDisplay;
代码如下:
display <= displayArray (0, 6-0);
这是我收到的错误:
Error (10381): VHDL Type Mismatch error at Final_Project.vhd(326): indexed name returns a value whose type does not match "std_logic_vector", the type of the target expression
所以,我猜我需要将我的位数组转换为输出到std_logic_vector吗?我该怎么办?
答案 0 :(得分:2)
使用bit
的任何特殊原因?您可以轻松地创建std_logic_vector
的数组:
type bigDisplay is array(0 to 4) of std_logic_vector(6 downto 0);
signal displayArray : bigDisplay;
然后简单地(当然,在用值初始化displayArray
之后):
display <= displayArray(0);
Etc或所需的任何索引,以便将数组中的值分配给显示。