if ステートメントでの for ループの使用について質問があります。if ステートメントはプロセス ステートメント内にあります。問題は、コードのこの部分を実行すると、for ループが実行されますが、B の値に関係なく 1 回だけ実行されます。明示的な値を入力して B を無視しようとしましたが、ループは 1 回しか実行されません。何か不足していますか?
このコードは、sll を使用せずに論理左シフトを適用する ALU 動作モデルの一部です。
elsif ALU_Control = "100" then
-- implement shift logic left by B units
if (B > X"00000000") then
-- Use value of B input as the shift position
shift_value := TO_INTEGER(UNSIGNED(B));
-- concatenate a 0 to end of A
for index in 0 to shift_value loop
temp_A := (A(30 downto 0) & '0');
end loop;
ALU_out <= temp_A(31 downto 0) after 100 ps;
else
ALU_out <= A after 100 ps;
end if;