我试图将几个1位ALU组合成一个4位ALU。我很困惑如何在VHDL中实际做到这一点。下面是1位ALU,我使用的代码:我假设我定义为ALU1较大实体ALU4的一个组成部分从几个1位ALU制作一个4位ALU
component alu1 -- define the 1 bit alu component
port(a, b: std_logic_vector(1 downto 0);
m: in std_logic_vector(1 downto 0);
result: out std_logic_vector(1 downto 0));
end alu1;
architecture behv1 of alu1 is
begin
process(a, b, m)
begin
case m is
when "00" =>
result <= a + b;
when "01" =>
result <= a + (not b) + 1;
when "10" =>
result <= a and b;
when "11" =>
result <= a or b;
end case
end process
end behv1
,但我怎么能绑在一起?