Updated code such that it will compile

This commit is contained in:
TroubleElectrical committed 2026-10-15 15:32:15 +11:00
1 parent 5fc24f7859
commit cd7fecd1c4
3 files changed
+6 -6

No files matched your search

+2 -2
View File
@@ -66,9 +66,9 @@ module assignment2 #(width=5, ramsz=9, romsz=10) (
register_file #(width, 5) REGS (
clk, rd_we,
(RDST) ? instruction[15:11] : instruction[20:16], rs,
instruction[25:21], rt,
instruction[20:16], rd,
(RDST) ? instruction[15:11] : instruction[20:16], rt,
instruction[25:21], rs,
regs_out
);
// Always use sign-extension
+2 -2
View File
@@ -23,5 +23,5 @@ module control_unit (
// TODO
end
endmodule;
`endif
endmodule
`endif
+2 -2
View File
@@ -8,9 +8,9 @@ module sign_extender #(in_width=4, out_width=5)(
);
always_comb begin
if (op) begin
assign ext_val = { {(2**(out_width-in_width)){val[2**in_width-1]}}, val};
ext_val = { {(2**(out_width-in_width)){val[2**in_width-1]}}, val};
end else begin
assign ext_val = ({{(2**(out_width-in_width)){1'b0}}, val});
ext_val = ({{(2**(out_width-in_width)){1'b0}}, val});
end
end
endmodule