版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
CPLD實(shí)驗(yàn)
一實(shí)驗(yàn)要求:熟練運(yùn)用MAX+PLUSII分析組合邏輯電路、時(shí)序電路,能夠運(yùn)用VHDL對(duì)簡單的邏輯電路功能進(jìn)行描述。二、實(shí)驗(yàn)結(jié)果要求對(duì)仿真結(jié)果生成的仿真波形文件進(jìn)行保存,并對(duì)結(jié)果進(jìn)行分析說明。
實(shí)驗(yàn)1:簡單組合邏輯設(shè)計(jì)
實(shí)驗(yàn)2:數(shù)碼管掃描電路
libraryIEEE;useIEEE.std_logic_1164.all;entityxdeledisport(d_in:inSTD_LOGIC_VECTOR(3downto0);a:outSTD_LOGIC;b:outSTD_LOGIC;c:outSTD_LOGIC;d:outSTD_LOGIC;e:outSTD_LOGIC;f:outSTD_LOGIC;g:outSTD_LOGIC);endxdeled;begin--<<enteryourstatementshere>>process(d_in)typedata_outisarray(0to6)ofstd_logic;variableoutp:data_out;begincased_iniswhen"0000"=>outp:="1111110";when"0001"=>outp:="0110000";when"0010"=>outp:="1101101";when"0011"=>outp:="1111001";when"0100"=>outp:="0110011";when"0101"=>outp:="1011011";when"0110"=>outp:="1011111";
when"0111"=>outp:="1110000";when"1000"=>outp:="1111111";when"1001"=>outp:="1111011";when"1010"=>outp:="1110111";when"1011"=>outp:="0011111";when"1100"=>outp:="1001110";when"1101"=>outp:="0111101";when"1110"=>outp:="1001111";when"1111"=>outp:="1000111";whenothers=>null;endcase;a<=outp(0);b<=outp(1);c<=outp(2);d<=outp(3);e<=outp(4);f<=outp(5);g<=outp(6);endprocess;endxdeled;實(shí)驗(yàn)3:計(jì)數(shù)器電路設(shè)計(jì)(8位二進(jìn)制同步計(jì)數(shù)器)實(shí)驗(yàn)4:波形發(fā)生器
1、正斜率斜波2、負(fù)斜率斜波3、鋸齒波4、遞增階梯波
libraryIEEE;useIEEE.std_logic_1164.all;useieee.std_logic_unsigned.all;useieee.std_logic_arith.all;
entitywavegeneratorisport(
clk:inSTD_LOGIC;reset:inSTD_LOGIC;mode:inSTD_LOGIC_VECTOR(1downto0);d_out:outSTD_LOGIC_VECTOR(7downto0));endwavegenerator;architecturewavegenerator_archofwavegeneratorissignalda:std_logic_vector(7downto0);begin--<<enteryourstatementshere>>
process(clk,reset,mode,da)variableporn:std_logic;beginifreset='0'then
da<="00000000";d_out<="00000000";porn:='0';elseifclk='1'andclk'eventthencasemodeiswhen"00"=>ifda<255then
da<=da+1;else
da<="00000000";endif;
when"01"=>ifda=0then
da<="11111111";else
da<=da-1;endif;when"10"=>ifporn='0'thenifda<255then
da<=da+1;elseporn:='1';endif;elseifda>0then
da<=da-1;elseporn:='0';endif;endif;when"11"=>ifda<240then
da<=da+32;else
da<="00000000";endif;whenothers=>
da<="00000000";endcase;endif;d_out<=da;endif;endprocess;
endwavegenerator_arch;實(shí)驗(yàn)5:全功能計(jì)數(shù)器VHDL描述
--MAX+plusIIVHDLExample--EfficientCounterInference--Copyright(c)1994AlteraCorporation--downloadfrom:&
LibraryIEEE;useIEEE.std_logic_1164.all;useIEEE.std_logic_arith.all;
ENTITYcountersIS
PORT ( d :IN INTEGERRANGE0TO255;
clk :IN BIT; clear :IN BIT; ld :IN BIT; enable :IN BIT; up_down :IN BIT;
qa :OUT INTEGERRANGE0TO255;
qb :OUT INTEGERRANGE0TO255; qc :OUT INTEGERRANGE0TO255;
qd:OUT INTEGERRANGE0TO255;
qe :OUT INTEGERRANGE0TO255;
qf :OUT INTEGERRANGE0TO255;
qg :OUT INTEGERRANGE0TO255;
qh :OUT INTEGERRANGE0TO255;
qi :OUT INTEGERRANGE0TO255;
qj :OUT INTEGERRANGE0TO255;
qk :OUT INTEGERRANGE0TO255;
ql :OUT INTEGERRANGE0TO255;
qm :OUT INTEGERRANGE0TO255;
qn :OUT INTEGERRANGE0TO255 );ENDcounters;
ARCHITECTUREaOFcountersISBEGIN --Anenablecounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFenable='1'THEN
cnt:=cnt+1; ENDIF; ENDIF;
qa <=cnt;
ENDPROCESS;--Asynchronousloadcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFld='0'THEN
cnt:=d; ELSE
cnt:=cnt+1; ENDIF; ENDIF;
qb <= cnt; ENDPROCESS;--Asynchronousclearcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFclear='0'THEN
cnt:=0; ELSE
cnt:=cnt+1; ENDIF; ENDIF;
qc <= cnt;
ENDPROCESS;
--Anup/downcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; VARIABLE direction :INTEGER; BEGIN IF(up_down='1')THEN direction:=1; ELSE direction:=-1; ENDIF;
IF(clk'EVENTANDclk='1')THEN
cnt:=cnt+direction; ENDIF;
qd <= cnt;
ENDPROCESS;--Asynchronousloadenablecounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFld='0'THEN
cnt:=d; ELSE IFenable='1'THEN
cnt:=cnt+1; ENDIF; ENDIF; ENDIF;
qe <= cnt;
ENDPROCESS;--Anenableup/downcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; VARIABLE direction :INTEGER; BEGIN IF(up_down='1')THEN direction:=1; ELSE direction:=-1; ENDIF;
IF(clk'EVENTANDclk='1')THEN IFenable='1'THEN
cnt:=cnt+direction; ENDIF; ENDIF;
qf <= cnt;
ENDPROCESS;
--Asynchronousclearenablecounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFclear='0'THEN
cnt:=0; ELSE IFenable='1'THEN
cnt:=cnt+1; ENDIF; ENDIF; ENDIF;
qg <= cnt;
ENDPROCESS;--Asynchronousloadclearcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFclear='0'THEN
cnt:=0; ELSE IFld='0'THEN
cnt:=d; ELSE
cnt:=cnt+1; ENDIF; ENDIF; ENDIF;
qh <= cnt;
ENDPROCESS;
--Asynchronousloadup/downcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; VARIABLE direction :INTEGER; BEGIN IF(up_down='1')THEN direction:=1; ELSE direction:=-1; ENDIF;
IF(clk'EVENTANDclk='1')THEN
IFld='0'THEN
cnt:=d; ELSE
cnt:=cnt+direction; ENDIF; ENDIF;
qi <= cnt;
ENDPROCESS;
--Asynchronousloadenableup/downcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; VARIABLE direction :INTEGER; BEGIN IF(up_down='1')THEN direction:=1; ELSE direction:=-1; ENDIF;
IF(clk'EVENTANDclk='1')THEN IFld='0'THEN
cnt:=d; ELSE IFenable='1'THEN
cnt:=cnt+direction; ENDIF; ENDIF; ENDIF;
qj <= cnt;
ENDPROCESS;--Asynchronousclearloadenablecounter PROCESS(clk) VARIABLE cnt:INTEGERRANGE0TO255; BEGIN IF(clk'EVENTANDclk='1')THEN IFclear='0'THEN
cnt:=0; ELSE IFld='0'THEN
cnt:=d; ELSE IFenable='1'THEN
cnt:=cnt+1; ENDIF; ENDIF; ENDIF; ENDIF;
qk <= cnt;
ENDPROCESS;
--Asynchronousclearup/downcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; VARIABLE direction :INTEGER; BEGIN IF(up_down='1')THEN direction:=1; ELSE direction:=-1; ENDIF;
IF(clk'EVENTANDclk='1')THEN
IFclear='0'THEN
cnt:=0; ELSE
cnt:=cnt+direction; ENDIF; ENDIF;
ql <= cnt;
ENDPROCESS;--Asynchronousclearenableup/downcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; VARIABLE direction :INTEGER; BEGIN IF(up_down='1')THEN direction:=1; ELSE direction:=-1; ENDIF;
IF(clk'EVENTANDclk='1')THEN IFclear='0'THEN
cnt:=0; ELSE IFenable='1'THEN
cnt:=cnt+direction; ENDIF; ENDIF; ENDIF;
qm <= cnt;
ENDPROCESS;--Amodulus200upcounter PROCESS(clk) VARIABLE cnt :INTEGERRANGE0TO255; CONSTANT modulus :INTEGER:=200; BEGIN IF(clk'EVENTANDclk='1')THEN IFcnt=modulusTHEN
cnt:=0; ELSE
cnt:=cnt+1; ENDIF; ENDIF;
qn <= cnt;
ENDPROCESS;ENDa;實(shí)驗(yàn)6:地址譯碼器VHDL描述
--M68008AddressDecoder--Addressdecoderforthem68008--asbarmustbe'0'toenableanyoutput--csbar(0):X"00000"toX"01FFF"--csbar(1):X"40000"toX"43FFF"--csbar(2):X"08000"toX"0AFFF"--csbar(3):X"E0000"toX"E01FF"--downloadfrom&
libraryieee;useieee.std_logic_1164.all;entityaddrdecisport(
asbar:instd_logic;address:instd_logic_vector(19downto0);
csbar:outstd_logic_vector(3downto0));endentityaddrde
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 實(shí)習(xí)護(hù)士的心得體會(huì)15篇
- 物流實(shí)習(xí)報(bào)告范文集合5篇
- 畢業(yè)典禮學(xué)校領(lǐng)導(dǎo)代表講話稿篇
- 年度銷售工作計(jì)劃模板8篇
- 公司實(shí)習(xí)報(bào)告范文9篇
- 北師大版八年級(jí)上冊數(shù)學(xué)期末考試試卷及答案
- 九年級(jí)語文下冊 第六單元 23《詩詞曲五首》白雪歌送武判官歸京教學(xué)實(shí)錄 新人教版
- 植樹節(jié)日作文600字范文
- 學(xué)生會(huì)面試自我介紹匯編15篇
- 教師個(gè)人工作計(jì)劃(集合15篇)
- 2024年1月福建省普通高中學(xué)業(yè)水平合格性考試化學(xué)試題(解析版)
- 低空經(jīng)濟(jì)的商業(yè)化路徑分析
- 項(xiàng)目年終總結(jié)及明年計(jì)劃
- 新外貿(mào)業(yè)務(wù)員年終總結(jié)
- 化工廠設(shè)備安裝施工方案
- 國家電網(wǎng)公司招聘高校畢業(yè)生應(yīng)聘登記表
- 代賬公司會(huì)計(jì)主管年終總結(jié)
- 創(chuàng)新思維訓(xùn)練學(xué)習(xí)通超星期末考試答案章節(jié)答案2024年
- 2024年一級(jí)注冊消防工程師考試復(fù)習(xí)題庫100題及答案(一)
- 定向羅盤項(xiàng)目可行性實(shí)施報(bào)告
- 學(xué)術(shù)基本要素:專業(yè)論文寫作學(xué)習(xí)通超星期末考試答案章節(jié)答案2024年
評(píng)論
0/150
提交評(píng)論