【正文】
致謝 26 參考文獻(xiàn) [1]夏宇聞 從算法設(shè)計(jì)到硬線邏輯的實(shí)現(xiàn) . 北京:高等教育出版社 . [2]劉必虎,沈建國 數(shù)字邏輯電路 北京:科學(xué)出版社 . [3]龔建榮 可編程器件綜述 軍事通信技術(shù) 1997,( 63): 33- 36. [4] (美) James Gray VHDL Design Representation and Synthesis(Second Edition) PH PTR [5] 曾繁泰,陳美金 VHDL 數(shù)字系統(tǒng)設(shè)計(jì)(第二版) 清華大學(xué)出版社 202011 [6] 曾繁泰,陳美金 VHDL 程序設(shè)計(jì) 清華大學(xué)出版社 202011 [7] 盧毅 VHDL 與數(shù)字電路設(shè)計(jì) 北京:科學(xué)出版社 . [8] 北京理工大學(xué) ASIC 研究所 VHDL 語言 100 例詳解 清華大學(xué)出版社 202031 。它具有強(qiáng)大的生命力和應(yīng)用潛力。 在此次設(shè)計(jì)中,我掌握了一些使用 VHDL 語言編程的基本方法。因此編程時要注意在選中某個片子之前,要先將計(jì)算出的數(shù)據(jù)信號先放到數(shù)據(jù)總線上。 (3)有的程序可能在仿真時時序是完全正確的,而將程序下載到板子上之后卻發(fā)現(xiàn)不對。 (2)設(shè)計(jì)完成后要在模版上仿真,來驗(yàn)證所編程序的正確性和可行性。在單個實(shí)現(xiàn)各個模塊功能時比較簡單。這種設(shè)計(jì)方法必在將來的數(shù)字系統(tǒng)設(shè)計(jì)中發(fā)揮越來越重要的作用。這樣設(shè)計(jì)者可以 采用自頂向下的設(shè)計(jì)方法和并行工作的設(shè)計(jì)原則。從圖 6可見實(shí)現(xiàn)了電梯控制器的設(shè)計(jì)。當(dāng)電梯到達(dá) 2 樓時, urr 的第 2位復(fù)位變?yōu)椤?000B”,電梯門自動打開,后有提前關(guān)門的請求,電梯開門開始運(yùn)行。電梯在 1 樓( dir=“ 0000”)時處于等待狀態(tài),有 2 個乘客進(jìn)入電梯,一個到 2 樓( dir=”0001”) ,一 個到 3 樓(“ dir=0010”) ,則 dir 的第 2 位和第 3 位置位。 仿真結(jié)果 該控制器由 VHDL 語言實(shí)現(xiàn)。 end process。 end if。 24 end case。 when “1100”=q=”0000000000110000”。 when “1010”=q=”0000000000001100”。 when “1000”=q=”1111111111111111”。 when “0110”=q=”0000000000000110”。 when “0100”=q=”0000000000011000”。 end case。 when “1100”=q=”0000110000000000”。 when “1010”=q=”0011000000000000”。 when “1000”=q=”1111111111111111”。 when “0110”=q=”0110000000000000”。 when “0100”=q=”0001100000000000”。 23 begin if clk’event and clk=’1’then seel:seel+1。 end dian。 sel:out std_logic_vector(3 downto 0)。 use 。 圖 5 模塊 DLAN library ieee。 模塊 DIAN 見圖 5。 end process。 end case。 when “100”=q=”1001111”。 architecture seg_arc of seg is begin process(clk) begin if clk’event and clk=’1’then case a is when “001”=q=”0000110”。 q:out std_logic_vector(6 downto 0))。 entity seg is port(a:in std_logic_vector(3 downto 1)。 圖 4 模塊 SEG library ieee。 模塊 SEG 見圖 4。 end process。 21 a3=ting(3)。 a1=ting(1)。 end if。 t1:=0。 end if。 else state:=c3。 if ceng1=”001”then state:=c1。 else door=’0’。 when kai=door=’1’。 mo:=’0’。 y:=’1’。 20 elsif down1(2)=’1’or ting1(2)=’1’then state:=c2。 ting1(3):=’0’。=”100”。 end if。 elsif up1(2)=’1’or down1(3)=’1’or ting1(3)=’1’then mo:=’0’。 elsif up1(1)=’1’or ting1(1)=’1’or y=’1’then state:=c1。 ting1(2):=’0’。 end if。 x:=’0’。 up1(2):=’0’。 if mo’0’then if ting1(2)=’1’or up1(2)=’1’then state:=kai。 end if。 elsif down1(2)=’1’then state:=c2。 elsif down1(3)=’1’or ting1(3)=’1’then state:=c2。 up1(1):=’0’。 if ting1(1)=’1’or up1(1)=’1’then state:=kai。 if z=’0’then //電梯的初態(tài)為一層開門 狀態(tài) door=’1’。 //電梯在一層轉(zhuǎn)為上升模式 if up1/=”000”ordown1/=”000”orting1/’000’then z:=’1’。 else case state is when c1=ceng1:=”001”。 18 end if。 end if。 end if。 end if。 end if。 end if。 end if。 variable state:state_type。 variable mo,x,y,z:std_logic。 //mode:顯示電梯現(xiàn)在的運(yùn)行模式(上升或下降) architecture veryhard_arc of veryhardd is 17 //door:顯示現(xiàn)在門的狀態(tài)(“ 0”表示關(guān), type state_type is (c1,c2,c3,kai)。 //site:顯示電梯現(xiàn)在在哪一層 mode,door:out s