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

正文內(nèi)容

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

2024-12-23 20:00本頁面
  

【正文】 input: led ten total amount 10 signal coin10 std_logic。 if no coin ten then led ten(no coin ten)﹤ =‘ 1’; no coin ten﹤ =2; end if; end if; end process; end block; 設(shè)定 clk, reset,與 coin 10 系統(tǒng)輸入信號(hào)后,可觀察到系統(tǒng)輸出信號(hào) led ten 以及全局信號(hào) total amount ten 和 no coin ten,如圖 所示: 圖 10 元硬幣處理電路仿真圖 投入 5 元硬幣的處理器電路模塊( coin 5 counting) 本模塊計(jì) 算 5 元硬幣的投入數(shù)量及金額,并點(diǎn)亮對(duì)應(yīng)數(shù)量的 LED??紤]到投幣動(dòng)作為記次行為,故將 coin five 信號(hào)進(jìn)行抖動(dòng)消除處理,以利于計(jì)數(shù) no coin five 信號(hào)用來累計(jì) 5 元硬幣的投入數(shù)量,這兩個(gè)信號(hào)都是局部信號(hào),不向外傳遞。 coin 5 counting 模塊的 VHDL to count the number and amount of coin 5and light the leds coin 5 counting: block input: led five total amount 5 Signal coin5: std logic; cleared coin 5 signal to count push button frequency Signal mo coin five : integer range0to3; no of throw coin five begin ul: debounce portmap( clk﹥ =clk, touch﹥ =coin 5, push out﹥ =coin10) process( reset coin 5) begin if reset=‘ 1’ then total amount five﹤ =0; no coin five﹤ =0 led five ﹤ =00 els if rising dege( coin 5) thentriggered by coin5 total amount five﹤ =total amount five+5。仿真結(jié)果如圖 所示: 圖 5 元硬幣處理電路仿真圖 飲料選擇處理電路模塊( select drink) 本模塊處理飲料選擇種類,并點(diǎn)亮對(duì)應(yīng)種類的 LED。輸出 cola choice 為全局信號(hào),維持 cola 與diet 被選取狀態(tài)的指針,用作其他行為的判斷依據(jù)。 select drink 模塊的 VHDL 碼 to select cola or diet Select drink: block input clk reset select cola select diet output: led cola selled diet sel cola choice diet choice begin Process( reset clk) begin if reset=‘ 1’ then led cola sel﹤ =0 led diet sel ﹤ =0; els if rising dege( clk) then if select cola=’ 1’ then led cola sel﹤ =1 cola choice﹤ =‘ 1’; to maintain the cola selection status led diet sel﹤ =0 30 exclusive double choice end if if select diet=‘ 1’ then cola sel﹤ =‘ 0’ exclusive double choice diet choice﹤ =‘ 1’ led diet sel﹤ =1 end if; end if; end process; end block; 設(shè)定 clk reset select diet與 select cola 四個(gè)系統(tǒng)輸入信號(hào)后,可觀察到系統(tǒng)輸出信號(hào) led cola selled diet sel 以及整體共享信號(hào) cola choice 與diet choice 的波形。但若隨后按了 select diet 鍵,則以后一次的選擇為準(zhǔn),所以不但讓 diet choice 及 led diet sel 維持 1,而且將 cola choice 與 led cola sel 還原為 0。如圖 所示。但按鍵信號(hào)只是一個(gè)短脈沖,應(yīng)該將其狀態(tài)維持住,因此本模塊需要定義并輸出全局信號(hào) ok與cancle 給其他模塊。下面 列出 ok or cancle 模塊的程序代碼。then cancel﹤ =‘ 0’; led_cancel=’ 0’ 。 led_cancel=’ 1’ 。 end block。如圖 所示: 圖 確認(rèn)與取消處理電路仿真圖 退幣處理電路模塊( coin_returned) 本模塊處理應(yīng)退還的硬幣種類與數(shù)量。此模塊需要輸入全局信號(hào) total_amount_five 與total_amount_ten 來計(jì)算總投入金額 total_amount。如果按了 cancel_buy 鍵, 則系統(tǒng)必須立即退還所有硬幣,所以還需要定義全局信號(hào) cancel 用做判斷。在正常的情況下,只有在輸入全局信號(hào) cola_out或 diet_out 出貨信號(hào)為 1 時(shí),系統(tǒng)才開始判斷應(yīng)該退何種硬幣及數(shù)量。 coin_rerumed 模塊的 VHDL 碼 to check total am ount and decide returned coins and twinkle. the leds. coin_returned:block. 33 input:. . . output:. . signal total_amount : integer range 0 to 35。 money_ok=’ 0’ 。 led_ten_return=(others=’ 0’ )。 if total_amount=15 then money_ok=’ 1’ 。 end if。 end loop。 end loop。 end loop。 end loop。 when20=led_five_return(2)=return_clk。 when30=led_ten_returen(1)= return_clk。 when others=led_ten_return(0)=return_clk。 end case。 end process。 設(shè)定 clk 與 reset 等系統(tǒng)輸入信號(hào),以及輸入全局信號(hào) cancel,total_amount_five,return_clk,cola_out 與 diet_to信號(hào)后,可以觀察到系統(tǒng)輸出信號(hào) led_ten_return,led_five_return 與輸出全局信號(hào) money_ok 的波形。投入 20 元,選擇 diet 并按確認(rèn)鍵,則不但出貨燈led_diet_out 亮。由于cola_out 與 diet_out 信號(hào)無法提出,故用 led_cola_out及 led_diet_out 替代。對(duì)于 cola 與 diet兩種飲料的存貨,用模塊內(nèi)部局部信號(hào) no_cola與 no_diet來記錄 cola與 diet的存貨數(shù)量,只要還有存貨,則系統(tǒng)輸出信號(hào) led_cola_ok 與 led_diet_ok 便保持燈亮。下面列出 give_check 模塊的程序代碼。 cola_out,led_cola_out,diet_out,led_diet_out,led_cola_ok,led_diet_ok. signalno_cola : integer range 0 to 20。 bottle remaining diet. begin cola_out=’ 1’ when(money_ok=’ 1’ and cola_choice=’ 1’ ). else’ 0’ 。 diet_out=’ 1’ when(money_ok=’ 1’ and diet_choice=’ 1’ ). else’ 0’ 。 cola:process()to book the bottle remaining cola. begin if reset=’ 1’ then no_cola=20。 elsif rising_edge(cola_out) then . no_cola=no_cola1。 to show cola empty status. else led_cola_ok=’ 1’ 。 end if。 end process。 led_diet_ok=’ 1’ 。 if no_diet=0 then led_diet_ok=’ 0’ 。 end if。 end if。 reset(重置信號(hào))為本模塊的唯一系統(tǒng)輸入信號(hào),輸入全局信號(hào)money_ok,ok 與 cola_choice/diet_choice 信號(hào),可觀察到系統(tǒng)輸出信號(hào)led_cola_out,led_diet_out,led_cola_ok,led_diet_ok 與 輸 出 全 局 信 號(hào)cola_out/diet_out 的波形。每種飲料初始數(shù)量定為 20 罐,當(dāng)存貨量降為0 時(shí),則將供貨燈 led_cola_ok/led_diet_ok 熄滅(系統(tǒng)輸出信號(hào))。 下面列出 deboune 模塊的程序代碼。 use 。 use 。basic clock input 1024 hz. touch:std_logic。cleared push botton signal end debounce。因此首先 39 由 1024HZ 的時(shí)鐘信號(hào)制作出周期為 的取樣信號(hào)。 sampling_signal 模塊的 VHDL 碼 architecture arch of debounce is signal sample :std_logic。 one_step delay. signal q : std_logic_vector(4 downto 0)。 q﹤ =q+1。 end process。leading edge differenting end b
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1