fix flags

This commit is contained in:
Nicholas Orlowsky 2024-04-10 22:22:25 -05:00
parent 26f6dc5ce3
commit c1adfc84c0
Signed by: nickorlow
GPG key ID: 838827D8C4611687
2 changed files with 13 additions and 6 deletions

7
alu.sv
View file

@ -14,7 +14,7 @@ module alu(
int cnt;
initial begin
overflow = 1'bx;
overflow = 0;
result = 8'hxx;
result_int = 9'bxxxxxxxxx;
done = 0;
@ -24,7 +24,7 @@ module alu(
always_ff @(posedge clk_in) begin
if (rst_in) begin
done <= 0;
overflow <= 1'bx;
overflow <= 0;
result <= 8'hxx;
result_int <= 9'bxxxxxxxxx;
cnt <= 0;
@ -65,14 +65,17 @@ module alu(
end
structs::OR: begin
result <= in.operand_a | in.operand_b;
overflow <= 0;
done <= 1;
end
structs::AND: begin
result <= in.operand_a & in.operand_b;
overflow <= 0;
done <= 1;
end
structs::XOR: begin
result <= in.operand_a ^ in.operand_b;
overflow <= 0;
done <= 1;
end
structs::SHR: begin