grandslam47
Newbie
Code:
module barrel(W,Y,S);
input [3:0] W;
input [1:0] S;
output [3:0]Y;
wire [3:0]T;
assign {T,Y}={W,W}>>S;
endmodule
Code:
module sim();
reg [3:0] W;
reg [1:0] S;
wire [3:0] Y ;
barrel sim1(W, S, Y);
initial begin
W = 4'b0100;
S = 2'b01;
#10 S = 2'b10;
#10 S = 2'b11;
#10 S = 2'b01;
#10 W = 4'b0110;
S = 2'b01;
#10 W = 4'b0111;
S = 2'b01;
#10 W = 4'b1101;
S = 2'b01;
end
endmodule