您能帮我在VHDL中使用类型进行此矩阵声明吗?
-- A B Q Y
(('0', '0', "000", 0),
('0', '1', "ZZ1", 1),
('1', '0', "Z1Z", 1),
('1', '1', "1ZZ", 2))
类型声明可能看起来像这样:
type element_t is record
A : std_logic;
B : std_logic;
Q : std_logic_vector(2 downto 0);
Y : natural;
end record;
type array_t is array (0 to 3) of element_t;
constant VALUE : array_t :=
-- A B Q Y
(('0', '0', "000", 0),
('0', '1', "ZZ1", 1),
('1', '0', "Z1Z", 1),
('1', '1', "1ZZ", 2));