電梯控制器實(shí)驗(yàn)報(bào)告
.電子技術(shù)實(shí)驗(yàn)報(bào)告電梯控制器的設(shè)計(jì)與分析班級(jí):姓名:學(xué)號(hào):日期:2016年 6月 25日聯(lián)系電話:1/15.一實(shí)驗(yàn)?zāi)康碾娮蛹夹g(shù)專題實(shí)驗(yàn)是對(duì)“數(shù)字邏輯”課程內(nèi)容的全面、系統(tǒng)的總結(jié)、鞏固和提高的一項(xiàng)課程實(shí)踐活動(dòng)。根據(jù)數(shù)字邏輯的特點(diǎn),選擇相應(yīng)的題目,在老師的指導(dǎo)下,由學(xué)生獨(dú)立完成。目的是通過(guò)實(shí)驗(yàn)使學(xué)生掌握數(shù)字邏輯電路設(shè)計(jì)的基本方法和技巧,正確運(yùn)用 Quartus軟件及實(shí)驗(yàn)室多功能學(xué)習(xí)機(jī)硬件平臺(tái), 完成所選題目的設(shè)計(jì)任務(wù),并掌握數(shù)字邏輯電路測(cè)試的基本方法,訓(xùn)練學(xué)生的動(dòng)手能力和思維方法。通過(guò)實(shí)驗(yàn),一方面提高運(yùn)用數(shù)字邏輯電路解決實(shí)際問(wèn)題的能力,另一方面使學(xué)生更深入的理解所學(xué)知識(shí),為以后的計(jì)算機(jī)硬件課程的學(xué)習(xí)奠定良好的基礎(chǔ)。二項(xiàng)目設(shè)計(jì)概要1. 設(shè)計(jì)實(shí)現(xiàn)的目標(biāo)隨著社會(huì)的發(fā)展, 電梯的使用越來(lái)越普遍, 已從原來(lái)只在商業(yè)大廈、 賓館使用,過(guò)渡到在辦公樓、居民樓等場(chǎng)所使用,并且對(duì)電梯功能的要求也不斷提高,相應(yīng)地其控制方式也在不停地發(fā)生變化。對(duì)于電梯的控制,傳統(tǒng)的方法是使用繼電器 接觸器控制系統(tǒng)進(jìn)行控制,隨著技術(shù)的不斷發(fā)展,微型計(jì)算機(jī)在電梯控制上的應(yīng)用日益廣泛,現(xiàn)在已進(jìn)入全微機(jī)化控制的時(shí)代。2. 整體設(shè)計(jì)概述電梯的微機(jī)化控制主要有以下幾種形式:PLC 控制;單板機(jī)控制;單片機(jī)控制; 單微機(jī)控制; 多微機(jī)控制; 人工智能控制。 隨著 EDA 技術(shù)的快速發(fā)展, CPLD/FPGA已廣泛應(yīng)用于電子設(shè)計(jì)與控制的各個(gè)方面。本設(shè)計(jì)就是使用一片 CPLD/FPGA 來(lái)實(shí)現(xiàn)對(duì)電梯的控制的3. 項(xiàng)目設(shè)計(jì)特點(diǎn)我們?cè)陧?xiàng)目設(shè)計(jì)過(guò)程中采用模塊化設(shè)計(jì)思想, 事先制定了模塊間的接口方案,使得整個(gè)系統(tǒng)的組合變得十分靈活。由于我們?cè)谠O(shè)計(jì)時(shí)為電子鐘和秒表模塊中都加入了顯示電路,總控模塊可分別與之連接組成一個(gè)分系統(tǒng),便于調(diào)試。在最終2/15.整合時(shí),我們也只需要將兩個(gè)模塊中的顯示電路合二為一即可。三系統(tǒng)設(shè)計(jì)方案根據(jù)系統(tǒng)設(shè)計(jì)要求,并考慮到系統(tǒng)的可驗(yàn)證性,整個(gè)系統(tǒng)的輸入輸出接口設(shè)計(jì)如圖1 所示:系統(tǒng)工作用2 Hz 基準(zhǔn)時(shí)鐘信號(hào)CLKIN ,樓層上升請(qǐng)求鍵UPIN ,樓層下降請(qǐng)求鍵DOWNIN ,樓層選擇鍵入鍵ST_CH ,提前關(guān)門輸入鍵CLOSE ,延遲關(guān)門輸入鍵DELAY ,電梯運(yùn)行的開關(guān)鍵RUN_STOP ,電梯運(yùn)行或停止指示鍵LAMP ,電梯運(yùn)行或等待時(shí)間指示鍵RUN_WAIT ,電梯所在樓層指示數(shù)碼管ST_OUT ,樓層選擇指示數(shù)碼管DIRECT 。各輸入端口的功能如下:CLKIN: 基準(zhǔn)時(shí)鐘信號(hào),為系統(tǒng)提供2Hz 的時(shí)鐘脈沖,上升沿有效;UPIN: 電梯上升請(qǐng)求鍵。由用戶向電梯控制器發(fā)出上升請(qǐng)求。高電平有效;DOWNIN: 電梯下降請(qǐng)求鍵,由用戶向電梯控制器發(fā)出下降請(qǐng)求。高電平有效;ST_CH2.0: 樓層選擇鍵入鍵,結(jié)合DIRECT 完成樓層選擇的鍵入,高電平有效;CLOSE: 提前關(guān)門輸入鍵??蓪?shí)現(xiàn)無(wú)等待時(shí)間的提前關(guān)門操作,高電平有效;DELAY:延遲關(guān)門輸入鍵??蓪?shí)現(xiàn)有等待時(shí)間的延遲關(guān)門操作,高電平有效;RUN_STOP: 電梯運(yùn)行或停止開關(guān)鍵??蓪?shí)現(xiàn)由管理員控制電梯的運(yùn)行或停止,高電平有效。一下為輸出端口:LAMP: 電梯運(yùn)行或等待指示鍵,指示電梯的運(yùn)行或等待狀況。高電平有效;RUN_WAIT: 電梯運(yùn)行或等待時(shí)間指示鍵,指示電梯運(yùn)行狀況或等待時(shí)間的長(zhǎng)短,高電平有效;ST_OUT: 電梯所在樓層指示數(shù)碼管,只是電梯當(dāng)前所在的樓層數(shù)。即15 層,高電平有效;DIRECT: 樓層選擇指示數(shù)碼管,指示用戶所要選擇的樓層數(shù),高電平有效。3/15.1. 系統(tǒng)功能模塊設(shè)計(jì)示意圖2.項(xiàng)目分塊及其實(shí)現(xiàn)方案電梯的控制狀態(tài)包括運(yùn)行狀態(tài)、停止?fàn)顟B(tài)及等待狀態(tài),其中運(yùn)行狀態(tài)又包含向上狀態(tài)和向下狀態(tài)。主要?jiǎng)幼饔虚_、關(guān)門,??亢蛦?dòng)。乘客可通過(guò)鍵入開、關(guān)門按鈕,呼喚按鈕,指定樓層按鈕等來(lái)控制電梯的行與停。據(jù)此,整個(gè)電梯控制器 DTKZQ 應(yīng)包括如下幾個(gè)組成部分: 時(shí)序輸出及樓選計(jì)數(shù)器; 電梯服務(wù)請(qǐng)求處理器; 電梯升降控制器; 上升及下降寄存器; 電梯次態(tài)生成器。該電梯控制器設(shè)計(jì)的關(guān)鍵是確定上升及下降寄存器的置位與復(fù)位。整個(gè)系統(tǒng)的內(nèi)部組成結(jié)構(gòu)圖如圖 2 所示。4/15.Vhdl 程序:-DTKZQ.VHD-顯示電路LIBRARY IEEE;ENTITY led ISPORT(LEDIN: IN STD_LOGIC_VECTOR(2 DOWNTO 0);-輸入信號(hào)LEDOUT: OUT STD_LOGIC_VECTOR(6 DOWNTO 0);-輸出信號(hào)END LED;ARCHITECTURE ART OF LED IS-結(jié)構(gòu)體BEGINPROCESS(LEDIN)BEGINCASE LEDIN IS-共陰極 LED 顯示譯碼g f e d c b aWHEN"0000"=>ledout<="0111111"-0WHEN"0001"=>ledout<="0000110"-1WHEN"0010"=>ledout<="1011011"-2WHEN"0011"=>ledout<="1001111"-3WHEN"0100"=>ledout<="1100110"-4WHEN"0101"=>ledout<="1101101"-5WHEN"0110"=>ledout<="1111101"-6WHEN"0111"=>ledout<="0000111"-7WHEN"1000"=>ledout<="1111111"-8WHEN"1001"=>ledout<="1101111"-9WHEN"1010"=>ledout<="1110111"-10WHEN"1011"=>ledout<="1111100"-11WHEN"1100"=>ledout<="0111001"-12WHEN"1101"=>ledout<="1011110"-13WHEN"1110"=>ledout<="1111001"-14WHEN"1111"=>ledout<="1110001"-15WHEN OTHERS=>ledout<="0000000"-其他情況時(shí)燈滅END CASE;END PROCESS;END ART;LIBRARY IEEE;ENTITY DTKZQ ISPORT(CLK:IN STD_LOGIC;-2 Hz 時(shí)鐘輸入信號(hào)5/15.UPIN:IN STD_LOGIC;-樓層上升請(qǐng)求鍵DOWNIN:IN STD_LOGIC;-樓層下降請(qǐng)求鍵ST_CH:IN STD_LOGIC;-結(jié)合 DIRECT 完成樓層選擇的鍵入CLOSE:IN STD_LOGIC;-提前關(guān)門輸入鍵DELAY:IN STD_LOGIC;-延遲關(guān)門輸入鍵RUN_STOP:IN STD_LOGIC;-電梯運(yùn)行的開關(guān)鍵LAMP:OUT STD_LOGIC;-電梯運(yùn)行或停止指示鍵RUN_WAIT:OUTSTD_LOGIC_VECTOR(3DOWNTO0);-結(jié)合LAMP 指示電梯運(yùn)行或等待時(shí)間ST_OUT:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);- 電梯所在樓層指示數(shù)碼管DIRECT:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);- 樓層選擇指示數(shù)碼管END ENTITY DTKZQ;ARCHITECTURE ART OF DTKZQ ISSIGNAL UR,DR:STD_LOGIC_VECTOR(16 DOWNTO 1);- 上升或下降樓層請(qǐng)求寄存器SIGNAL DIR,LIFTOR: INTEGER RANGE 0 TO 15;-樓選指示及樓層數(shù)計(jì)數(shù)器SIGNAL WAI_T:STD_LOGIC_VECTOR(2 DOWNTO 0);-運(yùn)行或等待計(jì)數(shù)器SIGNAL DIVID,HAND,CLKIN:STD_LOGIC;- 時(shí)鐘 2 分頻和樓選復(fù)位變量SIGNAL LADD:STD_LOGIC_VECTOR(1 DOWNTO 0);-電梯運(yùn)行狀態(tài)變量SIGNAL CLOSEX,DELAYX:STD_LOGIC;-提前關(guān)門及延遲變量BEGIN-內(nèi)部信號(hào)值的輸出DIRECT<=CONV_STD_LOGIC_VECTOR(DIR,4)+1;ST_OUT<=CONV_STD_LOGIC_VECTOR(LIFTOR,4)+1;RUN_WAIT<='0'&WAI_T;LAMP<=LADD(1);HAND<=WAI_T(2)AND(NOT WAI_T(1)AND WAI_T(0);CLOSEX<=CLOSE AND(NOT LADD(1);DELAYX<=DELAY AND(NOT LADD(1);-分頻進(jìn)程P0:PROCESS(CLK)BEGINIF (CLK'EVENT AND CLK='1') THENCLKIN<=NOT CLKIN;END IF;END PROCESS P0;-分頻及樓選信號(hào)產(chǎn)生進(jìn)程P1:PROCESS(CLKIN)BEGINIF (CLKIN'EVENT AND CLKIN='1') THENDIVID<=NOT DIVID;IF (DIR=4) THEN DIR<=0;ELSE DIR<=DIR+1;6/15.END IF;END IF;END PROCESS P1;-樓層請(qǐng)求寄存器的置位與復(fù)位進(jìn)程P2:PROCESS(UR, DR,DIR,UPIN,DOWNIN,ST_CH,LIFTOR,WAI_T,RUN_STOP, HAND)VARIABLE NUM,T:INTEGER RANGE 0 TO 16 ;BEGINNUM:=LIFTOR+1;T:=DIR+1;IF (RUN_STOP='1') THEN-電梯運(yùn)行時(shí)選擇樓層大于當(dāng)前樓層或者有上升請(qǐng)求IF (T>NUM)AND (ST_CH='1')OR (UPIN='1')THENCASE T ISWHEN 1=> UR(1)<='1'WHEN 2=> UR(2)<='1'WHEN 3=> UR(3)<='1'WHEN 4=> UR(4)<='1'WHEN 5=> UR(5)<='1'WHEN 6=> UR(6)<='1'WHEN 7=> UR(7)<='1'WHEN 8=> UR(8)<='1'WHEN 9=> UR(9)<='1'WHEN 10 => UR(10)<='1'WHEN 11 => UR(11)<='1'WHEN 12 => UR(12)<='1'WHEN 13 => UR(13)<='1'WHEN 14 => UR(14)<='1'WHEN 15 => UR(15)<='1'WHEN 16 => UR(16)<='1'WHEN OTHERS=>NULL;END CASE;-電梯運(yùn)行時(shí)間到ELSIF (HAND='1')THENCASE NUM ISWHEN 1=> UR(1)<='0'WHEN 2=> UR(2)<='0'WHEN 3=> UR(3)<='0'WHEN 4=> UR(4)<='0'WHEN 5=> UR(5)<='0'WHEN 6=> UR(6)<='0'WHEN 7=> UR(7)<='0'WHEN 8=> UR(8)<='0'WHEN 9=> UR(9)<='0'7/15.WHEN 10 => UR(10)<='0'WHEN 11 => UR(11)<='0'WHEN 12 => UR(12)<='0'WHEN 13 => UR(13)<='0'WHEN 14 => UR(14)<='0'WHEN 15 => UR(15)<='0'WHEN 16 => UR(16)<='0'WHEN OTHERS=>NULL;END CASE;END IF;-選擇樓層小于當(dāng)前樓層或者有下降請(qǐng)求IF (T<NUM)AND (ST_CH='1')OR(DOWNIN='1') THEN CASE T ISWHEN 1=> DR(1)<='1'WHEN 2=> DR(2)<='1'WHEN 3=> DR(3)<='1'WHEN 4=> DR(4)<='1'WHEN 5=> DR(5)<='1'WHEN 6=> DR(6)<='1'WHEN 7=> DR(7)<='1'WHEN 8=> DR(8)<='1'WHEN 9=> DR(9)<='1'WHEN 10 => DR(10)<='1'WHEN 11 => DR(11)<='1'WHEN 12 => DR(12)<='1'WHEN 13 => DR(13)<='1'WHEN 14 => DR(14)<='1'WHEN 15 => DR(15)<='1'WHEN 16 => DR(16)<='1'WHEN OTHERS=>NULL;END CASE;-電梯運(yùn)行時(shí)間到ELSIF (HAND='1') THENCASE NUM ISWHEN 1=> DR(1)<='0'WHEN 2=> DR(2)<='0'WHEN 3=> DR(3)<='0'WHEN 4=> DR(4)<='0'WHEN 5=> DR(5)<='0'WHEN 6=> DR(6)<='0'WHEN 7=> DR(7)<='0'WHEN 8=> DR(8)<='0'WHEN 9=> DR(9)<='0'8/15.WHEN 10 => DR(10)<='0'WHEN 11 => DR(11)<='0'WHEN 12 => DR(12)<='0'WHEN 13 => DR(13)<='0'WHEN 14 => DR(14)<='0'WHEN 15 => DR(15)<='0'WHEN 16 => DR(16)<='0'WHEN OTHERS=>NULL;END CASE;END IF;ELSEUR<="0000000000000000"DR<="0000000000000000"END IF;END PROCESS P2;-電梯運(yùn)行次態(tài)的控制進(jìn)程P3:PROCESS(UR,DR,DIR,LIFTOR,LADD,WAI_T,RUN_STOP)BEGINIF (RUN_STOP='1') THEN-電梯運(yùn)行時(shí)IF (WAI_T="110") THENIF (UR OR DR)="0000000000000000") THENLADD(1)<='0'-初始狀態(tài)ELSECASE LIFTOR IS-電梯在第一層WHEN 0=>IF (UR(1)OR DR(1)>'0') THEN LADD(1)<='0'-等待狀態(tài)ELSE LADD<="11"-上升狀態(tài)END IF;-電梯在第二層WHEN 1=>IF (UR(2)OR DR(2)>'0') THENLADD(1)<='0' -等待狀態(tài)ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 3)OR DR(16 DOWNTO 3)>"00000000000000")OR(UR(1)OR DR(1)='0') THENLADD <="11"-上升狀態(tài)ELSE LADD<="10"-下降狀態(tài)END IF;-電梯在第三層WHEN 2=>IF (UR(3) OR DR(3)>'0') THEN LADD(1)<='0' ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 4)ORDR(16DOWNTO4)>"0000000000000")9/15.OR(UR(2 DOWNTO 1) OR DR(2 DOWNTO 1)="00") THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第四層WHEN 3=>IF (UR(4) OR DR(4)>'0') THEN LADD(1)<='0' ELSIF (LADD(0)='1')AND (UR(16 DOWNTO 5)OR DR(16 DOWNTO 5)>"000000000000")OR(UR(3 DOWNTO 1)ORDR(3DOWNTO1)="000")THENLADD<="11"ELSE LADD<="10"END IF;-電梯在第五層WHEN 4=>IF (UR(5) OR DR(5)>'0') THEN LADD(1)<='0' ELSIF (LADD(0)='1')AND (UR(16 DOWNTO 6)OR DR(16 DOWNTO 6)>"00000000000")OR(UR(4 DOWNTO 1)ORDR(4DOWNTO1)="0000")THENLADD<="11"ELSE LADD<="10"END IF;-電梯在第六層WHEN 5=>IF (UR(6) OR DR(6)>'0') THEN LADD(1)<='0' ELSIF (LADD(0)='1')AND (UR(16 DOWNTO 7)OR DR(16 DOWNTO 7)>"0000000000" )OR(UR(5 DOWNTO 1)ORDR(5DOWNTO1)="00000")THENLADD<="11"ELSE LADD<="10"END IF;-電梯在第七層WHEN 6=>IF (UR(7) OR DR(7)>'0') THEN LADD(1)<='0' ELSIF (LADD(0)='1')AND (UR(16 DOWNTO 8)OR DR(16 DOWNTO 8)>"000000000")OR(UR(6 DOWNTO 1)OR DR(6 DOWNTO 1)="000000") THENLADD<="11"ELSE LADD<="10"END IF;-電梯在第八層WHEN 7=>IF (UR(8) OR DR(8)>'0') THEN LADD(1)<='0' ELSIF (LADD(0)='1')AND (UR(16 DOWNTO 9)OR DR(16 DOWNTO 9)>"00000000" )10/15.OR(UR(7 DOWNTO 1)OR DR(7 DOWNTO 1)="0000000") THENLADD<="11"ELSE LADD<="10"END IF;-電梯在第九層WHEN 8=>IF (UR(9) OR DR(9)>'0') THEN LADD(1)<='0' ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 10)OR DR(16 DOWNTO 10)>"0000000" )OR(UR(8 DOWNTO 1)ORDR(8DOWNTO1)="00000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十層WHEN 9=>IF (UR(10) OR DR(10)>'0') THEN LADD(1)<='0' ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 11)OR DR(16 DOWNTO 11)>"000000" )OR(UR(9 DOWNTO 1)ORDR(9DOWNTO1)="000000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十一層WHEN 10=>IF (UR(11) OR DR(11)>'0') THEN LADD(1)<='0' ELSIF (LADD(0)='1')AND (UR(16 DOWNTO 12)OR DR(16 DOWNTO 12) >"00000")OR(UR(10 DOWNTO 1)OR DR(10 DOWNTO1)="0000000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十二層WHEN 11=>IF (UR(12) OR DR(12)>'0') THEN LADD(1)<='0' ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 13)OR DR(16 DOWNTO 13)>"0000" )OR(UR(11 DOWNTO 1)OR DR(11 DOWNTO 1)="00000000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十三層WHEN 12=>IF (UR(13) OR DR(13)>'0') THEN LADD(1)<='0' ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 14)11/15.OR DR(16 DOWNTO 14)>"000" )OR(UR(12 DOWNTO 1)OR DR(12 DOWNTO 1)="000000000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十四層WHEN 13=>IF (UR(14) OR DR(14)>'0') THEN LADD(1)<='0' ELSIF ( LADD(0)='1')AND (UR(16 DOWNTO 15)OR DR(16 DOWNTO 15)>"00" )OR(UR(13 DOWNTO 1)ORDR(13DOWNTO1)="0000000000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十五層WHEN 14=>IF (UR(15)OR DR(15)>'0') THEN LADD(1)<='0'ELSIF(LADD(0)='1')AND(UR(16)ORDR(16)>'0')OR (UR(14 DOWNTO 1)ORDR(14DOWNTO1)="00000000000000")THEN LADD<="11"ELSE LADD<="10"END IF;-電梯在第十六層WHEN 15=>IF (UR(16) OR DR(16)>'0') THEN LADD(1)<='0'ELSE LADD<="10"END IF;WHEN OTHERS=>NULL;END CASE;END IF;END IF;ELSE LADD<="00"END IF;END PROCESS P3;-電梯運(yùn)行樓層計(jì)數(shù)及提前/延遲關(guān)門控制進(jìn)程P4:PROCESS(DIVID,WAI_T,LADD,CLOSEX,DELAYX)BEGINIF (DIVID'EVENT AND DIVID='1') THEN-分頻后的時(shí)鐘上升沿IF (WAI_T="000" OR CLOSEX='1') THEN WAI_T<="110"12/15.ELSEIF (DELAYX='0')THEN WAI_T<=WAI_T-1;ELSE WAI_T<="010"END IF;-電梯處于運(yùn)行狀態(tài)IF(WAI_T="001") THENIF (LADD="11") THEN-電梯上升,樓層加1LIFTOR<=LIFTOR+1;ELSIF (LADD="10") THEN LIFTOR<=LIFTOR-1;END IF;END IF;END IF;END IF;END PROCESS P4;END ART;-頂層模塊設(shè)計(jì)LIBRARY IEEE;ENTITY TOP ISPORT(CLK:IN STD_LOGIC;-2 Hz 時(shí)鐘輸入信號(hào)UPIN:IN STD_LOGIC;-樓層上升請(qǐng)求鍵DOWNIN:IN STD_LOGIC;-樓層下降請(qǐng)求鍵ST_CH:IN STD_LOGIC;-結(jié)合 DIRECT 完成樓層選擇的鍵入CLOSE:IN STD_LOGIC;-提前關(guān)門輸入鍵DELAY:IN STD_LOGIC;-延遲關(guān)門輸入鍵RUN_STOP:IN STD_LOGIC;-電梯運(yùn)行的開關(guān)鍵LAMP:OUT STD_LOGIC;-電梯運(yùn)行或停止指示鍵RUN_WAIT:OUTSTD_LOGIC_VECTOR(6DOWNTO0);-結(jié)合LAMP 指示電梯運(yùn)行或等待時(shí)間ST_OUT:OUT STD_LOGIC_VECTOR(6 DOWNTO 0);- 電梯所在樓層指示數(shù)碼管DIRECT:OUT STD_LOGIC_VECTOR(6 DOWNTO 0);- 樓層選擇指示數(shù)碼管END TOP;ARCHITECTURE ART OF TOP ISCOMPONENT LED ISPORT(LEDIN: IN STD_LOGIC_VECTOR(2 DOWNTO 0);- 輸入信號(hào) LEDOUT: OUT STD_LOGIC_VECTOR(6 DOWNTO 0);- 輸出信號(hào) END COMPONENT LED;13/15.COMPONENT DTKZQ ISPORT(CLK:IN STD_LOGIC;-2 Hz 時(shí)鐘輸入信號(hào)UPIN:IN STD_LOGIC;-樓層上升請(qǐng)求鍵DOWNIN:IN STD_LOGIC;-樓層下降請(qǐng)求鍵ST_CH:IN STD_LOGIC;-結(jié)合 DIRECT 完成樓層選擇的鍵入CLOSE:IN STD_LOGIC;-提前關(guān)門輸入鍵DELAY:IN STD_LOGIC;-延遲關(guān)門輸入鍵RUN_STOP:IN STD_LOGIC;-電梯運(yùn)行的開關(guān)鍵LAMP:OUT STD_LOGIC;-電梯運(yùn)行或停止指示鍵RUN_WAIT:OUTSTD_LOGIC_VECTOR(3DOWNTO0);-結(jié)合LAMP 指示電梯運(yùn)行或等待時(shí)間ST_OUT:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);- 電梯所在樓層指示數(shù)碼管DIRECT:OUT STD_LOGIC_VECTOR(3 DOWNTO 0);- 樓層選擇指示數(shù)碼管END COMPONENT DTKZQ;SIGNAL S0,S1,S2:STD_LOGIC_VECTOR(3 DOWNTO 0);BEGINU1: DTKZQ PORT MAP(CLK, UPIN, DOWNIN, ST_CH, CLOSE, DELAY, RUN_STOP, LAMP, S0, S1, S2);U2: LED PORT MAP(S0,RUN_WAIT);U3: LED PORT MAP(S1,ST_OUT);U4: LED PORT MAP(S2,DIRECT);END ART;四測(cè)試結(jié)果及分析1.模擬仿真測(cè)試波形圖14/15.2.DTKZQ器件圖五項(xiàng)目總結(jié)通過(guò)本次課程設(shè)計(jì)進(jìn)一步熟悉 Quartus II 軟件的使用和操作方法,以及硬件實(shí)現(xiàn)時(shí)的下載方法與運(yùn)行方法;對(duì) Verilog HDL 語(yǔ)言的自頂向下設(shè)計(jì)方法有了進(jìn)一步的認(rèn)識(shí),對(duì)其中的許多語(yǔ)句也有了新了解,掌握;對(duì)自己獨(dú)立思考和解決問(wèn)題的能力也有了很大的鍛煉。15/15