Added ALUZero Output + corrected other syntax errors

This commit is contained in:
Ibrahim 2020-12-02 13:12:48 +00:00
parent 89abb5c1ed
commit c4cae70ffc

View file

@ -13,7 +13,7 @@ module mips_cpu_alu(
reg [31:0] SignExtend, ZeroExtend; reg [31:0] SignExtend, ZeroExtend;
input logic[10:6] shamt = instr_readdata[10:6]; input logic[10:6] shamt = instr_readdata[10:6]
); );
@ -78,7 +78,7 @@ module mips_cpu_alu(
} ALUFlags; } ALUFlags;
always @(alu_in1, alu_in2, ALUFlags) always @(A,B, ALUFlags)
begin begin
SignExtend = {{16{immediate[15]}}, immediate}; SignExtend = {{16{immediate[15]}}, immediate};
@ -235,6 +235,18 @@ module mips_cpu_alu(
end end
endcase
end end
always @(ALUOut) begin
if (ALUOut == 0) begin
ALUZero <= 1;
end else begin
ALUZero <= 0;
end
end
end
endmodule endmodule