Fixed bug where ASU intermediate was being treated as the overflow flag rather than an intermediate.
This commit is contained in:
1 file changed
+3
-1
+3
-1
@@ -17,11 +17,13 @@ module alu #(parameter width=2)(input logic [3:0] op,
|
||||
logic [2:0] asu_flags;
|
||||
|
||||
assign asu_op = op[1];
|
||||
asu #(width) adder_unit(asu_op, A, B, asu_out, asu_flags[0], asu_flags[1]);
|
||||
logic [0:0] asu_cout_flag;
|
||||
asu #(width) adder_unit(asu_op, A, B, asu_out, asu_flags[0], asu_cout_flag);
|
||||
|
||||
logic [2**width-1:0] lu_out;
|
||||
lu #(width) logic_unit(op[1:0], A, B, lu_out);
|
||||
|
||||
assign asu_flags[1] = asu_cout_flag ^ asu_flags[0];
|
||||
always_comb begin
|
||||
case (op)
|
||||
4'b0000: begin OUT_1 = asu_out; end
|
||||
|
||||
Reference in new issue
Block a user