vhdl - VHDL 从 std_logic_vector 数组中获取 std_logic_vector
问题描述
我有个问题。我有一个array
ofstd_logic_vector
并且我输入 avalue 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;
有谁知道如何解决这个问题?谢谢!
解决方案
推荐阅读
- flutter - 验证器错误消息更改 TextFormField 的高度
- bash - cd 进入特定目录更改 PATH 变量
- jenkins - 如何使用 GroovyScript 和 Jenkins 导入类?
- html - 如何使此横幅看起来像 Urban Outfitters 的?
- npm - 在没有 NPM 注册表的情况下使用自己的 NPM 包的直接方式
- css - 是否可以在使用自动填充列的网格中定位第一行项目?
- r - 每日数据的正确频率应该是多少?
- mysql - Like/Upvote:单独的表或作为评论表中的实体
- jquery - 如何在 JQuery 中同时制作两个动画?
- java - 从资源中读取文件在 gitlab CI 中不起作用