【正文】
器( D I R )C L K I ND E L A YC L O S EU P I ND O W N I NS T _ C HR U N _ S T O PD I R E C TL A M PR U N _ W A I TS T _ O U T更多論文 電梯運行規(guī)則:當電梯處于上升模式時,只響應(yīng)比電梯所在位置高的上樓信號,由下至上依次執(zhí)行,直到最后一個上樓請求 執(zhí)行完畢,如更高層有下樓請求時,則直接升到有下降請求的最高樓接客,然后進入下降模式,但電梯處于下降模式時,則與上升模式相反。 library ieee。 use 。 ledout:out std_logic_vector(6 downto 0))。 architecture a_led of led1 is begin process(ledin) begin case ledin is The sequence is g f e d c b a when 0000 = ledout=0111111。 show 1 when 0010 = ledout=1011011。 show 3 when 0100 = ledout=1100110。 show 5 when 0110 = ledout=1111101。 show 7 when 1000 = ledout=1111111。 show 9 when 1010 = ledout=1110111。 show 11 when 1100 = ledout=0111001。 show 13 when 1110 = ledout=1111001。 show 15 when others = ledout=XXXXXXX。X39。 end process 。 library IEEE。 use 。 entity lift1 is port ( 更多論文 clk: in STD_LOGIC。 上升 請 求 鍵 downin: in STD_LOGIC。 樓 層選擇鍵 close: in STD_LOGIC。 延 時關(guān)門鍵 run_stop: in STD_LOGIC。 運 行或停止燈 run_waitdis: out STD_LOGIC_VECTOR (6 downto 0)。 電 梯所在 樓層 指示 directdis: out STD_LOGIC_VECTOR (6 downto 0) 樓 層選擇 指示 )。 architecture lift1_arch of lift1 is ponent led1 port(ledin:in std_logic_vector(3 downto 0)。 end ponent。 更多論文 signal dir,liftor:integer range 0 to 5。 signal divide,hand,clkin:STD_LOGIC。 signal closex,delayx:STD_LOGIC。 signal st_out: STD_LOGIC_VECTOR (3 downto 0)。 begin direct=39。amp。 st_out=39。amp。 run_wait=39。amp。 lamp=ladd(1)。 closex=close and (not ladd(1))。 urun_wait:led1 port map(run_wait,run_waitdis)。 udirect:led1 port map(direct,directdis)。event and clk=39。) then clkin=not clkin。 end process p0。event and clkin=39。) then divide=not divide。 else dir=dir+1。 end if。 p2:process(ur,dr,dir,upin,downin,st_ch,liftor,wai_t,run_stop,hand) variable num,t:integer range 0 to 6。 更多論文 t:=dir+1。139。139。139。139。139。139。139。139。139。 end case。139。039。039。039。039。039。039。 end case。 if (((tnum) and (st_ch=39。)) or (downin=39。)) then case t is when 1 = dr(1)=39。 when 2 = dr(2)=39。 when 3 = dr(3)=39。 when 4 = dr(4)=39。 when 5 = dr(5)=39。 when 6 = dr(6)=39。 when others =Null。 elsif (hand=39。) then case num is when 1 = dr(1)=39。 when 2 = dr(2)=39。 when 3 = dr(3)=39。 when 4 = dr(4)=39。 when 5 = dr(5)=39。 when 6 = dr(6)=39。 when others =Null。 end if。 dr=000000。 end process p2。139。039。039。039。 end if。039。039。139。039。 else ladd=10。 when 2 =if ((ur(3) or dr(3))39。) then ladd(1)=39。 elsif(((ladd(0)=39。) and ((ur(6 downto 4) or dr(6 downto 4))000)) or((ur(2 downto 1) or dr(2 downto 1))=00)) then ladd=11。 end if。039。039