




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)
文檔簡介
1/1pld應(yīng)用程序舉例PLD段碼顯示libraryieee;useieee.std_logic_1164.all;entityduanmaisport(fff:outbit_vector(1to5);aaa:outbit_vector(1to5));end;architecturekkofduanmaisbeginfff(1to5)=11111;aaa(1to5)=11111;end;PLD三個數(shù)加法編程libraryieee;useieee.std_logic_1164.all;entityjwisport(in1,in2:inintegerrange0to15;a,b:outstd_logic_vector(1to7));end;architectureggofjwissignalhe:integerrange0to45;beginhe=in1+in2;withheselecta=1111110when0|10|20|30|40,0110000when1|11|21|31|41,1101101when2|12|22|32|42,1111001when3|13|23|33|43,0110011when4|14|24|34|44,1011011when5|15|25|35|45,1011111when6|16|26|36,1110000when7|17|27|37,1111111when8|18|28|38,1111011when9|19|29|39,0000000whenothers;withheselectb=0000000when0=heandhe=9,else0110000when10=heandhe=19,else1101101when20=heandhe=29,else1111001when30=heandhe=39,else0110011when40=heandhe=39,else0000000whenothers;end;PLD八個按鍵兩個燈libraryieee;useieee.std_logic_1164.all;entityguozi3isport(in1,in2:instd_logic_vector(1to4);a,b:outstd_logic_vector(1to8));end;architectureggofguozi3isbeginwithin1select0110000when0001,1101101when0010,1111001when0011,0110011when0100,1011011when0101,1011111when0110,1110000when0111,1111111when1000,1111011when1001,0000000whenothers;within2selectb=0110000when0001,1101101when0010,1111001when0011,0110011when0100,1011011when0101,1011111when0110,1110000when0111,1111111when1000,1111011when1001,0000000whenothers;end;PLD順序語句編程(0加到9)libraryieee;useieee.std_logic_1164.all;entityjinchenisport(in1:instd_logic;a:outstd_logic_vector(1to7));end;architectureggofjinchenissignalss:integerrange0to9;beginprocessbeginwaituntilin1=‘1’;ss=ss+1;ifss=10thenss=0;endif;endprocess;withssselecta=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;end;PLD矢量10個控制2個數(shù)碼管libraryieee;useieee.std_logic_1164.all;entitykongzhi2isport(a:outbit_vector(1to7);b:inbit_vector(1to10));end;architectureffofkongzhi2isbegina=1111110whenb=1000000000else0110000whenb=0100000000else1101101whenb=0010000000else1111001whenb=1001000000else0110011whenb=1000100000else1011011whenb=1000010000else1011111whenb=1000001000else1110000whenb=1000000100else1111111whenb=1000000010else1110011whenb=1000000001else0000000;end;PLD晶振50M控制數(shù)碼管libraryieee;useieee.std_logic_1164.all;entityjinzhengisport(in50m:instd_logic;a:outstd_logic_vector(1to7));end;architectureggofjinzhengissignalin1:std_logic;signalss:integerrange0to9;signalcount:integerrange0to25000000;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=25000000thencount=0;in1=notin1;endif;endprocess;processbeginwaituntilin1=‘1’;ss=ss+1;ifss=10thenss=0;endif;endprocess;withssselecta=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;end;PLD晶振50M自動跳變程序(0到59)libraryieee;useieee.std_logic_1164.all;entityjiadxxisport(in50m:instd_logic;a,b:outstd_logic_vector(1to7));end;architectureggofjiadxxissignalin1:std_logic;signalt,g:integerrange0to9;signalcount:integerrange0to5925000000;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=25000000thencount=0;in1=notin1;endif;endprocess;processbeginwaituntilin1=‘1’;g=g+1;ifg=9thenifg=5then改變變量g=0;t=t+1;ift=5thent=0;endif;endif;endprocess;withgselecta=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;withtselectb=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;end;PLD(1-8數(shù)碼管顯示)第六個顯示0libraryieee;useieee.std_logic_1164.all;entityjiadxxisport(a:outstd_logic_vector(1to7);b:outstd_logic_vector(1to3));end;architecturekkofjiadxxisbegina=1111110;--顯示的數(shù)0b=010;--顯示的位第6位end;PLD動態(tài)間隔1秒閃爍libraryieee;useieee.std_logic_1164.all;entityjiadxxisport(in50m:instd_logic;b:outstd_logic_vector(1to3);a:outstd_logic_vector(1to7));end;architectureggofjiadxxissignalcount:integerrange0to25000000;signalcount_one:integerrange0to1;signalone_hz:std_logic;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=25000000thencount=0;one_hz=notone_hz;endif;endprocess;processbeginwaituntilone_hz=‘1’;count_one=count_one+1;ifcount_one=0thenb=000;elseb=001;endif;endprocess;a=1111110;end;PLD動態(tài)顯示01libraryieee;useieee.std_logic_1164.all;entitydz1121isport(in50m:instd_logic;a:outstd_logic_vector(1to7);b:outstd_logic_vector(1to3));end;architectureggofningyiissignalin1:std_logic;signalcount_c:integerrange0to3;signalcount:integerrange0to2500;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=2500thencount=0;in1=notin1;endif;endprocess;processbeginwaituntilin1=‘1’;count_c=count_c+1;ifcount_c=1thencount_c=0;endif;endprocess;withcount_cselecta=1111110when0,0110000when1,0000000whenothers;withcount_cselectb=000when0,001when1,111whenothers;end;PLD數(shù)碼管顯示0-7libraryieee;useieee.std_logic_1164.all;entityxian0-7isport(in50m:instd_logic;a:outstd_logic_vector(1to7);b:outstd_logic_vector(1to3));end;architectureggofxian0-7issignalin1:std_logic;signalcount_c:integerrange0to7;signalcount:integerrange0to2500;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=2500thencount=0;in1=notin1;endif;endprocess;processbeginwaituntilin1=‘1’;count_c=count_c+1;casecount_ciswhen0=b=000;--a=1111110;when1=b=001;a=0110000;when2=b=010;a=1101101;when3=b=011;a=1111001;when4=b=100;a=0110011;when5=b=101;a=1011011;when6=b=110;a=1011111;when7=b=111;a=1110000;ifcount_c=7thencount_c=0;endif;endcase;endprocess;end;PLD時鐘顯示libraryieee;useieee.std_logic_1164.all;entityshizonisport(in50m:std_logic;a:outstd_logic_vector(1to7);--段碼b:outstd_logic_vector(1to3));--位碼end;architectureffofshizonissignalcount:integerrange0to250;--整數(shù)定義signalcount_s:integerrange0to25000;--半秒定義signalg1,g2,s1,s2,b1,b2:std_logic_vector(1to7);--變量范圍signalone_hz:std_logic;--定義1赫茲信號signalone_s:std_logic;signalx:integerrange0to7;--signalgg1,gg2,ss1,ss2,bb1,bb2:integerrange0to9;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=250thencount=0;one_hz=notone_hz;endif;endprocess;processbeginwaituntilin50m=‘1’;count_s=count_s+1;ifcount_s=25000thencount_s=0;one_s=notone_s;endif;endprocess;processbeginwaituntilone_hz=‘1’;x=x+1;casexiswhen0=b=000;a=g1;when1=b=001;a=g2;when2=b=010;a=0000001;when3=b=011;a=s1;when4=b=100;a=s2;when5=b=101;a=0000001;when6=b=110;a=b1;when7=b=111;a=b2;x=0;endcase;endprocess;processbeginwaituntilone_s=‘1’;gg1=gg1+1;ifgg1=9thengg1=0;gg2=gg2+1;ifgg2=5thengg2=0;ss1=ss1+1;ifss1=9thenss1=0;ss2=ss2+1;ifss2=5thenss2=0;bb1=bb1+1;ifbb1=9thenbb1=0;bb2=bb2+1;endif;ifbb1=3andbb2=2thenbb1=0;bb2=0;endif;endif;endif;endif;endif;endprocess;withgg1selectg1=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;withgg2selectg2=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,0000000whenothers;withss1selects1=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;withss2selects2=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,0000000whenothers;withbb1selectb1=1111110when0,0110000when1,1101101when2,1111001when3,0110011when4,1011011when5,1011111when6,1110000when7,1111111when8,1111011when9,0000000whenothers;withbb2selectb2=1111110when0,0110000when1,1101101when2,0000000whenothers;end;PLD單個音符編程低2音libraryieee;useieee.std_logic_1164.all;entityypyyisport(in50m:instd_logic;a:outstd_logic);end;architectureggofypyyissignalin1:std_logic;signalcount:integerrange0to25000000;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=85034thencount=0;in1=notin1;endif;endprocess;a=in1;END;PLD雙音符編程libraryieee;useieee.std_logic_1164.all;entityypyyisport(in50m:instd_logic;a:outstd_logic);end;architectureggofypyyissignalin1:std_logic;signalin2:std_logic;signalcount:integerrange0to25000000;signalcount_1:integerrange0to25000000;signalys1s:integerrange0to50000000;signaljia1:integerrange0to1;beginprocessbeginwaituntilin50m=‘1’;count=count+1;ifcount=85034thencount=0;in1=notin1;endif;endprocess;processbeginwaituntilin50m=‘1’;count_1=count_1+1;ifcount_1=63775thencount_1=0;in2=notin2;endif;endprocess;processbeginwaituntilin50m=‘1’;ys1s=ys1s+1;ifys1s=50000000thenys1s=0;jia1=jia1+1;endif;ifjia1=0thena=in1;elsea=in2;endif;endprocess;end;PLD1-7音符編程(if語句)libraryieee;useieee.std_logic_1164.all;entityypyyisport(in50m:instd_logic;a:outstd_logic);end;architectureggofypyyissignalin1:std_logic;signalin2:std_logic;signalin3:std_logic;signalin4:std_logic;signalin5:std_logic;signalin6:std_logic;signalin7:std_logic;signalcount:integerrange0to25000000;signalcount_1:integerrange0to25000000;signalcount_2:integerrange0to25000000;signalcount_3:integerrange0to25000000;signalcount_4:integerrange0to25000000;signalcount_5:integerrange0to25000000;signalcount_6:integerrange0to25000000;signalys1s:integer
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 助產(chǎn)士考試題庫7卷
- 創(chuàng)新創(chuàng)業(yè)課股份合作協(xié)議
- 潞安集團(tuán)合作協(xié)議書模板
- 2025二手房買賣合同協(xié)議書 二手房買賣合同貸款專用
- 二零二五房屋買居間服務(wù)賣協(xié)議書
- 房屋居間合同范文集合二零二五年
- 2025年中考?xì)v史一輪復(fù)習(xí)之經(jīng)典好題單元練(三十二)-經(jīng)濟大危機和第二次世界大戰(zhàn)(學(xué)生版)
- 建設(shè)燃料油、潤滑油、潤滑脂調(diào)和生產(chǎn)及柴油儲運項目可行性研究報告寫作模板-申批備案
- 車輛清潔日常管理制度
- 項目制度人員管理制度
- 拖欠房租起訴書【5篇】
- 工序標(biāo)準(zhǔn)工時及產(chǎn)能計算表
- 護(hù)理人員儀容儀表及行為規(guī)范
- 汽車品牌馬自達(dá)課件
- 第六章廣播電視的傳播符號
- 儀器設(shè)備自校規(guī)程
- 鋼結(jié)構(gòu)安裝工程檢驗批驗收記錄表(共14頁)
- 蘇教版五下數(shù)學(xué)小數(shù)報全套高清晰含答案
- 電鍍污泥與粘土混合制磚重金屬浸出毒性實驗
- 家庭《弟子規(guī)》力行表
- 幼兒園食堂人員考試及答案
評論
0/150
提交評論