From cf2e2cb508049d39458049a5028bbc26cbc9c34e Mon Sep 17 00:00:00 2001 From: Warrick Lo Date: Sun, 15 Dec 2024 20:16:23 -0800 Subject: Add RTL files Signed-off-by: Warrick Lo --- rtl/shifter.sv | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 rtl/shifter.sv (limited to 'rtl/shifter.sv') diff --git a/rtl/shifter.sv b/rtl/shifter.sv new file mode 100644 index 0000000..66e5c74 --- /dev/null +++ b/rtl/shifter.sv @@ -0,0 +1,12 @@ +module shifter(in, shift, sout); + input [1:0] shift; + input [15:0] in; + output reg [15:0] sout; + + always_comb case (shift) + 2'b00: sout = in; + 2'b01: sout = {in[14:0], 1'b0}; + 2'b10: sout = {1'b0, in[15:1]}; + 2'b11: sout = {in[15], in[15:1]}; + endcase +endmodule: shifter -- cgit v1.2.3