【正文】
end behav。 led_c=t1。 end if。 end if。 9 else t2:=t2+1。139。039。039。 then 下降預操作 t1:=0。 elsif en_dw=39。 else t2:=t2+1。139。139。039。)then 上升預操作 t1:=0。 elsif (en_up=39。 else t1:=t11。flag:=39。)then v_en:=39。 elsif(t1=0 and flag=39。139。039。139。039。139。039。039。039。 開關門延時計數(shù)器 variable flag :std_logic。 variable t1 : integer range 0 to 3。 end process。 電梯進入上升或下降狀態(tài) end case。en_dw=39。en_up=39。 end if。039。139。039。 g=g4。opendoor=39。en_dw=39。 elsif o_i_all=0000 then en_up=39。139。039。039。039。039。139。139。 when g4 = led=0100。 end if。039。039。139。g=g2。opendoor=39。en_dw=39。 elsif o_i_all0100 then en_up=39。039。039。039。g=g3。opendoor=39。en_dw=39。en_up=39。o_u3_r:=39。 o_d3_r:=39。then in3_r:=39。 or o_u3_r=39。 or o_d3_r=39。 else if in3_r=39。 g=g2。opendoor=39。en_dw=39。 elsif o_i_all0100 then en_up=39。039。039。139。 g=g3。opendoor=39。en_dw=39。 elsif o_i_all=0000 then en_up=39。139。039。039。039。039。039。139。139。139。139。 when g3 = led=0011。 end if。039。039。139。 g=g1。opendoor=39。en_dw=39。無請求時,電梯停在 二 樓待機 elsif o_i_all0010 then 有下降請求,則電梯進入預備下降狀態(tài) en_up=39。039。039。039。 g=g2。opendoor=39。en_dw=39。 en_up=39。o_u2_r:=39。 o_d2_r:=39。 then 有當前層的請求,則電梯進入開門狀態(tài) in2_r:=39。 or o_u2_r=39。 or o_d2_r=39。 else電梯前一運動狀態(tài)為下降 if in2_r=39。g=g1。opendoor=39。en_dw=39。無請求時,電梯停在 二 樓待機 elsif o_i_all0010 then 有下降請求,則電梯進入預備下降狀態(tài) en_up=39。039。039。139。 g=g2。opendoor=39。en_dw=39。 elsif o_i_all=0000 then en_up=39。139。039。039。039。039。039。139。139。139。139。 when g2 = led=0010。 g=g2。opendoor=39。en_dw=39。 elsif o_i_all0001 then 有上升請求,則電梯進入預備上升狀態(tài) en_up=39。039。039。039。 g=g1。opendoor=39。en_dw=39。 en_up=39。 o_u1_r:=39。 then 有當前層的請求,則電梯進入開門狀態(tài) in1_r:=39。 or o_u1_r=39。 電梯到達 一 樓,數(shù)碼管顯示 1 if in1_r=39。039。039。139。139。 if clk39。 電梯外 乘客 下降請求信號并置 o_i_all:=in_all or o_u_all or o_d_all。39。o_d3_ramp。o_u1_r。o_u3_ramp。039。in1_r。in3_ramp。 end if。139。139。end if。 then o_d2_r:=39。 對電梯外 乘客 下降請求信號進行檢測和寄存 if o_d3=39。139。139。end if。 then o_u3_r:=39。 if o_u3=39。139。139。end if。 then o_u1_r:=39。 if o_u1=39。139。139。end if。 then in3_r:=39。 if in3=39。139。139。 end if。 then in1_r:=