No overflow flag when not in addition nor subtraction mode
This commit is contained in:
parent
fb65ccc713
commit
1f7f07b366
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user