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

下載本文檔

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

文檔簡介

1FPGA示器用來顯示允許通行或通行的時間倒計時。本設(shè)計我們是基于FPGA的采用大規(guī)??删幊踢壿嬈骷﨔PGA,通過設(shè)計來實現(xiàn)譯碼顯示模塊6六部分組成。本設(shè)計在XilinxISE和 SE軟件平臺上使用VHDL語2顯示的順序為:左轉(zhuǎn) 綠 黃 紅燈15秒、80秒、45秒、5秒。狀態(tài)表如表所表3- 紅紅紅紅綠黃55紅綠黃紅紅紅6六部分組成。各個模塊的關(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的值來決定紅綠燈的狀程序如下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)過設(shè)計、編譯、仿真,結(jié)果正確。最后 測試和效果評估在分頻器程序仿真結(jié)果圖中,clk1khz1khz;clk1hz為輸出脈1hz的信號。controlloadat,loadbtdaojishi模塊測試(含兩個clk,執(zhí)行一次,并將結(jié)果輸出。Mainmain模塊程序仿真結(jié)果圖中,S為輸入信號,用來表明整個紅綠燈的狀態(tài)(6個狀態(tài):S0~S5);lrgy為輸出信號,代表整個紅綠燈的亮和滅的情況,燈的排序從到低綠燈、黃燈,然后南北方向左轉(zhuǎn)燈、紅燈、綠燈、黃燈。從圖中我們可以看出S的狀態(tài)從”到“101aout1代表十位,aout2代表個位;bout1,bout2bt的值分解成個位和十bout1代表十位,bout2代表個位。仿真結(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. 本站所有資源如無特殊說明,都需要本地電腦安裝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

提交評論