【正文】
end if。 then fdnlight(6)=39。 elsif f6dnbutton=39。 then fdnlight(5)=39。 elsif f5dnbutton=39。 then fdnlight(4)=39。 elsif f4dnbutton=39。 then fdnlight(3)=39。 elsif f3dnbutton=39。 then fdnlight(2)=39。 elsif f2dnbutton=39。 fdnlight(position)=39。 then stoplight(position)=39。 if cleardn=39。139。139。139。139。139。139。139。139。139。139。039。039。139。139。 elsif buttonclk39。 fuplight=000000。139。 end process controllift。 end if。 mylift=doorwait1。 end if。cleardn=39。 else clearup=39。) then cleardn=39。 or fdnlight(position)=39。 then if position1 and (stoplight(position)= 39。 elsif udsig=39。139。139。139。139。139。039。139。 when stop = mylift=dooropen。 else mylift=doorclose。139。139。) 太原科技大學(xué)華科學(xué)院畢業(yè)設(shè)計 (論文 ) 39 then mylift=stop。 or fdnlight(pos)=39。 if position1 and (stoplight(pos)=39。 when down = position=position1。 else mylift=doorclose。139。139。) then mylift=stop。 or fuplight(pos)=39。 if position 6 and( stoplight(pos)=39。 when up = position=position+1。 end if。 mylift=down。 else udsig=39。139。 end if。039。mylift=down。 then udsig=39。 or fuplight(4)=39。 or fuplight(3)=39。 or fuplight(2)=39。 or fuplight(1)=39。 or stoplight(4)=39。 or stoplight(3)=39。 or stoplight(2)=39。 elsif stoplight(1)=39。139。 太原科技大學(xué)華科學(xué)院畢業(yè)設(shè)計 (論文 ) 38 end if。039。mylift=down。 then udsig=39。 or fuplight(3)=39。 or fuplight(2)=39。 or fuplight(1)=39。 or stoplight(3)=39。 or stoplight(2)=39。 elsif stoplight(1)=39。139。 end if。039。mylift=down。 then udsig=39。 or fuplight(2)=39。 or fuplight(1)=39。 or stoplight(2)=39。 elsif stoplight(1)=39。139。 end if。039。mylift=down。 then udsig=39。 or fuplight(1)=39。 elsif stoplight(1)=39。139。 end if。039。mylift=doorclose。 then if position=1 then if stoplight=000000 and fuplight=000000 and fdnlight=000000 then 太原科技大學(xué)華科學(xué)院畢業(yè)設(shè)計 (論文 ) 37 udsig=39。 elsif udsig=39。 end if。039。mylift=doorclose。 elsif position=1 then if stoplight=000000 and fuplight=000000 and fdnlight=000000 then udsig=39。mylift=down。 else udsig=39。039。139。139。139。139。139。139。139。139。mylift=doorclose。 elsif position=2 then if stoplight=000000 and fuplight=000000 and fdnlight=000000 then udsig=39。mylift=down。 else udsig=39。039。139。139。139。139。139。139。mylift=doorclose。 elsif position=3 then 太原科技大學(xué)華科學(xué)院畢業(yè)設(shè)計 (論文 ) 36 if stoplight=000000 and fuplight=000000 and fdnlight=000000 then udsig=39。mylift=down。 else udsig=39。039。139。139。139。139。mylift=doorclose。 elsif position=4 then if stoplight=000000 and fuplight=000000 and fdnlight=000000 then udsig=39。mylift=down。 else udsig=39。039。139。139。mylift=doorclose。 elsif position=5 then if stoplight=000000 and fuplight=000000 and fdnlight=000000 then udsig=39。mylift=down。 else udsig=39。139。039。039。 when doorwait4 = mylift=doorclose。 電梯處于一樓 pos:=1。139。139。 處于一樓 else if liftclk39。 下樓信號清除 pos:=1。 上樓信號清除 cleardn=39。 起始狀態(tài) clearup=39。139。 下降清除信號 begin controllift:process(reset,liftclk) variable pos:integer range 1 to 6。 內(nèi)部電梯狀態(tài)信號 signal clearup:std_logic。 architecture art of sixlift is type lift_state is (stopon1,dooropen,doorclose,doorwait4,up,down,stop)。 電梯門指示燈 ?1? 開 ?0?關(guān) udsig:buffer std_logic )。 內(nèi)部停止指示燈 太原科技大學(xué)華科學(xué)院畢業(yè)設(shè)計 (論文 ) 34 position:buffer integer range 1 to 6。 下降指示燈 stop1button,stop2button,stop3button, stop4button, stop5button, stop6button:in std_logic。 六樓下降按鈕 fuplight:buffer std_logic_vector(6 downto 1)。 四樓下降按鈕 f5dnbutton:in std_logic。 二樓下降按鈕