No overflow flag when not in addition nor subtraction mode

This commit is contained in:
xenia 2024-01-17 13:58:14 +01:00
parent fb65ccc713
commit 1f7f07b366

View File

@ -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;