freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

畢業(yè)設(shè)計(jì)-plc自動(dòng)售貨機(jī)控制系統(tǒng)設(shè)計(jì)(文件)

 

【正文】 t of coin 10 and light the leds coin 10 counting。模塊輸入信號(hào)有 clk 與 coin 5 兩個(gè)系統(tǒng)輸入信號(hào), led five 為系統(tǒng)輸出信號(hào),輸出 total 28 amount five 為全局信號(hào)。 if no coin five then led ten(no coin five)﹤ =‘ 1’; no coin five﹤ =3; end if; end if; end process; end block; 設(shè)定 clk, reset 與 coin 5 三個(gè)系統(tǒng)輸入信號(hào)后,可觀察到系統(tǒng)輸出信號(hào) 29 led five 以及全局信號(hào) total amount 5 與 no coin five 3 位 led five 信號(hào)為“ 000”﹥“ 001”﹥“ 011”﹥“ 111” ,3 次投幣點(diǎn)亮了 3 個(gè) LED,投入金額分別表示 0,5 元 ,10 元和 15 元。下面列出色了傳統(tǒng) drink模塊的程序代碼。同理,下次的飲料選取按鍵總是可以取代前一次的選擇。同時(shí)還需要輸入系統(tǒng)信號(hào) reset ok buy 與 cancle buy,然 31 后設(shè)定輸出系統(tǒng)信號(hào) led buy 與 led cancle,用來(lái)對(duì)外顯示購(gòu)買或取消狀態(tài)。 elsif rising_edge(cancel_buy) then. cancel=’ 1’ 。 32 設(shè)定 ok_buy,cancel_buy 與 reset 三個(gè)系統(tǒng)輸入信號(hào),可觀察到系統(tǒng)輸出信號(hào) led_ok,led_cancel 與輸出全局信號(hào) ok 與 cancel 的波形, ok 與 cancel 信號(hào)用來(lái)維持 ok_buy 與 cancel_buy 按鍵操作的狀態(tài)。此信號(hào) total_amount 為全局信號(hào),僅供此處判斷而不做輸出,若投入金額超過(guò) 15 元,則必須輸出全局信號(hào) money_ok,以便其他行為的判別。下面列出 coin_rerumed 模塊的程序代碼。 led_five_return=(others=’ 0’ )。 else money_ok=’ 0’ 。 for i in 0 to 1 loop. led_ten_return(i)=return_clk。 for i in 0 to 1 loop. led_ten_return(i)=return_clk。 when25=led_ten_returen(0)= return_clk。 led_ten_return(1)=return_clk。 end block。而且也退出一枚 5 元硬幣( led_five_retuen0 =’ 1’)。系統(tǒng)輸入信號(hào) reset為所有模塊的重置信號(hào)。 bottle remaining cola. signalno_diet : integer range 0 to 20。 to deliver diet if nesscessary. led_diet_out=diet_out。 if no_cola=0 then led_cola_ok=’ 0’ 。 37 eng if。 elsif rising_edge(diet_out) then . no_diet=no_diet1。 end if。另外,局部信號(hào) no_cola 與 no_diet 僅用來(lái)記錄現(xiàn)存飲料數(shù)量,并不輸出到模塊外。 Deboune 模塊的 VHDL 碼 content definition of ponent “ debounce” . library ieee。 i/o signal declaraction. entity debounce is. pro(clk:in std_logicl。 definition of signal_flow in entity debounce. 我們假定一般按鍵信號(hào)的主脈沖寬度為 100ms 左右,而機(jī)械按鍵抖動(dòng)噪聲寬度不大于 30ms,為了計(jì)算真正的按鍵次數(shù),必須過(guò)濾機(jī)械抖動(dòng)噪聲。 declaraction of self_built sampling pulse from clock. begin sample signal generation. sampling_signal:block. input:clk. output:sample. signal delay :std_logic。 end if。 設(shè)定 clk 信號(hào)的震蕩頻率為 1024HZ,定義輸出全局信號(hào) sample 并在 block 內(nèi)定義一個(gè)局部信號(hào) q 為 5 計(jì)數(shù)器,作為除以 2^5=32 的分額器。 sample ﹤ =q(4)and notdelay。osc/2^5=32hz(). begin process(clk). begin if rising_edge(clk) then. delay=q(4)。下面列出sampling_signal 模塊的程序代碼。push button signal about 100ms period. push_out:out std_logic)。 use 。信號(hào)仿真結(jié)果如圖 410 所示: 38 圖 出貨并計(jì)算存貨電路仿真圖 debouncing 電路模塊 抖動(dòng)消除電路的程序 debouncing被放在 my_pkg的程序包中,當(dāng)作組件調(diào)用 ,在連接合成時(shí),必須同時(shí)附掛在 cola 主程序下才能正常運(yùn)行。 end process。 to show diet empty status . else led_diet_ok=’ 1’ 。 diet:process(reset_out)to book the bottle remaining diet. begin . if reset=’ 1’ then no_diet=20。 end if。 led_cola_ok=’ 1’ 。 to deliver cola if necessary. led_cola_out=cola_out。 give_check 模塊的 VHDL 碼 to deliver the selected drink and book the remaining number give_check:block. 36 input:,. output 。如果操作期間按 了取消鍵,則退幣燈全亮,并立即退還所有硬幣,信號(hào)仿真結(jié)果如圖 ,圖 所示: 35 圖 退幣處理電路仿真圖 圖 找零處理電路仿真圖 出貨并計(jì)算存貨電路模塊 ( give_check) 當(dāng)輸入全局信號(hào) ok,money_ok 與 cola_choice/diet_choice 均為 1時(shí),則確定輸出全局信號(hào) cola_out/diet_out 表示 cola/diet 可出貨,并點(diǎn)亮系統(tǒng)輸出信號(hào) led_cola_out/led_diet_out。另外,局部信號(hào) total_amount 僅用來(lái)暫存投入硬幣的總金額,并不輸出到模塊外,正常交易時(shí)的系統(tǒng)反應(yīng)。 end if。 led_five_return(1)= return_clk。 when15=null。 elsif(diet_out=’ 1’ or cola_out=’ 1’ ) then. return coins after drink delivered. case total_amount is. 34 when 0 to 14 =for i in 0 to 2 loop. led_five_return(i)=return_clk。 if(cancel=’ 1’ ) then if canceled_return all coins mmediately. for i in 0 to 2 loop. led_five_return(i)=return_clk。 elsif rising_edge(clk) then. total_amount=total_amount_ten+total_amount_five。 begin process(). begin if reset=’ 1’ then total_amount=’ 0’ 。定義全局信號(hào)return_clk 控制退幣警示燈。模塊輸入有 clk與 reset 兩個(gè)系統(tǒng)輸入信號(hào), led_five_return 與 led_ten_return 為系統(tǒng)輸入信號(hào),顯示被退飲料種類對(duì)應(yīng)的 LED 燈及數(shù)量。 end if1. end process。 ok or cancle 模塊的 VHDL 碼 to check confiming or canceling buying ok or cancle block input reset ok buy cancle buy output led buy ok led cancel cancel begin pl: process( reset ok buy) to maintain the confiming status begin if reset=‘ 1’ than ok﹤ =0 led buy ﹤ =0 els if rising dege( ok buy`) then ok﹤ =1 led buy ﹤ =1 end if; end prcess p2 process ( reset cancle buy ) tomaitain the canceling status begin if reset﹤ =1。 圖 飲料選擇處理電路仿真圖 確認(rèn)與取消處理電路模塊( ok or cancle) 按了購(gòu)買確認(rèn)鍵或取消鍵后,系統(tǒng)將據(jù)此處理交易與反應(yīng)。當(dāng)按下 select cola 鍵彈回時(shí),讓 cola choice 維持 1,作為選定 cola 的指針,同時(shí) led cola sel 燈亮,表示 cola 被選中。模塊有 clk reset select_cola 與 select_diet 四
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1