问题描述
我有问题。我有一个 array
的 std_logic_vector
,我输入了一个 value unsinged(3 downto 0)
,我想使用 value 作为 array
的索引。
到目前为止一切顺利,但我应该从 std_logic_vector
中取出一个 array
并放入输出 segments
(这也是一个具有相同大小的 std_logic_vector
)但我收到错误:
> can't match type conversion with type array type "std_logic_vector"
这是我的代码:
> library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity getarrayvalue is
port(
value : in unsigned(3 downto 0);
clk : in std_logic;
segments : out std_logic_vector(6 downto 0)
);
end entity;
architecture v1 of getarrayvalue is
type rom_type is array(0 to 9) of std_logic_vector(6 downto 0);
signal rom: rom_type :=("1111110","0110000","1101101","1111001","0110011","1011011","1011111","1110000","1111111","1111011");
signal val_i: integer;
val_i <= to_integer(value);
process(clk)
begin
if rising_edge(clk) then
segments <= rom_type(val_i);
end if;
end process;
end architecture;
有谁知道如何解决这个问题?谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)