彩燈實(shí)驗(yàn)報告_第1頁
彩燈實(shí)驗(yàn)報告_第2頁
彩燈實(shí)驗(yàn)報告_第3頁
彩燈實(shí)驗(yàn)報告_第4頁
彩燈實(shí)驗(yàn)報告_第5頁
已閱讀5頁,還剩5頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、設(shè)計八彩燈控制器要求:1、設(shè)計一個彩燈控制器,使彩燈(LED管)能連續(xù)發(fā)出四種以上不同得顯示形式:2、隨著彩燈顯示形式得變化,發(fā)出不同得音響聲。設(shè)計提示:1、彩燈顯示得不同形式可由不同進(jìn)制汁數(shù)器驅(qū)動LED顯示完成;2、音響由選擇不同頻率CP脈沖驅(qū)動揚(yáng)聲器形成:3、彩燈顯示形式由實(shí)驗(yàn)箱中撥碼開關(guān)控制。實(shí)驗(yàn)程序LI BRARYieee:USE i e e e、stdjogic_l 1 6 4、al 1 ;USE IEEE、STD_LOGIC_UNSIGNED、ALL:ENTITYcaiden g k o ngzhiqi ISPORT(cl k 1 ,rst, c 1 k2。: IN std_ 1

2、ogic;c a idcng : OUT。s t d_I o gic_v e c t o r (7 down t o 0);c z : in std_ 1 og i c_vect o r (1 d ownto 0);speake r : ou t s t do g i c );EN D caide n g k o ng z hiqi:ARC II 1 TEC TUR E one OF caiden g kong z hiq i I S。PONENT counter_8PORT(clkjs t:INstdJo g i c;co u nt_ou t o :OU T 4nt e g e r r a

3、n ge 0 to 7。);END PONENT;PO NENTc a id e n g k ongz h iPORT(I nsz:in stdo g ic_vector ( 1 downto 0 ):Inpu t: I N INTEGER RANGE OTO 7;R s t o : i n s t d_logic;out p ub:OUT std_log i c_vecto r (7 d ownto 0 );END PON ENT ;PONENTfe n pin qiPORT(clk,r st。 號 I Nst d _ 】o gic;clk_l 0 , c lk_ 4 , clk_6, cl

4、k_8OUTs t d_1 o g ic);E ND PONE N T ;PONENT xz q 4 _ 1PORT(Rst : in std_ 1 o gic;I npxin std_logic_vector (1 dow n to 0 );inL i n 2, in3jn4 f ):rst =rst, ou t put1 0 =g9 c 1 k_4= nit)g,in2=) m, i nu 1 : c oun ter_8port map ( c 1 k= c 1 kl, rst= rst, u2: ca i dengkongzh i po r t map (in s = cz, i npu

5、 t =f, =caideng);u3: fenp i n q i por t m a p (clk= c lk 2 , rst= r st, c 1 k_ clk_6=n, clk_8= k):u4: xzq4_l p o rt m a p ( i np= czt r st= r st, i n 1 = 3=n, i n4 =kt o u t pu t=) spea k e r);END one:LIBRARY ieee;USEicee、std_l o gic_1164. al 1 ;ENTITY f e npinqi IS)POR T(a c 1 k ,rsb:1 N stdog i c:

6、。c 1 k _ 1 0 , c lk_4.cl k _ 6 ,clk_8: OUT std Jog i c。);END fenp i nqi:ARCH I TECTURE cd OFf e npinqi 1 Sb e g inp 1 : process(clkt rs t )variable a :in t e ge r ran g e 0 t o 2 0 :b e g inif r s t = 1 thenc I k_4 (=0a: = 0 ;e 1 seif elk even t and c lk= r t h e nif a ) =3 thena:= 0 :elsea : =a+l;c

7、lk_4 (=*0 end if:en d if:end if;end p r oc e ss p 1 :p2: proc e ss(c I k jst)variable b: i ntege r rang e 0 t o 2 0 : beginif rs t =T thenc I k_6 V = O:b:=0:el s ei f clke vent and c lk=z ltlie nif b=5 thenb:=0 ;cl k_6v=,1 elseb:=b+l;c I k_6=,0,;end if:en d if;end i f :end p roces s p 2;p3: proces s

8、 (elk,rst)va r iab I e c :i n teger range 0 to 20;b e g inif rst=T the nc 1 k_8 =7 the nc:=0;clk_8=T:elsec: =c+l;clk_8= Or:end i f;end if;end if:end proce s sp3:END PROCESS aEND a;LIB R ARY i eee;USE i ccc、s t d_logic164、all;ENT I TYcounter_8 ISoPORT(g c 1 k , rsl: 1 N std_l o g ic;g c oun t _ o ut

9、巧 OUT integer range 0 t o 7);END c o u n t cr_&ARCHITEC TURE a OF co u nter_8 I SoBEGINjPROC ESS (rst,c 1 k)va r i able temp: int e ger r a ng e 0 to 8 ;BEGINoI Frst=, 1THENgt emp: =0:ELSIF (clktve nt and clk=T) THENt e mp: =temp+l:if(temp=8) t h entemp:=0;end if;ENDIF;co u nt_ou t = t emp;oE ND PRO

10、CESS; 。END a;LI B RARY ieee:USE i e e ex stdjogicl 1 64、al I ;ENTITY caid engkon g z hi ISPOR TGins :in s t dogic_ v ecto r (1 downtoO);。input : IN INTEGER RANGE 0 TO 7;arst: in std _logi c :utp utz: OUT s t dog i c_ v ector(7 downto 0 );END c a i dengkongzhi;ARCHITECTUREaOFcaidengko n g z h i ISBEG

11、INPROCESS (input)BEG I Ni f rst = T then ou t p ut outputout p utoutput (=H0 0 0 1 0000 ” :w q w h en 4= outputoutput = ”00000100”:。4 when 6=output=H000 0 0 0 1 0”;gw wh e n 7=) out p u t null;。e nd case;Elsi f (ins=H 0 1H) the n。 a c a s c inpu t i s。 when 0= o u t p ut= 0 001 0 0 0 0H:。 x wh e n 1

12、 =out p ut ou t put o utputoutpu t o utput n u11:ga end case;E1 s if(ins=Ml 0 ) t henCase i nput isooa wh e n 0= o utput 1 0 0 00001 ;。awhen l=output outpu t =*11000 Oil:皿 when 3=output out p ut (= 11 1110 0 1 1 1;z d when 5=output o utput outpu t null;ooooen d ca s e;。 aE 1 sc。 pc a sc i n put is3o

13、when 0=o u t p uto u tpu t = 00000110;。 g when 2=outp u t o u tpu t ou t put output =M 0 1 1 0 0 0 0 0 ;g a wh e n 6=) outputo u t putPaclEAe Pina for xc3a600e-&-f320玄尬上毆#里0 :E、1q dil1051 &Qy Iz | (krtprrtblZrjOat patllBAJM, fl LBJUD2OotpatellWJORcw 如代(htgt&咖ri inrOotpat9BAJMcm Iwk? mXDclklIrcKMJORdk2IrcatJE咖crTrut-tJJIXIIt。從111BAJfKl110153iJjerD ia3P 2efJBl0e82eB. 8OOOeOO L OB Ba123456789 1011 12 13 14 15 16 17 18hPxkpegv 人 g0reZ /Llll rin T- 旳“ P4 Ep: I0_UU?_2/MVTZFCT,r勿并漪冬1乙& 丁勺跆性5Xliax .UKW .XHra .* Z3ng .=? a 皿 f y i w波形仿真圖四選

溫馨提示

  • 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論