aboutsummaryrefslogtreecommitdiff
path: root/src/shifter.sv
blob: 66e5c74464729cb784fcf19966f9fc662a909ed7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
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