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

正文內(nèi)容

基于vhdl售貨機(jī)設(shè)計(jì)說明書(編輯修改稿)

2025-06-10 20:02 本頁面
 

【文章內(nèi)容簡(jiǎn)介】 s(clk) In this process, two counts will accumulate begin if(clk39。event and clk=39。139。) then dcount=dcount+1。 kcount=kcount+1。 end if。 end process。 process(clk) In this process, the main task is to scan keyboard 13 begin if(clk39。event and clk=39。139。) then if(kcount=0) then kr=1111。 kc=0000。 elsif(kcount=1) then keyr=kr。 kr=ZZZZ。 elsif(kcount=2) then kr=0000。 kc=1111。 elsif(kcount=3) then keyc=kc。kc=ZZZZ。 end if。 end if。 end process。 process(clk) change the key flags begin if(clk39。event and clk=39。139。) then if(kcount=4 and keyr=1111) then kflag1=39。039。 elsif(kcount=4) then kflag1=39。139。 end if。 kflag2=kflag1。 end if。 end process。 process(clk) get the coin begin if(clk39。event and clk=39。139。) then if(kcount=5) then if(keyr=1110) then case keyc is when 1101=coin0=coin0+1。 when others=coin0=coin0。 end case。 elsif(keyr=1101) then case keyc is when 1101=coin1=coin1+1。 when others=coin1=coin1。 end case。 end if。 coin=coin0*5+coin1*10。 C=coin。 14 yuan=coin/10。 jiao=coinyuan*10。 end if。 end if。 end process。 2) 利用撥碼開關(guān)表示錢數(shù): 利用撥碼開關(guān)表示錢數(shù)比利用鍵盤實(shí)現(xiàn)起來要方便得多,首先,撥碼開關(guān)投幣的確定性及穩(wěn)定性遠(yuǎn)遠(yuǎn)大于鍵盤實(shí)現(xiàn),因?yàn)殒I盤實(shí)現(xiàn)的時(shí)候很可能出現(xiàn)竄鍵或者由于去抖不到位而引起的顯示數(shù)與按鍵數(shù)不相符合的情況 ;但是撥碼開關(guān)也存在一定的問題,比如同 掃描鍵盤相比,軟件復(fù)位進(jìn)行的并不徹底,必須手動(dòng)將開關(guān)復(fù)位才能達(dá)到預(yù)期效果; shift1( 3downto0)表示了四個(gè)撥碼開關(guān),它們分別代表了 元, 1 元,2 元和 2元,任意組合之后就可以表示投入的錢數(shù),在投入錢數(shù)大于所選商品 總價(jià)值之后,便會(huì)自動(dòng)計(jì)算出應(yīng)該找回的余額,實(shí)現(xiàn)自動(dòng)找零的功能: library ieee。 use 。 use 。 use 。 entity shift1 is port( clk :in std_logic。 Clock Signal shift1 :in std_logic_vector(3 downto 0))。 end shift1。 architecture behave of shift1 is signal yuan,jiao,rey,rej :std_logic_vector (3 downto 0)。 signal by,bj :std_logic_vector (3 downto 0)。 begin put in coins 15 , process(shift1) begin if (clk39。event and clk=39。139。) then case shift1 is when 0000 = yuan=0000。jiao=0000。0 price when 0001 = yuan=0000。jiao=0101。 when 0010 = yuan=0001。jiao=0000。 when 0011 = yuan=0001。jiao=0101。 when 0100 = yuan=0010。jiao=0000。 when 0101 = yuan=0010。jiao=0101。 when 0110 = yuan=0011。jiao=0000。 when 0111 = yuan=0011。jiao=0101。 when 1000 = yuan=0010。jiao=0000。 when 1001 = yuan=0010。jiao=0101。 when 1010 = yuan=0011。jiao=0000。 when 1011 = yuan=0011。jiao=0101。 when 1100 = yuan=0100。jiao=0000。 when 1101 = yuan=0100。jiao=0101。 when 1110 = yuan=0101。jiao=0000。 when 1111 = yuan=0101。jiao=0101。 when others = NULL 。 end case 。 get money back if(jiao=0101) then rej=jiaobj。 rey=yuanby。 else if(bj=0000) then rej=0000。 rey=yuanby。 else rej=0101。 rey=yuanby0001。 end if。 end if 。 end if 。 end process。 end behave。 16 3)蜂鳴器與顯示燈: Beep 和 light 分別表示蜂鳴器和顯示燈,這兩個(gè)輸出顯示設(shè)備都是為了標(biāo)識(shí)交易是否成功的。在未進(jìn)行交易或者是交易不成功,即投幣總數(shù)小于應(yīng)投幣數(shù)的時(shí)候,顯示燈亮;而當(dāng)投幣數(shù)大于商品售價(jià),即交易成功的時(shí)候,蜂鳴器便被寫‘ 1’,持續(xù)發(fā)出響聲,知道復(fù)位;: library ieee。 use 。 use 。 use 。 entity beep is port( clk :in std_logic。 Clock Signal beep,light :out std_logic)。 end beep。 architecture behave of beep is signal yuan,jiao,rey,rej :std_logic_vector (3 downto 0)。 signal by,bj :std_logic_vector (3 downto 0)。 begin succeed or not process(clk) begin if(clk39。event and clk=39。139。) then if((yuanby)or((yuan=by)and(jiaobj))or((yuan=by)and(jiao=bj)and((yuan/=0)and(jiao/=0)))) then beep=39。139。 light=39。039。 else beep=39。039。 17 light=39。139。 end if。 end if 。 end process 。 end behave。 4)顯示函數(shù): 數(shù)碼管顯示是本設(shè)計(jì)的一個(gè)難題,因?yàn)橐瑫r(shí)顯示六位數(shù)字且不可以出現(xiàn)位數(shù)上的顛倒。由于開始嘗試的枚舉法的靜態(tài)顯示出現(xiàn)了邏輯門超出的錯(cuò)誤,所以只能選擇按位顯示,并將頻率提高到人眼難以察覺。 將商品總價(jià)格的元角 by,bj;投入錢數(shù)的 yuan, Jiao;以及算出的應(yīng)該找的零錢數(shù)目 rey, rej,都復(fù)制給一個(gè)中間變量 A_dis,再根據(jù)脈沖 count 自加,從 ” 000” 到“ 111” 進(jìn)行位選,按位顯示上述的值,再通過數(shù)碼管 a 到 f的七位段選,最終可以在數(shù)碼管上清晰地呈現(xiàn)出價(jià)格,投幣和找零: library ieee。 use 。 use 。 use 。 entity display is port( clk :in std_logic。 Clock Signal s0,s1,s2 :out std_logic。 a,b,c,d,e,f,g :out std_logic)。 18 end display。 architecture behave of display is signal leds :std_logic_vector (6 downto 0)。 signal A_dis :std_logic_vector (3 downto 0)。 signal dcount :std_logic_vector (2 downto 0)。 signal yuan,jiao,rey,rej :std_logic_vector (3 downto 0)。 signal by,bj :std_logic_vector (3 downto 0)。 begin display process (clk)掃描位選信號(hào) begin if(clk39。event and clk=39。139。) then dcount=dcount+1。 end if。 end process。 process (clk)位選 begin if(clk39。event and clk=39。139。) then s0=dcount(0)。s0 s1=dcount(1)。 s2=dcount(2)。 case dcount is when 0
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1