用VHDL語言設(shè)計(jì)電梯控制器_第1頁
用VHDL語言設(shè)計(jì)電梯控制器_第2頁
用VHDL語言設(shè)計(jì)電梯控制器_第3頁
已閱讀5頁,還剩10頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、經(jīng)濟(jì)學(xué)院數(shù)字邏輯課程設(shè)計(jì)報(bào)告題 目電梯控制器的設(shè)計(jì)姓 名 meng hao學(xué) 號(hào)班 號(hào) 3 班指導(dǎo)老師 成 績2011年6月1. 課程設(shè)計(jì)目的2. 設(shè)計(jì)任務(wù)3. 開發(fā)工具選擇 3. 設(shè)計(jì)方案4. 模塊描述5. VHDL 實(shí)現(xiàn)6. 調(diào)試仿真7. 課程設(shè)計(jì)回顧總結(jié)參考文獻(xiàn) 1. 課程設(shè)計(jì)目的1) 使學(xué)生更好地鞏固和加深對(duì)基礎(chǔ)知識(shí)的理解,學(xué)會(huì)設(shè)計(jì)中小型數(shù)字系統(tǒng)的方法,獨(dú)立完成調(diào)試過程,增強(qiáng)學(xué)生理論聯(lián)系實(shí)際的能力,提高學(xué)生電路設(shè)計(jì)和分析的能力。2) 通過實(shí)踐教學(xué)引導(dǎo)學(xué)生在理論指導(dǎo)下有所創(chuàng)新,為后繼專業(yè)課的學(xué)習(xí)和日后工程實(shí)踐奠定基礎(chǔ)。2、設(shè)計(jì)要求1) 綜合應(yīng)用課程中學(xué)到的理論知識(shí),獨(dú)立完成一個(gè)設(shè)計(jì)任務(wù)。

2、2) 根據(jù)所要完成的設(shè)計(jì)任務(wù),采用硬件描述語言VHDL進(jìn)行描述,依靠計(jì)算機(jī),借助 EDA開發(fā)工具,實(shí)現(xiàn)系統(tǒng)功能。3) 整理設(shè)計(jì)報(bào)告及相關(guān)的文檔(包括總體設(shè)計(jì)思想,設(shè)計(jì)說明,程序源代碼,仿真結(jié)果圖、設(shè)計(jì)總結(jié)等)。3 .設(shè)計(jì)任務(wù)任務(wù)和要求:可使用撥鍵開關(guān)輸入欲到達(dá)的樓層。要求有數(shù)碼管顯示當(dāng)前樓層,目標(biāo)樓層,并且可以輸入三個(gè)目標(biāo)樓層,按輸入的順序達(dá)到,達(dá)到時(shí)有開門指示燈。在電梯移動(dòng)時(shí),有相應(yīng)的指示燈顯示其方向。注意:電梯經(jīng)過一個(gè)樓層和在樓層停留應(yīng)各自設(shè)定一個(gè)固定時(shí)間。4開發(fā)工具選擇quarters n 5.15. 設(shè)計(jì)方案實(shí)驗(yàn)要求設(shè)計(jì)一個(gè) 3層的電梯的梯控制器,采用狀態(tài)機(jī)來實(shí)現(xiàn),這樣思路清晰,便于理

3、解??梢苑譃?0個(gè)狀態(tài),為“一樓”、“等待狀態(tài)1 ”、“等待狀態(tài)2”、“等待狀態(tài)3”、“等待狀態(tài)4”、“開門”、“關(guān)門”、“上升”、“下降”、“停止”。各狀態(tài)之間按需要轉(zhuǎn)換。由狀態(tài)機(jī)進(jìn)程和信號(hào)指示燈進(jìn)程一起控制。輸入由電梯外部的請(qǐng)求,電梯部的請(qǐng)求,時(shí)鐘信號(hào)組成。輸岀由指示燈和電梯位置組成。6. 模塊描述分為4各部分人員輸入模塊為按鍵模塊電梯控制模塊為電梯條件判斷狀態(tài)模塊信號(hào)燈指示模塊為指示燈顯示模塊電梯終端模塊為電梯服務(wù)模塊7. VHDL實(shí)現(xiàn)代碼分為實(shí)體,結(jié)構(gòu)體兩大塊;結(jié)構(gòu)體中又分為電梯進(jìn)程和指示燈進(jìn)程;電梯進(jìn)程為10個(gè)狀態(tài)機(jī)之間轉(zhuǎn)換的代碼;指示燈進(jìn)程為外部請(qǐng)求指示燈的代碼。library i

4、eee;use ieee.std_logic_1164.all;use ieee.stdo gic_arith.all;use ieee.std_logic_ un sig ned.all;en tity san dia nti isport(anclk:in std_logic;-按鍵時(shí)鐘信號(hào)ticlk:in std_logic;-電梯時(shí)鐘信號(hào)reset:i n std_logic;-復(fù)位fiup:in std_logic;-1樓外部上升請(qǐng)求seup:i n std_logic;-2樓外部上升請(qǐng)求sed n:i n std_logic;-2樓外部下降請(qǐng)求thdn:i n stdo gic;-

5、3樓外部下降請(qǐng)求uplight:buffer stdo gic_vector(3 dow nto 1);-上升請(qǐng)求指示燈dn light:buffer std_lo gic_vector(3 dow nto 1);-下降請(qǐng)求指示燈yilou,erlou,sanlou:in std_logic;-停站請(qǐng)求splight:buffer std _lo gic_vector(3 dow nto 1);-停站請(qǐng)求指示燈weizhi:buffer in teger range 1 to 3;-位置指示door:out std_logic;-門狀態(tài)指示上升下降狀態(tài)指示狀態(tài)機(jī)updow n: buffer

6、std_logic);- end san dia nti;architecture men ghao of san dia nti is type lift_state is (lift1,doorope n,doorclose,wait1,wait2,wait3,wait4,up,dow n,stop);sig nal men g:lift_state;sig nal cleard n:stdo gic; -清除下降狀態(tài)beg inctrlift:process(reset,ticlk)電梯控制進(jìn)程variable hao:integer range 3 downto 1;-顯示樓層 同 w

7、eizh 作用一樣,但顯示方便begi nif reset='1' the nmen g<=lift1;clearup<='0'cleard n<='0'elseif ticlk'event and ticlk='1' thencase meng iswhe n lift1=>door<='1'weizhi<=1;hao:=1;men g<=wait1;whe n wait1=>men g<=wait2;whe n wait2=>clearup&l

8、t;='0'cleard n<='0'men g<=wait3;whe n wait3=>men g<=wait4;whe n wait4=>men g<=doorclose;whe n doorclose=>door<='0'if updow n='O' the nif weizhi=3 the nif splight="OOO" a nd uplight="OOO" a nd dn light="OOO" the nup

9、dow n<='1'men g<=doorclose;else updow n<='1'me ngv=dow n;end if;elsif weizhi=2 the nif splight="OOO" a nd uplight="OOO" a nd dn light="OOO" the nupdow n<='0'men g<=doorclose;elsif splight(3)='1'or (splight(3)='O'and

10、 dnlight(3)='1')the nupdow n< 二'O'men g<=up;else updow n<='1'me ngv=dow n;end if;elsif weizhi=1 the nif splight="OOO" a nd uplight="OOO" a nd dn light="OOO" the n updow n< 二'O'men g<=doorclose;else updow n<=' O'm

11、e ngv=up;end if;end if;elsif updow n='1' the nif weizhi=1 the nif splight="OOO" a nd uplight="OOO" a nd dn light="OOO" the n updow n< 二'O'men g<=doorclose;else updow n<='0' men g<=up;end if;elsif weizhi=2 the nif splight="000&quo

12、t; a nd uplight="000" a nd dn light="000" the nupdow n<='1'men g<=doorclose;elsif splight(1)='1'or (splight(1)='0'and uplight(1)='1')the nupdow n<='1'men g<=dow n;else updow n<=' 0'me ngv=up;end if;elsif weizhi=3 the

13、nif splight="000" a nd uplight="000" a nd dn light="000" the n updow n<='1'men g<=doorclose;else updow n<='1'me ngv=dow n;end if;end if;end if;whe n up=>weizhi<=weizhi+1;hao:=hao+1;if hao<3 and (splight(hao)='1' or uplight(hao)=

14、'1') thenmen g<=stop;elsif hao=3 and (splight(hao)='1' or dn light (hao)='1') the nmen g<=stop;else men g<=doorclose;end if;whe n dow n=>weizhi<=weizhi-1;hao:=hao-1;if hao>1 and (splight(hao)='1' or dnlight(hao)='1')the n men g<=stop;elsif

15、 hao=1 and (splight(hao)='1' or uplight(hao)='1')the n men g<=stop;else men g<=doorclose;end if;whe n stop=>men g<=doorope n;whe n doorope n=>door<='1'if updow n='O' the nif weizhi<=2 and (splight(weizhi)='1'or uplight(weizhi)='1')

16、the nclearup<='1'else clearup<='1' cleard n<='1'end if;elsif updow n='1' the nif weizhi>=2 and (splight(weizhi)='1'or dnlight(weizhi)='1')the ncleard n<='1'else clearupv='1'cleard n<='1'end if;end if;men g<=

17、wait1;end case;end if;end if;end process ctrlift;ctrlight:process(reset,a nclk)指示燈進(jìn)程beg inif reset='1' the nsplight<="OOO"uplight<="OOO"d nlight<="OOO"elseif anclk'event and anclk='1' thenif clearup='1' the nsplight(weizhi)v='O&#

18、39;uplight(weizhi)v='O'elseif fiup='1' then uplight(1)<='1'elsif seup='1' then uplight(2)<='1'end if;end if;if cleardn='1' thensplight(weizhi)<='O'd nlight(weizhi)<='O'elseif sedn='1' then dnlight(2)<='1'e

19、lsif thdn='1' then dnlight(3)<='1'end if;end if;if yilou='1' then splight(1)<='1'elsif erlou='1' then splight (2) <='1'elsif sanlou='1' then splight(3)<='1'end if;end if;end if;end process ctrlight;end architecture men ghao;

20、8.調(diào)試仿真1.電梯在2樓外部有上升請(qǐng)求,電梯從 1樓升到2樓,開門,在電梯部有 3樓停站,電梯到達(dá) 3樓,之后外沒有請(qǐng) 求,電梯停在3樓。7l«c tu11.7« * T«L3tu覽覽喬一 wlilawBlan oytl&uB 0erkooft 03 &zJ-C"UIB 0f LIPB s&tin0 05 b"ipB 1thinB IkP low9 0io *rE 0田 sflightB oorID djListab oai田 jli gLtR OH田 rikchiB 014A:LIab atilha i¥山

21、jk11. 7 aLrnr1 1<tenJnna< .QUOk険壯QWXf©QLIL13 T ns:30 n us10 p ris410. ns30 9 nsrLrLrL_n_rLn_rLn_rLn_rLn_rLrLn_rLn_n_n_j2.電梯在3樓外部有下降請(qǐng)求,電梯從 1樓升到3樓,開門,在電梯部有1樓停站,電梯到達(dá)1樓,之后外沒有請(qǐng)求,電梯停在1樓。11.T nxnl«r;Stirt;N:amasa.oreset y i lou srlou zanlouL fiup stdnthdnvp dxiwn.door三J q>li gh電 ±J olLj eht El i± eizhi 初rlk ti H女9 08 D:j3 DB DB 0B DB 1B DB DB 00(B IMB CMf 01I-廠11J(odoJ£oci>( 皿 X1003CJOc1 HI0UL1112D.p jisEO. nsL1.7 nsJB D _ _ _ _ _ _ _畀而而而而而而打而幣而而而而麗而而帀3 電梯在2樓外部有上升請(qǐng)求,電梯從 1樓升到2樓

溫馨提示

  • 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)論