【文章內(nèi)容簡(jiǎn)介】
示 led_c : out integer range 0 to 15。 開(kāi)關(guān)門延時(shí) stop,overload : in std_logic 緊急停止運(yùn)行,超載 )。 end dianti。architecture behav of dianti issignal opendoor:std_logic。 開(kāi)門使能信號(hào)signal updown:std_logic。 電梯運(yùn)動(dòng)方向信號(hào)寄存器signal en_up,en_dw:std_logic。 預(yù)備上升、預(yù)備下降預(yù)操作使能信號(hào)type state is(g1,g2,g3,g4)。signal g:state。signal en : std_logic 。 1 電梯下一步動(dòng)作使能。0 進(jìn)行動(dòng)作上升,下降,開(kāi)關(guān)門beginprocess(clk,en,stop,overload)variable in1_r,in2_r,in3_r,in4_r:std_logic。 電梯內(nèi)乘客請(qǐng)求信號(hào)寄存信號(hào)variable o_u1_r,o_u2_r,o_u3_r:std_logic。 電梯外乘客上升請(qǐng)求信號(hào)寄存信號(hào)variable o_d2_r,o_d3_r,o_d4_r:std_logic。 電梯外乘客下降請(qǐng)求信號(hào)寄存信號(hào)variable in_all,o_u_all,o_d_all,o_i_all:std_logic_vector(3 downto 0)。 電梯內(nèi)外請(qǐng)求信號(hào)寄存器beginif clk39。event and clk=39。139。 then if alarm=39。139。then in1_r:=39。139。in2_r:=39。039。in3_r:=39。039。in4_r:=39。039。 o_u1_r:=39。039。o_u2_r:=39。039。o_u3_r:=39。039。 o_d2_r:=39。039。o_d3_r:=39。039。o_d4_r:=39。039。 else if in1=39。139。 then in1_r:=39。139。 end if。 對(duì)電梯內(nèi)乘客請(qǐng)求信號(hào)進(jìn)行檢測(cè)和寄存 if in2=39。139。 then in2_r:=39。139。end if。 if in3=39。139。 then in3_r:=39。139。end if。 if in4=39。139。 then in4_r:=39。139。end if。 if o_u1=39。139。 then o_u1_r:=39。139。end if。 對(duì)電梯外乘客上升請(qǐng)求信號(hào)進(jìn)行檢測(cè)和寄存 if o_u2=39。139。 then o_u2_r:=39。139。end if。 if o_u3=39。139。 then o_u3_r:=39。139。end if。 if o_d2=39。139。 then o_d2_r:=39。139。end if。 對(duì)電梯外乘客下降請(qǐng)求信號(hào)進(jìn)行檢測(cè)和寄存 if o_d3=39。139。 then o_d2_r:=39。139。end if。 if o_d4=39。139。 then o_d2_r:=39。139。end if。 end if。 in_all:=in4_ramp。in3_ramp。in2_ramp。in1_r。 電梯內(nèi)乘客請(qǐng)求信號(hào)并置 o_u_all:=39。039。amp。o_u3_ramp。o_u2_ramp。o_u1_r。 電梯外乘客上升請(qǐng)求信號(hào)并置 o_d_all:=o_d4_ramp。o_d3_ramp。o_d2_ramp。39。039。 電梯外乘客下降請(qǐng)求信號(hào)并置 o_i_all:=in_all or o_u_all or o_d_all。 電梯內(nèi)、外乘客請(qǐng)求信號(hào)進(jìn)行綜合 end if。 if clk39。event and clk=39。139。 and en=39。139。 and stop=39。039。and overload=39。039。then case g is when g1 = led=0001。 電梯到達(dá)一樓,數(shù)碼管顯示1 if in1_r=39。139。 or o_u1_r=39。139。 then 有當(dāng)前層的請(qǐng)求,則電梯進(jìn)入開(kāi)門狀態(tài) i