CPLD實(shí)驗(yàn) 數(shù)字時(shí)鐘 波形發(fā)生器 簡(jiǎn)單組合邏輯設(shè)計(jì)_第1頁(yè)
CPLD實(shí)驗(yàn) 數(shù)字時(shí)鐘 波形發(fā)生器 簡(jiǎn)單組合邏輯設(shè)計(jì)_第2頁(yè)
CPLD實(shí)驗(yàn) 數(shù)字時(shí)鐘 波形發(fā)生器 簡(jiǎn)單組合邏輯設(shè)計(jì)_第3頁(yè)
CPLD實(shí)驗(yàn) 數(shù)字時(shí)鐘 波形發(fā)生器 簡(jiǎn)單組合邏輯設(shè)計(jì)_第4頁(yè)
CPLD實(shí)驗(yàn) 數(shù)字時(shí)鐘 波形發(fā)生器 簡(jiǎn)單組合邏輯設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩29頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

CPLD實(shí)驗(yàn)

一實(shí)驗(yàn)要求:熟練運(yùn)用MAX+PLUSII分析組合邏輯電路、時(shí)序電路,能夠運(yùn)用VHDL對(duì)簡(jiǎn)單的邏輯電路功能進(jìn)行描述。二、實(shí)驗(yàn)結(jié)果要求對(duì)仿真結(jié)果生成的仿真波形文件進(jìn)行保存,并對(duì)結(jié)果進(jìn)行分析說(shuō)明。

實(shí)驗(yàn)1:簡(jiǎn)單組合邏輯設(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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論