EDA技術(shù)及應(yīng)用課程設(shè)計(jì)_交通燈_第1頁
EDA技術(shù)及應(yīng)用課程設(shè)計(jì)_交通燈_第2頁
EDA技術(shù)及應(yīng)用課程設(shè)計(jì)_交通燈_第3頁
已閱讀5頁,還剩5頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、TAIYUANUNIVEKSITYOFTECHNOLO<SY課程設(shè)計(jì)課程名稱:EDA技術(shù)與FPGA應(yīng)用設(shè)計(jì)課設(shè)題目:交通燈控制實(shí)驗(yàn)地點(diǎn):電機(jī)館跨越機(jī)房專業(yè)班級(jí):電信1001班學(xué)號(hào):2010001207學(xué)生姓名:吳清濤指導(dǎo)教師:張文愛2013年6月10日課設(shè)題目:交通燈控制器、設(shè)計(jì)要求設(shè)計(jì)一個(gè)由一條主干道和一條支干道的十字路口的交通燈控制器,具體要求如下:(1) 主、支干道各設(shè)有一個(gè)綠、黃、紅指示燈,兩個(gè)顯示數(shù)碼管。(2) 主干道處于常允許通行狀態(tài),而支干道有車來才允許通行。當(dāng)主干道允許通行亮綠燈時(shí),支干道亮紅燈。而支干道允許通行亮綠燈時(shí),主干道亮紅燈。(3) 當(dāng)主、支道均有車時(shí),兩者交替

2、允許通行,主干道每次放行45s,支干道每次放行25s,由亮綠燈變成亮紅燈轉(zhuǎn)換時(shí),先亮5s的黃燈作為過渡,并進(jìn)行減計(jì)時(shí)顯示。二、設(shè)計(jì)方案(1)設(shè)置支干道有車開關(guān)SB。系統(tǒng)中要求有45秒、25秒和5秒三種定時(shí)信號(hào),需要設(shè)計(jì)三種相應(yīng)的計(jì)時(shí)顯示電路。計(jì)時(shí)方法為倒計(jì)時(shí)。定時(shí)的起始信號(hào)由主控電路給出,定時(shí)時(shí)間結(jié)束的信號(hào)輸入到主控電路。(3)主控制電路的輸入信號(hào)一方面來白車輛檢測(cè),另一方面來白45秒、25秒、5秒的定時(shí)到信號(hào);輸出有計(jì)時(shí)啟動(dòng)信號(hào)(置計(jì)數(shù)起始值)和紅綠燈驅(qū)動(dòng)信巨狀態(tài)轉(zhuǎn)移如圖所示,用狀態(tài)機(jī)描述。45s未到或5s未到模塊結(jié)構(gòu)如下圖:1、將各部分VHDL參考程序輸入軟件,編譯使其各個(gè)通過1、交通燈主

3、控制器模塊JTDKZ:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;ENTITYJTDKZISPORT(CLK,SB,cnt,RST:INSTD_LOGIC;en,MR,MY,MG,BR,BY,BG:OUTSTD_LOGIC;din:outSTD_LOGIC_vector(7downto0);ENDENTITYJTDKZ;ARCHITECTUREARTOFJTDKZISComponentCNT45SISPORT(SB,CLK,EN45:INSTD_LOGIC;DOUT45M,DOUT45B:OUTSTD_LOGIC_VECTOR(7DOWNTO0);Endcom

4、ponentComponentCNT05SISPORT(CLK,EN05M,EN05B:INSTD_LOGIC;DOUT5:OUTSTD_LOGIC_VECTOR(7DOWNTO0);EndcomponentComponentCNT25SISPORT(SB,SM,CLK,EN25:INSTD_LOGIC;DOUT25M,DOUT25B:OUTSTD_LOGIC_VECTOR(7DOWNTO0);EndcomponentComponentSHKZISPORT(EN45,EN25,EN05M,EN05B:INSTD_LOGIC;AIN45M,AIN45B;INSTD_LOGIC_VECTOR(7D

5、OWNTO0);AIN25M,AIN25B,AIN05;INSTD_LOGIC_VECTOR(7DOWNTO0);DOUTM,DOUTB:OUTSTD_LOGIC_VECTOR(7DOWNTO0);EndcomponentTYPESTATE_TYPEIS(A,B,C,D);SIGNALp_STATE,n_state:STATE_TYPE;BEGINreg:PROCESS(CLK,rst)ISBEGINifrst='1'thenp_STATE<=A;ELSIF(CLK'EVENTANDCLK='1')THENp_STATE<=n_state;E

6、NDIF;endprocessreg;com:PROCESS(sb,cnt,p_state)beginCASEp_STATEISWHENA=>MR<='1'MY<='1'MG<='0'BR<='0'BY<='1'BG<='1'IF(SBANDcnt)='1'THENn_STATE<=B;din<="00000101"EN<='0'ELSEn_STATE<=A;din<=&quo

7、t;01000101"EN<='1'ENDIF;WHENB=>MR<='1'MY<='0'MG<='1'BR<='0'BY<='1'BG<='1'IFcnt='1'THENn_STATE<=C;din<="00100101"EN<='0'ELSEn_STATE<=B;din<="01000101"EN<='1&#

8、39;ENDIF;WHENC=>MR<='0'MY<='1'MG<='1'BR<='1'BY<='1'BG<='0'IFcnt='1'THENn_STATE<=D;din<="00000101"EN<='0'ELSEn_STATE<=C;din<="01000101"EN<='1'ENDIF;WHEND=>MR<='

9、0'MY<='1'MG<='1'BR<='1'BY<='0'BG<='1'IFcnt='1'THENn_STATE<=A;din<="01000101"EN<='0'ELSEn_STATE<=D;din<="0100010T'EN<='1'ENDIF;ENDCASE;ENDPROCESScom;ENDARCHITECTUREART;W訥->!CA

10、65;kWAjfc*<z.tc_300BfeSourcelargfftSvnthBSiz®HDL馴幅tQpttorSntfowt?ebfiBP至*2電lam;桐jtJa2_鼻|CAPNUM2、45S計(jì)時(shí)譯碼模塊CNT45S:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT45SISPORT(SB,CLK,EN45:INSTD_LOGIC;DOUT45M,DOUT45B:OUTSTD_LOGIC_VECTOR(7DOWNTO0);ENDCNT45S;ARCHITECTUR

11、EARTOFCNT45SISSIGNALCNT6B:STD_LOGIC_VECTOR(5DOWNTO0);BEGINPROCESS(SB,CLK,EN45)ISBEGINIFSB='0'THENCNT6B<=CNT6B-CNT6B-1;ELSIF(CLK'EVENTANDCLK='1')THENIFEN45='1'THENCNT6B<=CNT6B+1;ELSIFEN45='0'THENCNT6B<=CNT6B-CNT6B-1;ENDIF;ENDIF;ENDPROCESS;PROCESS(CNT6B)ISB

12、EGINCASECNT6BISWHEN”000000”=>DOUT45M<=”0100010T'DOUT45B<=”01010000”;WHEN”00000T'=>DOUT45M<=”01000100”;DOUT45B<=”0100100T'WHEN”000010”=>DOUT45M<=”0100001T'DOUT45B<=”01001000”;WHEN”00001T'=>DOUT45M<=”01000010”;DOUT45B<=”0100011T'WHEN”000100”=

13、>DOUT45M<=”0100000T'DOUT45B<=”01000110”;WHEN”00010T'=>DOUT45M<=”01000000”;DOUT45B<=”0100010T'WHEN”000110”=>DOUT45M<=”0011100T'DOUT45B<=”01000100”;WHEN”00011T'=>DOUT45M<=”00111000”;DOUT45B<=”0100001T'WHEN”001000”=>DOUT45M<=”0011011T

14、9;DOUT45B<=”01000010”;WHEN”00100T'=>DOUT45M<=”00110110”;DOUT45B<=”0100000T'WHEN”001010”=>DOUT45M<=”0011010T'DOUT45B<=”01000000”;WHEN”00101T'=>DOUT45M<=”00110100”;DOUT45B<=”0110100T'WHEN”001100”=>DOUT45M<=”0011001T'DOUT45B<=”00111000”;WHE

15、N”00110T'=>DOUT45M<=”00110010”;DOUT45B<=”0011011T'WHEN”001110”=>DOUT45M<=”0011000T'DOUT45B<=”00110110”;WHEN”00111T'=>DOUT45M<=”00110000”;DOUT45B<=”0011010T'WHEN”010000”=>DOUT45M<=”0010100T'DOUT45B<=”00110100”;WHEN”01000T'=>DOUT45M<

16、;=”00101000”;DOUT45B<=”0011001T'WHEN”010010”=>DOUT45M<=”0010011T'DOUT45B<=”00110010”;WHEN”01001T'=>DOUT45M<=”00100110”;DOUT45B<=”0011000T'WHEN”010100”=>DOUT45M<=”0010010T'DOUT45B<=”00110000”;WHEN”01010T'=>DOUT45M<=”00100100”;DOUT45B<=”00

17、10100T'WHEN”010110”=>DOUT45M<=”0010001T'DOUT45B<=”00101000”;WHEN”01011T'=>DOUT45M<=”00100010”;DOUT45B<=”0010011T'WHEN”011000”=>DOUT45M<=”0010000T'DOUT45B<=”00100110”;WHEN”01100T'=>DOUT45M<=”00100000”;DOUT45B<=”0010010T'WHEN”011010”=>

18、DOUT45M<=”0001100T'DOUT45B<=”00100100”;WHEN”01101T'=>DOUT45M<=”00011000”;DOUT45B<=”0010001T'WHEN”011100”=>DOUT45M<=”0001011T'DOUT45B<=”00100010”;WHEN”01110T'=>DOUT45M<=”00010110”;DOUT45B<=”0010000T'WHEN”011110”=>DOUT45M<=”0001010T'DO

19、UT45B<=”00100000”;WHEN”01111T'=>DOUT45M<=”00010100”;DOUT45B<=”0001100T'WHEN”100000”=>DOUT45M<=”0001001T'DOUT45B<=”00011000”;WHEN”10000T'=>DOUT45M<=”00010010”;DOUT45B<=”0001011T'WHEN”100010”=>DOUT45M<=”0001000T'DOUT45B<=”00010110”;WHEN”10

20、001T'=>DOUT45M<=”00010000”;DOUT45B<=”0001010T'WHEN”100100”=>DOUT45M<=”0000100T'DOUT45B<=”00010100”;WHEN”10010T'=>DOUT45M<=”00001000”;DOUT45B<=”0001001T'WHEN”100110”=>DOUT45M<=”0000011T'DOUT45B<=”00010010”;WHEN"10011T'=>DOUT45M&l

21、t;="00000110"DOUT45B<="0001000T'WHEN”101000”=>DOUT45M<=”0000010T'DOUT45B<=”00010000”;WHEN"10100T'=>DOUT45M<="00000100"DOUT45B<="0000100T'WHEN"101010"=>DOUT45M<="0000001T'DOUT45B<="00001000"W

22、HEN"10101T'=>DOUT45M<="00000010"DOUT45B<="0000011T'WHEN"101100"=>DOUT45M<="0000000T'DOUT45B<="00000110"WHENOTHERS=>DOUT45M<=”00000000”;DOUT45B<=”00000000”;ENDCASE;ENDPROCESS;END;EieViiewSourceTargetSnthesreHDLAnaiyrt

23、OptionsWindowHefcfi9PQII0%JQQ!11®I®CAPNUM3、5S計(jì)時(shí)譯碼模塊CNT5S:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT05SISPORT(CLK,EN05M,EN05B:INSTD_LOGIC;DOUT5:OUTSTD_LOGIC_VECTOR(7DOWNTO0);ENDCNT05S;ARCHITECTUREARTOFCNT05SISSIGNALCNT3B:STD_LOGIC_VECTOR(2DOWNTO0);BEGINP

24、ROCESS(CLK,EN05M,EN05B)ISBEGINIF(CLK'EVENTANDCLK='1')THENIFEN05M='1'THENCNT3B<=CNT3B+1;ELSIFEN05B='1'THENCNT3B<=CNT3B+1;ELSIFEN05B='0'THENCNT3B<=CNT3B-CNT3B-1;ENDIF;ENDIF;ENDPROCESS;PROCESS(CNT3B)BEGINCASECNT3BISWHEN"000"=>DOUT5<="000

25、00101"WHEN"001"=>DOUT5<="00000100"WHEN"010"=>DOUT5<="00000011"WHEN"011"=>DOUT5<="00000010"WHEN"100"=>DOUT5<="00000001"WHENOTHERS=>DOUT5<="00000000"ENDCASE;ENDPROCESS;END;4、25S

26、計(jì)時(shí)譯碼模塊CNT25S:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYCNT25SISPORT(SB,SM,CLK,EN25:INSTD_LOGIC;DOUT25M,DOUT25B:OUTSTD_LOGIC_VECTOR(7DOWNTO0);ENDENTITYCNT25S;ARCHITECTUREARTOFCNT25SISSIGNALCNT5B:STD_LOGIC_VECTOR(4DOWNTO0);BEGINPROCESS(SB,SM,CLK,EN25)ISBEGINIFSB='

27、0'THENCNT5B<=CNT5B-CNT5B-1;ELSIFSM='0'THENCNT5B<=CNT5B-CNT5B-1;ELSIF(CLK'EVENTANDCLK='1')THENIFEN25='1'THENCNT5B<=CNT5B+1;ELSIFEN25='0'THENCNT5B<=CNT5B-CNT5B-1;ENDIF;ENDIF;ENDPROCESS;PROCESS(CNT5B)ISBEGINCASECNT5BISWHEN"00000"=>DOUNT25

28、B<="00100101"DOUT25M<="00110000"WHEN"00001"=>DOUNT25B<="00100100"DOUT25M<="00101001"WHEN"00010"=>DOUNT25B<="00100011"DOUT25M<="00101000"WHEN"00011"=>DOUNT25B<="00100010"D

29、OUT25M<="00100111"WHEN"00100"=>DOUNT25B<="00100001"DOUT25M<="00100110"WHEN"00101"=>DOUNT25B<="00100000"DOUT25M<="00100101"WHEN"00110"=>DOUNT25B<="00011001"DOUT25M<="00100100&q

30、uot;WHEN"00111"=>DOUNT25B<="00011000"DOUT25M<="00100011"WHEN"01000"=>DOUNT25B<="00010111"DOUT25M<="00100010"WHEN"01001"=>DOUNT25B<="00010110"DOUT25M<="00100001"WHEN"01010"=&

31、gt;DOUNT25B<="00010101"DOUT25M<="00100000"WHEN"01011"=>DOUNT25B<="00010100"DOUT25M<="00011001"WHEN"01100"=>DOUNT25B<="00010011"DOUT25M<="00011000"WHEN"01101"=>DOUNT25B<="00010

32、010"DOUT25M<="00010111"WHEN"01110"=>DOUNT25B<="00010001"DOUT25M<="00010110"WHEN"01111"=>DOUNT25B<="00010000"DOUT25M<="00010101"WHEN"10000"=>DOUNT25B<="00001001"DOUT25M<="

33、00010100"WHEN"10001"=>DOUNT25B<="00001000"DOUT25M<="00010011"WHEN"10010"=>DOUNT25B<="00000111"DOUT25M<="00010010"WHEN"10011"=>DOUNT25B<="00000110"DOUT25M<="00010001"WHEN"101

34、00"=>DOUNT25B<="00000101"DOUT25M<="00010000"WHEN"10101"=>DOUNT25B<="00000100"DOUT25M<="00001001"WHEN"10110"=>DOUNT25B<="00000011"DOUT25M<="00001000"WHEN"10111"=>DOUNT25B<=&

35、quot;00000010"DOUT25M<="00000111"WHEN"11000"=>DOUNT25B<="00000001"DOUT25M<="00000110"WHENOTHERS=>DOUNT25B<="00000000"DOUT25M<="00000000"ENDCASE;ENDPROCESS;END;oSTJtfv-O:fDADetJGcnt255.tEAOOElsJ£l0wSourcelaroet

36、SynthesizeHDLanalystQpttore四rriowUeb建PE9司*劇畸£!危|®£>|學(xué)|翁豹少企審拿mtES總u_CAPNUM5、顯示控制模塊XSKZ:LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYSHKZISPORT(EN45,EN25,EN05M,EN05B:INSTD_LOGIC;AIN45M,AIN45B;INSTD_LOGIC_VECTOR(7DOWNTO0);AIN25M,AIN25B,AIN05;INSTD_LOGIC_VECTOR(7DOWNTO0);DOUTM,DOUTB:OUTSTD_LOGIC_VECTOR(7DOWNTO0);ENDSHKZ;ARCHITECTUREA

溫馨提示

  • 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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論