pld应用程序举例qzf.docx
《pld应用程序举例qzf.docx》由会员分享,可在线阅读,更多相关《pld应用程序举例qzf.docx(34页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、PLD段段码显示示librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity duaanmaa issportt(ffff:oout bitt_veectoor(11 too 5);aaa:outt biit_vvecttor(1 tto 55);end;archhiteectuure kk of duaanmaa issbegiin fff(1 tto 55)=1111111;aaa(1 tto 55)=1111111;end;PLD三三个数加加法编程程librraryy ieeee;use ieeee.sstd_loggic_11664
2、.aall;entiity jw isportt(inn1,iin2:in inttegeer rrangge 00 too 155;a,b:outt sttd_llogiic_vvecttor(1 tto 77);end;archhiteectuure gg of jw issignnal he:inttegeer rrangge 00 too 455;begiinhe=in11+inn2;withh hee seeleccta=111111110 wheen 00|100|200|300|400, 0011000000 wwhenn 1|11|21|31|41, 1110111011 ww
3、henn 2|12|22|32|42, 1111110011 wwhenn 3|13|23|33|43, 0011000111 wwhenn 4|14|24|34|44, 1101110111 wwhenn 5|15|25|35|45, 1101111111 wwhenn 6|16|26|36, 1111000000 wwhenn 7|17|27|37, 1111111111 wwhenn 8|18|28|38, 1111110111 wwhenn 9|19|29|39, 000000000 wwhenn ottherrs;withh hee seelecctb=000000000 wheen
4、 00=hhe aand he=9,elsse 011100000 wheen 110=he andd hee=119,eelsee 110011001 wheen 220=he andd hee=229,eelsee 111110001 wheen 330=he andd hee=339,eelsee 011100111 wheen 440=he andd hee=339,eelsee 000000000 wheen ootheers;end;PLD八八个按键键两个灯灯librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity guooz
5、i33 issportt(inn1,iin2:in stdd_loogicc_veectoor(11 too 4);a,b:outt sttd_llogiic_vvecttor(1 tto 88);end;archhiteectuure gg of guoozi33 issbegiinwithh inn1 sseleect011100000 wheen 00001,110011001 wheen 00110,111110001 wheen 00111,011100111 wheen 01000,101110111 wheen 01001,101111111 wheen 01110,111100
6、000 wheen 01111,111111111 wheen 10000,111110111 wheen 10001,000000000 wheen ootheers;withh inn2 sseleectb=011100000wwhenn 000011,110011001 wheen 00110,111110001 wheen 00111,011100111 wheen 01000,101110111 wheen 01001,101111111 wheen 01110,111100000 wheen 01111,111111111 wheen 10000,111110111 wheen 1
7、0001,000000000 wheen ootheers;end;PLD顺顺序语句句编程(0加到到9)librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity jinncheen iisportt(inn1:iin sstd_loggic;a:ouut sstd_loggic_vecctorr(1 to 7); endd;archhiteectuure gg of jinncheen iissignnal ss:inttegeer rrangge 00 too 9;begiinproccesss begiinwaitt unntill
8、inn1=1;ss=ss+1;if sss=110 tthenn ss=0;end if;end proocesss;withh sss seeleccta=111111110 wheen 00, 011100000 wheen 11, 110011001 wheen 22, 111110001 wheen 33, 011100111 wheen 44, 101110111 wheen 55, 101111111 wheen 66, 111100000 wheen 77, 111111111 wheen 88, 111110111 wheen 99, 000000000 wheen oothe
9、ers;end;PLD矢矢量100个控制制2个数数码管librraryy ieeee;usee ieeee.stdd_loogicc_11164.alll;enntittykkonggzhii2 iispoort (a:outt biit_vvecttor(1 tto 77);b:iin bitt_veectoor(11 too 100);endd;arrchiiteccturre fff oof kkonggzhii2 iisbeeginna=1111111100 wwhennb=1000000000000elsse 011100000 wheen b=0100000000000eelsee
10、 1110111011 wwhennb=0001000000000elsse 111110001 wheenbb=11001100000000ellse 011100011 whhenb=1000010000000eelsee 1101110111 wwhennb=1000000100000elsse 101111111 wheenbb=11000000110000ellse 111100000 whhenb=1000000001000eelsee 1111111111 wwhennb=1000000000010elsse 111100111 wheenbb=11000000000011ell
11、se 000000000;ennd;PLD晶晶振500M控制制数码管管librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity jinnzheeng isportt(inn50mm:inn sttd_llogiic;a:ouut sstd_loggic_vecctorr(1 to 7); endd;archhiteectuure gg of jinnzheeng issignnal in11:sttd_llogiic; signnal ss:inttegeer rrangge 00 too 9;signnal couunt:inttege
12、er rrangge 00 too 25500000000;begiinproccesss begiinwaitt unntill inn50mm=11;counnt=couunt+1;if ccounnt=22500000000 tthenncounnt=0;in1=noot iin1;end if;end proocesss;proccesssbegiinwaitt unntill inn1=1;ss=ss+1;if sss=110 tthenn ss=0;end if;end proocesss;withh sss seeleccta=111111110 wheen 00, 011100
13、000 wheen 11, 110011001 wheen 22, 111110001 wheen 33, 011100111 wheen 44, 101110111 wheen 55, 101111111 wheen 66, 111100000 wheen 77, 111111111 wheen 88, 111110111 wheen 99, 000000000 wheen ootheers;end;PLD晶晶振500M自动动跳变程程序(00到599)librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity jiaadxxx isspo
14、rtt(inn50mm:inn sttd_llogiic;a,b:outt sttd_llogiic_vvecttor(1 tto 77);end;archhiteectuure gg of jiaadxxx isssignnal in11:sttd_llogiic; signnal t,gg:inntegger rannge 0 tto 99;signnal couunt:inttegeer rrangge 00 too 599 25500000000;begiinproccesss begiinwaitt unntill inn50mm=11;counnt=couunt+1;if ccou
15、nnt=22500000000 tthenncounnt=0;in1=noot iin1;end if;end proocesss;proccesssbegiinwaitt unntill inn1=1;g=gg+1;if gg=9 theeniff g=5 thhen 改变变变量 g=0; tt=tt+1;if tt=5 theen tt=00; eend if; eend if;end proocesss;withh g sellectta=111111110 wheen 00, 011100000 wheen 11, 110011001 wheen 22, 111110001 wheen
16、 33, 011100111 wheen 44, 101110111 wheen 55, 101111111 wheen 66, 111100000 wheen 77, 111111111 wheen 88, 111110111 wheen 99, 000000000 wheen ootheers;withh t sellecttb=111111110 wheen 00, 011100000 wheen 11, 110011001 wheen 22, 111110001 wheen 33, 011100111 wheen 44, 101110111 wheen 55, 101111111 wh
17、een 66, 111100000 wheen 77, 111111111 wheen 88, 111110111 wheen 99, 000000000 wheen ootheers; endd;PLD(11-8数数码管显显示)第第六个显显示0librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity jiaadxxx issportt(a:outt sttd_llogiic_vvecttor(1 tto 77); b:outt sttd_llogiic_vvecttor(1 tto 33);end;archhiteectuure kk
18、of jiaadxxx issbegiina=111111110;-显示示的数“0”b=0100;-显示示的位“第6位位”end;PLD动动态间隔隔1秒闪烁烁librraryy ieeee;use ieeee.sstd_loggic_11664.aall;entiity jiaadxxx issportt(inn50mm:inn sttd_llogiic; b:outt sttd_llogiic_vvecttor(1 tto 33); a:outt sttd_llogiic_vvecttor(1 tto 77);end;archhiteectuure gg of jiaadxxx isssig
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- pld 应用程序 举例 qzf
限制150内