diff --git a/src/alu/alu.v b/src/alu/alu.v index 3b6b242..f326084 100644 --- a/src/alu/alu.v +++ b/src/alu/alu.v @@ -23,12 +23,16 @@ module alu( wire [31:0] adder_out; begin + wire addition = op == 3'b000; wire subtraction = op == 3'b001; wire [31:0] adder_B = subtraction ? ~B : B; wire adder_cout; carry_select_adder a(A, adder_B, subtraction, adder_out, adder_cout); - assign Fflow = subtraction ? ~adder_cout : adder_cout; + assign Fflow = + addition ? adder_cout : + subtraction ? ~adder_cout : + 0; end wire [31:0] mult_out_hi;