Added Q5 comments and sumbission

This commit is contained in:
TroubleElectrical committed 2026-09-16 12:54:18 +10:00
1 parent 13f34e62c6
commit ae8ac98e8d
2 files changed
+100 -3

No files matched your search

+3 -3
View File
@@ -1,9 +1,9 @@
`ifndef SHIFTER_H_SV
`define SHIFTER_H_SV
module shifter #(width=2)(input logic [2:0] op,
input logic[2**width-1:0] A, input logic[2**width-1:0] B, input logic[width-1:0] C,
input logic[2**width-1:0] A, input logic[2**width-1:0] B, input logic[width-1:0] C,
output logic[2**width-1:0] OUT_1);
// A and B are 2^n bits wide and C is n bits wide as according to the docs
always_comb begin
case (op)
3'b000: OUT_1 = A << C;
@@ -16,4 +16,4 @@ module shifter #(width=2)(input logic [2:0] op,
endcase
end
endmodule
`endif
`endif