欢迎来到天天文库
浏览记录
ID:44180787
大小:37.44 KB
页数:3页
时间:2019-10-19
《八选一多路选择器Verilog代码及仿真结果MUX_8》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、modulemux_8(I7,I6,I5,I4,I3,I2,I1,I0,S2,S1,S0,O);inputI7,I6,I5,I4,I3,I2,I1,I0,S2,S1,S0;outputO;assignO={!S2&&!S1&&!S0}?I0:{!S2&&!S1&&S0}?I1:{!S2&&S1&&!S0}?I2:{!S2&&S1&&S0}?I3:{S2&&!S1&&!S0}?I4:{S2&&!S1&&S0}?I5:{S2&&S1&&!S0}?I6:I7;endmodulemodulemux_8_tb;
2、//InputsregI7;regI6;regI5;regI4;regI3;regI2;regI1;regI0;regS2;regS1;regS0;//OutputswireO;//InstantiatetheUnitUnderTest(UUT)mux_8uut(.I7(I7),.I6(I6),.I5(I5),.I4(I4),.I3(I3),.I2(I2),.I1(I1),.I0(I0),.S2(S2),.S1(S1),.S0(S0),.O(O));initialbegin//InitializeIn
3、putsI7=0;I6=0;I5=0;I4=0;I3=0;I2=0;I1=0;I0=0;S2=0;S1=0;S0=0;//Wait100nsforglobalresettofinish#100;//Addstimulushereendalways#1I7=~I7;always#2I6=~I6;always#4I5=~I5;always#8I4=~I4;always#10I3=~I3;always#20I2=~I2;always#30I1=~I1;always#40I0=~I0;always#50S2=
4、~S2;always#100S1=~S1;always#200S0=~S0;endmodule
此文档下载收益归作者所有