欢迎来到天天文库
浏览记录
ID:57739797
大小:42.50 KB
页数:17页
时间:2020-09-02
《四位电子密码锁代码.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、代码:moduleindex(inputclk,inputpw_1,inputpw_2,inputpw_3,inputpw_4,inputpw_5,inputpw_6,inputpw_7,inputpw_8,inputsti_0,inputsti_1,inputsti_2,outputx,outputy,outputregred,outputreggreen,outputregalarm,outputregnum0_1,outputregnum0_2,outputregnum0_3,outputregnum0_4,outputregnum0_5,outputreg
2、num0_6,outputregnum0_7,outputregnum0_8,outputregnum1_1,outputregnum1_2,outputregnum1_3,outputregnum1_4,outputregnum1_5,outputregnum1_6,outputregnum1_7,outputregnum1_8);/**clk:clock*pw:password*sti:stimulation*red/green:outputLED*num:nixie**/regctrl;regcc;assignx=1;assigny=1;initialbeg
3、incc<=1'b0;alarm<=1'b0;ctrl<=1'b0;red<=1'b1;green<=1'b0;num0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b1;num0_8<=1'b1;num1_1<=1'b1;num1_2<=1'b0;num1_3<=1'b1;num1_4<=1'b1;num1_5<=1'b0;num1_6<=1'b1;num1_7<=1'b1;end//CLK分频regCLK;parameterN=;reg[31:0]ip;reg[31
4、:0]ipr;always@(posedgeclk)beginif(ip5、ginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b1;num0_7<=1'b0;end1:beginnum0_1<=1'b0;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b0;;num0_5<=1'b0;num0_6<=1'b0;num0_7<=1'b0;end2:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b0;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b0;n6、um0_7<=1'b1;end3:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b0;num0_6<=1'b0;num0_7<=1'b1;end4:beginnum0_1<=1'b0;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b0;num0_5<=1'b0;num0_6<=1'b1;num0_7<=1'b1;end5:beginnum0_1<=1'b1;num0_2<=1'b0;num0_3<=1'b1;num0_4<=1'b1;num0_5<=17、'b0;num0_6<=1'b1;num0_7<=1'b1;end6:beginnum0_1<=1'b1;num0_2<=1'b0;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b1;num0_7<=1'b1;end7:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b0;num0_5<=1'b0;num0_6<=1'b0;num0_7<=1'b0;end8:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num08、_4<=1
5、ginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b1;num0_7<=1'b0;end1:beginnum0_1<=1'b0;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b0;;num0_5<=1'b0;num0_6<=1'b0;num0_7<=1'b0;end2:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b0;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b0;n
6、um0_7<=1'b1;end3:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b0;num0_6<=1'b0;num0_7<=1'b1;end4:beginnum0_1<=1'b0;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b0;num0_5<=1'b0;num0_6<=1'b1;num0_7<=1'b1;end5:beginnum0_1<=1'b1;num0_2<=1'b0;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1
7、'b0;num0_6<=1'b1;num0_7<=1'b1;end6:beginnum0_1<=1'b1;num0_2<=1'b0;num0_3<=1'b1;num0_4<=1'b1;num0_5<=1'b1;num0_6<=1'b1;num0_7<=1'b1;end7:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0_4<=1'b0;num0_5<=1'b0;num0_6<=1'b0;num0_7<=1'b0;end8:beginnum0_1<=1'b1;num0_2<=1'b1;num0_3<=1'b1;num0
8、_4<=1
此文档下载收益归作者所有