割り当て用に 1 ビット ALU を設計する必要があり、それを再利用して 4 つのユニットと 4 ビット ALU を作成します。
1ビットALUには2つの選択ラインと入力A、B、およびキャリーインがあります。
私の問題は、選択行とキャリーインフラグが選択する操作を選択することです。選択ラインとキャリーフラグを同時に使用して操作を選択する方法がわかりません。
たとえば、選択ライン「00」と Cin「0」は加算演算であり、Cin「1」は減算演算です。
以下で行ったことを行うことができますか?ご協力いただきありがとうございます。
entity ALU1Bit is
port(
A: IN std_logic_vector;
B: IN std_logic;
carryIn: IN std_logic;
operation: IN std_logic_vector(1 downto 0);
F: OUT std_logic;
carryOut: OUT std_logic
);
end ALU1Bit;
architecture Behavioral of ALU1Bit is
component Adder1Bit
port(
carryIn: IN std_logic;
A: IN std_logic;
B: IN std_logic;
output: OUT std_logic;
F: OUT std_logic
);
end component;
begin
carryIn <= '0';
case operation is
when...
carryIn <= '1';
case operation is
when...
end Behavioral;