我正在尝试将几个 1 位 ALU 组合成一个 4 位 ALU。我对如何在 VHDL 中实际执行此操作感到困惑。这是我正在使用的 1bit 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
我假设我将 alu1 定义为更大实体 alu4 的一个组件,但我怎样才能将它们联系在一起呢?