基于fpga的交通燈控制設(shè)計(jì)_第1頁(yè)
基于fpga的交通燈控制設(shè)計(jì)_第2頁(yè)
基于fpga的交通燈控制設(shè)計(jì)_第3頁(yè)
基于fpga的交通燈控制設(shè)計(jì)_第4頁(yè)
基于fpga的交通燈控制設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩10頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1FPGA示器用來(lái)顯示允許通行或通行的時(shí)間倒計(jì)時(shí)。本設(shè)計(jì)我們是基于FPGA的采用大規(guī)??删幊踢壿嬈骷﨔PGA,通過(guò)設(shè)計(jì)來(lái)實(shí)現(xiàn)譯碼顯示模塊6六部分組成。本設(shè)計(jì)在XilinxISE和 SE軟件平臺(tái)上使用VHDL語(yǔ)2顯示的順序?yàn)椋鹤筠D(zhuǎn) 綠 黃 紅燈15秒、80秒、45秒、5秒。狀態(tài)表如表所表3- 紅紅紅紅綠黃55紅綠黃紅紅紅6六部分組成。各個(gè)模塊的關(guān)系與構(gòu)架如下圖所示。1S的脈沖波。程序如下libraryuseuseieee.std_logic_unsigned.all;entityfenpinqi port(clk1khz:inclk1hz:outstd_logic); architectureaoffenpinqiisprocess(clk1khz) q:integer:=0; ifclk1khz'eventandclk1khz='1'thenifq=512thenr:=notr; elseendif;endif;endprocess;enda;controlcontrolclkSS的值來(lái)決定紅綠燈的狀程序如下libraryuseuseieee.std_logic_unsigned.all;entitycontrolisport(clk:ins:outstd_logic_vector(2downto0);loadat,loadbt:outstd_logic;at,bt:outstd_logic_vector(6downto0)); architectureaofcontrolsignalt:integerrange0to130:=0; clk'eventandclk='1'then then elsift=15then elsift=60thenelsift=65then elsift=80 s<="100";elsift=125 endendift=130then endif;endprocess;endclk,就進(jìn)行一次減一操作。atdaojishi模塊程序libraryuseuseieee.std_logic_unsigned.all;entityatdaojishiisport(clk,loadat:in std_logic_vector(6downto0); std_logic_vector(6downto0));endarchitectureaofatdaojishisignalcountat:std_logic_vector(6downto0);waituntilifloadat='1' elsecountat<=countat-1;endif;endprocess;endMainlibraryuseuseieee.std_logic_unsigned.all;entitymainisport s:instd_logic_vector(2downtolrgy:outstd_logic_vector(7downtoendarchitectureaofmainisvariableb:std_logic_vector(7downto0);caseswhen=>when=>when=>when=>when=>when => whenothers=>b:=" endcase;endprocess;end譯碼程序如下libraryuseuseieee.std_logic_unsigned.all;entityto8421bcdisport( std_logic_vector(3downto0); std_logic_vector(6downto0));endarchitectureaofto8421bcdis ifat>=" "then " " " " " " "endif;ifbt>=" "then " " " " " " "endif;endprocess;enda;libraryuseuseieee.std_logic_unsigned.all;entityyimaxianshiisport(at1,bt1:instd_logic_vector(3downto0);at2,bt2:instd_logic_vector(6downto0);aout1,aout2,bout1,bout2:outstd_logic_vector(7downto0));endyimaxianshi;architectureaofyimaxianshiiscaseat1when"0000"=> when"0001"=> when"0010"=> when"0011"=> when"0100"=> when"0101"=> when"0110"=> when"0111"=> when"1000"=> when"1001"=> others=>aout1<=" endcase;case when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>"; others=>aout2<=" endcase;case when"0000"=> when"0001"=> when"0010"=> when"0011"=> when"0100"=> when"0101"=> when"0110"=> when"0111"=> when"1000"=> when"1001"=> others=>bout1<=" endcase;casebt2when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>";when"=>"; others=>bout2<=" endcase;endprocess;enda;模塊、yima模塊和yimaxianshi模塊。這些模塊均經(jīng)過(guò)設(shè)計(jì)、編譯、仿真,結(jié)果正確。最后 測(cè)試和效果評(píng)估在分頻器程序仿真結(jié)果圖中,clk1khz1khz;clk1hz為輸出脈1hz的信號(hào)。controlloadat,loadbtdaojishi模塊測(cè)試(含兩個(gè)clk,執(zhí)行一次,并將結(jié)果輸出。Mainmain模塊程序仿真結(jié)果圖中,S為輸入信號(hào),用來(lái)表明整個(gè)紅綠燈的狀態(tài)(6個(gè)狀態(tài):S0~S5);lrgy為輸出信號(hào),代表整個(gè)紅綠燈的亮和滅的情況,燈的排序從到低綠燈、黃燈,然后南北方向左轉(zhuǎn)燈、紅燈、綠燈、黃燈。從圖中我們可以看出S的狀態(tài)從”到“101aout1代表十位,aout2代表個(gè)位;bout1,bout2bt的值分解成個(gè)位和十bout1代表十位,bout2代表個(gè)位。仿真結(jié)果完全正確,符合預(yù)期。**Failure:(vsim-3807)Typesdonotmatchbetweencomponentandentityforport Time:0 tion: Instance:/abc_abc_sch_tb/uut/xlxi_2File:control.vhd#**Failure:(vsim-3807)Typesdonotmatchbetweencomponentandentityforport Time:0 tion: Instance:/abc_abc_sch_tb/uut/xlxi_2File:control.vhd#**Failure:(vsim-3807)Typesdonotmatchbetweencomponentandentityforport Time:0 tion: Instance:/abc_abc_sch_tb/uut/xlxi_2File:control.vhd 幻燈片文JPEG[1].

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶(hù)所有。
  • 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ì)用戶(hù)上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶(hù)上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶(hù)因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論