1.新建文件夹命名priority
2新建一个工程,点击输入框,输入代码
module priority(W,Y,z);
input [3:0]W;
output reg [1:0]Y;
output reg z;
always @(W)
begin
z=1;
casex(W)
4’b1xxx:Y=3;
4’b01xx:Y=2;
4’b001X:Y=1;
4’B0001:Y=0;
default: begin
z=0;
Y=2’bx;
end
endcase
end
endmodule
3.点击运行按钮,开始运行检查错
4.全部正确后,改变仿真途径为modelsim开始进行联合仿真
5.改变波长数值导出结果
6.视频链接:https://www.bilibili.com/video/BV1TK4y1G7Te?share_source=copy_web