测试代码:
一:
module barrel(W,S,Y);
input [3:0]W;
input [1:0]S;
output [3:0]Y;
wire [3:0]T;
assign {T,Y} = {W,W} >> S;
endmodule
二:
module parity(X,Y);
input [7:0]X;
output [7:0]Y;
assign Y = {^X[6:0],X[6:0]};
endmodule
过程:
1.编译代码
2.在ModelSim中进行仿真,
3.在wave中设置波形时长,点击run
4
如图:
二:
重复上诉步骤,代码一如图: