




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
1、 本科課程設計報告課程名稱: eda技術(shù)與fpga應用設計 設計項目: 交通燈控制器 實驗地點: cpld實驗室 指導教師: 張文愛 2016 年 5月24日一、設計要求設計一個由一條主干道和一條支干道的十字路口的交通燈控制器,具體要求如下:(1) 主、支干道各設有一個綠、黃、紅指示燈,兩個顯示數(shù)碼管。(2) 主干道處于常允許通行狀態(tài),而支干道有車來才允許通行。當主干道允許通行亮綠燈時,支干道亮紅燈。而支干道允許通行亮綠燈時,主干道亮紅燈。 (3) 當主、支道均有車時,兩者交替允許通行,主干道每次放行45 s,支干道每次放行25 s,由亮綠燈變成亮紅燈轉(zhuǎn)換時,先亮5 s的黃燈作為過渡,并進行減
2、計時顯示。二、設計方案(1) 設置支干道有車開關(guān)sb。(2) 系統(tǒng)中要求有45秒、25秒和5秒三種定時信號,需要設計三種相應的計時顯示電路。計時方法為倒計時。定時的起始信號由主控電路給出,定時時間結(jié)束的信號輸入到主控電路。(3) 主控制電路的輸入信號一方面來自車輛檢測,另一方面來自45秒、25秒、5秒的定時到信號;輸出有計時啟動信號(置計數(shù)起始值)和紅綠燈驅(qū)動信號。狀態(tài)轉(zhuǎn)移如圖所示,用狀態(tài)機描述。三、設計步驟1.編寫各個模塊的vhdl程序。2.上機調(diào)試優(yōu)化程序。3.程序合成器件模塊,并連接原理圖。4.編寫并下載程序,進行硬件實現(xiàn)。四、模塊結(jié)構(gòu)五、模塊源程序1. jtdkzlibrary iee
3、e;use ieee.std_logic_1164.all;entity jtdkz is port(clk,sb,cnt,rst:in std_logic; en,mr,my,mg,br,by,bg: out std_logic; din:out std_logic_vector(7 downto 0);end entity jtdkz;architecture art of jtdkz is type state_type is(a,b,c,d); signal p_state,n_state: state_type; beginreg:process(clk,rst) is begin
4、if rst=1 then p_state=a; elsif(clkevent and clk=1)then p_statemr=0; my=0; mg=1; br=1; by=0; bg=0; if(sb and cnt)=1 then n_state=b; din=00000101; en=0; else n_state=a; din=01000101; enmr=0; my=1; mg=0; br=1; by=0; bg=0; if cnt=1 then n_state=c; din=00100101; en=0; else n_state=b; din=01000101; enmr=1
5、; my=0; mg=0; br=0; by=0; bg=1; if cnt=1 then n_state=d; din=00000101; en=0; else n_state=c; din=01000101; enmr=1; my=0; mg=0; br=0; by=1; bg=0; if cnt=1 then n_state=a;din=01000101; en=0; else n_state=d; din=01000101; en=1; end if;end case;end process com;end architecture art;2.jsqlibrary ieee;use
6、ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; entity jsq is port(en, rst: in std_logic; din: in std_logic_vector(7 downto 0); clk:in std_logic; cnt: out std_logic; qh, ql:buffer std_logic_vector(3 downto 0) ); end entity jsq;architecture art of jsq isbegincnt=1 when (qh=0000 and ql=0000)
7、else 0; process(clk,en,rst) beginif rst=1 then qh=0100;ql=0101;elsif clkevent and clk=1 then if en=0 then qh=din(7 downto 4); ql=din(3 downto 0);elsif ql=0 then ql=1001; if qh=0 then qh=1001; else qh=qh-1; end if; else ql=ql-1; end if; end if;end process;end architecture art;library ieee;use ieee.st
8、d_logic_1164.all;use ieee.std_logic_unsigned.all;entity work1 isport (clk : in std_logic;rst:in std_logic;ena:in std_logic;outy:out std_logic_vector(3 downto 0);cout:out std_logic);end work1;architecture behav of work1 issignal cqi: std_logic_vector(3 downto 0);beginp_reg:process(clk,rst,ena)beginif rst = 1then cqi = 0000;elsif clk event and clk = 1thenif ena = 1then cqi = cqi + 1;end if;end if;outy = cqi;end process p_reg;cout led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7s led7snull;end case;end
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 政務禮儀考試題庫及答案
- umo考試題及答案
- 餐飲常識考試題及答案
- 2025-2030年中國電動自行車行業(yè)融資分析及發(fā)展前景預測研究報告
- 2025-2030年中國熱氣機商業(yè)計劃書
- 2025-2030年中國汽車4S店項目投資風險研究報告
- 2025-2030年中國檸檬飲料市場競爭格局分析及行業(yè)發(fā)展機遇預測研究報告
- 2025-2030年中國服務機器人行業(yè)運行分析與市場投資需求前景預測研究報告
- 2025-2030年中國廣告公司行業(yè)運行趨勢分析及發(fā)展戰(zhàn)略研究報告
- 2025-2030年中國多元素復混肥商業(yè)計劃書
- 2025年船舶駕駛員考試試卷及答案
- Unit 8 Once upon a Time Section A 1a-1e Pronunciation 課件 2024-2025學年英語人教版7年級下冊
- 二級計量師考試歷年真題題庫和答案2024
- 23G409先張法預應力混凝土管樁
- 2022年高考真題-政治(重慶卷) 含答案
- 探索心理學的奧秘智慧樹知到期末考試答案章節(jié)答案2024年北京大學
- 鐵工電〔2023〕54號國鐵集團關(guān)于印發(fā)《普速鐵路工務安全規(guī)則》的通知
- 人教版PEP英語3年級全部單詞默寫表格以及背誦版本
- 人際關(guān)系與溝通技巧全書ppt完整版課件整本書電子教案最全教學教程
- 數(shù)據(jù)中心機房工程施工組織方案
- 酒店二次供水應急預案
評論
0/150
提交評論