北郵數(shù)電綜合實(shí)驗(yàn) 加油機(jī)的設(shè)計(jì)_第1頁(yè)
北郵數(shù)電綜合實(shí)驗(yàn) 加油機(jī)的設(shè)計(jì)_第2頁(yè)
北郵數(shù)電綜合實(shí)驗(yàn) 加油機(jī)的設(shè)計(jì)_第3頁(yè)
北郵數(shù)電綜合實(shí)驗(yàn) 加油機(jī)的設(shè)計(jì)_第4頁(yè)
北郵數(shù)電綜合實(shí)驗(yàn) 加油機(jī)的設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩33頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、數(shù)字電路與邏輯設(shè)計(jì)實(shí)驗(yàn)學(xué)院:班級(jí):學(xué)號(hào):姓名:時(shí)間:一任務(wù)要求3二系統(tǒng)設(shè)計(jì)3設(shè)計(jì)思路3總體框圖3分塊說(shuō)明4三仿真波形41.投幣計(jì)數(shù)模塊4100元投幣的計(jì)數(shù)52.加油計(jì)數(shù)模塊63.數(shù)碼管顯示模塊74.點(diǎn)陣顯示模塊8四VHDL源程序141.2k分頻器142.投幣計(jì)數(shù)器153.加油計(jì)數(shù)器164.數(shù)碼管顯示205.點(diǎn)陣顯示246.音樂(lè)模塊307.總體布線36五完成功能說(shuō)明36六資源利用情況37七故障及問(wèn)題分析37八實(shí)驗(yàn)總結(jié)與心得體會(huì)37一任務(wù)要求設(shè)計(jì)并實(shí)現(xiàn)一個(gè)簡(jiǎn)易加油機(jī)控制系統(tǒng),能夠完成定值加油、加油至油箱滿等功能,并顯示所加油量和錢數(shù)。 基本要求: 1、 油價(jià)固定設(shè)為5元/升。 2、 用2個(gè)按鍵(b

2、tn7、btn6)分別表示一百元、十元,用btn5做加油開始鍵,用btn0做系統(tǒng)復(fù)位鍵。用3個(gè)數(shù)碼管(disp2、disp1、disp0)顯示錢數(shù),以元為單位,上限990元;用數(shù)碼管(disp5、disp4、disp3)顯示加油量,精確到0.1升,最大顯示99.9升。 3、 定值加油時(shí),先輸入錢幣,數(shù)碼管同時(shí)顯示錢數(shù),按加油鍵,開始加油。加油過(guò)程中,錢數(shù)及加油量的顯示從零開始遞增,直到錢數(shù)到達(dá)預(yù)定值。并用發(fā)光二極管表示購(gòu)買成功。加油過(guò)程中,所有按鍵按下無(wú)效。 4、 加油至油箱滿:在錢幣數(shù)為零的狀態(tài)下,按加油鍵,錢數(shù)及加油量的顯示從零開始遞增,直到油箱加滿。自行設(shè)計(jì)一個(gè)隨機(jī)數(shù)發(fā)生器,控制加油量自

3、動(dòng)停止在30升至50升之間,精確到0.1升。加油過(guò)程中,所有按鍵按下無(wú)效。 5、 復(fù)位鍵(btn0)按下后,系統(tǒng)復(fù)位,此時(shí)數(shù)碼管顯示錢幣數(shù)及加油量均為零。 提高要求: 1、 用小鍵盤輸入價(jià)格,用點(diǎn)陣顯示加油機(jī)各種狀態(tài)及動(dòng)畫。 2、 設(shè)定不同的油品、油價(jià)。 3、 油庫(kù)管理功能。4、 自擬其它功能。二系統(tǒng)設(shè)計(jì)設(shè)計(jì)思路自動(dòng)加油機(jī)的程序主要的難點(diǎn)在于計(jì)數(shù)器的實(shí)現(xiàn)與不同狀態(tài)的控制,先讓投幣計(jì)數(shù)器器計(jì)數(shù)投入的錢數(shù),并用數(shù)碼管顯示出來(lái),當(dāng)加油鍵按下時(shí),數(shù)碼管顯示歸零,并讓左右三個(gè)數(shù)碼管同時(shí)開始從零計(jì)數(shù),由于是五元一升,即當(dāng)油量加兩個(gè)數(shù)時(shí),價(jià)錢加一個(gè)數(shù),當(dāng)價(jià)錢等于投幣計(jì)數(shù)器傳過(guò)來(lái)的值時(shí),停止計(jì)數(shù),顯示動(dòng)畫,提

4、示加油成功??傮w框圖2k分頻器投幣計(jì)數(shù)器加油計(jì)數(shù)器數(shù)碼管顯示器10元100元Cpclkclkclkjiayoumoney點(diǎn)陣音樂(lè)chooseoil對(duì)每個(gè)模塊都有一個(gè)復(fù)位,所以省略。分塊說(shuō)明(1) 輸入部分:輸入部分有六個(gè)輸入端,分別為時(shí)鐘輸入,10元按鍵,100元按鍵,加油鍵,復(fù)位鍵,以及附加功能中的選擇油品的開關(guān)。復(fù)位信號(hào)為高電平有效,當(dāng)reset=1時(shí),所以都清為0。(2) 處理部分:主要處理的部分為加油計(jì)數(shù)器部分,當(dāng)有reset=1信號(hào)后,投幣計(jì)數(shù)器向加油計(jì)數(shù)器傳入及時(shí)的錢數(shù)值,當(dāng)有jiayou=1信號(hào)后,加油計(jì)數(shù)器的輸出錢數(shù)值歸零,并開始計(jì)數(shù),直到錢數(shù)等于預(yù)定錢數(shù)。在加滿油的功能上,設(shè)

5、定一個(gè)用時(shí)鐘控制的計(jì)數(shù)器,當(dāng)加油鍵按下且輸入的錢數(shù)等于零時(shí),加油鍵按下的時(shí)機(jī)就從計(jì)數(shù)器中把值賦給錢數(shù),然后開始加油,后面的類似。(3) 輸出部分:輸出的部分不單單只有數(shù)碼管的輸出,還有點(diǎn)陣與音樂(lè)的輸出,在數(shù)碼管的輸出中,我通過(guò)六個(gè)數(shù)來(lái)控制六個(gè)數(shù)碼管的值并輸出,而點(diǎn)陣則是通過(guò)復(fù)位與加油鍵的控制輸出三種不同狀態(tài)的動(dòng)畫(我姑且把它起名為歡迎加油,正在加油,謝謝加油三種狀態(tài)),音樂(lè)在加油成功后播放音樂(lè),為我國(guó)經(jīng)典的小提琴曲梁祝,讓人在愉悅的心情中付錢。三仿真波形1.投幣計(jì)數(shù)模塊10元投幣計(jì)數(shù),其中mpo3,mpo2,mpo1分別表示moneypayout的縮寫,為錢輸出的百位十位與個(gè)位。100元投幣的

6、計(jì)數(shù)從10元計(jì)數(shù)器可以看出,最多錢可記到990:2.加油計(jì)數(shù)模塊首先,chooseoil=0當(dāng)加油鍵沒有按時(shí),money3out=mpi3,money2out=mpi2,money1out=mpi1,這個(gè)是把付錢給用戶看,而oil3out,oil2out,oil1out為9,5,0,這個(gè)意思是95號(hào)油的顯示,95號(hào)油的油價(jià)為5元一升,當(dāng)加油鍵按下時(shí),moneyout3,moneyout2,moneyout1,oilout3,oilout2,oilout1歸零并開始計(jì)數(shù)。當(dāng)計(jì)數(shù)到規(guī)定錢數(shù)時(shí),停止計(jì)數(shù),給點(diǎn)陣與音樂(lè)控制一個(gè)不同的信號(hào),讓他們改變狀態(tài)。這里為了仿真方便起見,只選擇輸入10元時(shí)。(mp

7、i為moneypayin的縮寫)當(dāng)chooseoil=1時(shí),加的即為97號(hào)油,97號(hào)油我設(shè)定是十元一升,此時(shí),moneyout與oilout計(jì)數(shù)是同步的。并且注意到開始加油鍵沒有按下時(shí),oil3out,oil2out為9,7.說(shuō)明此時(shí)已經(jīng)變成了97號(hào)油。加油至郵箱滿:當(dāng)moneypayin=0時(shí),設(shè)定一個(gè)計(jì)數(shù)器,在加油過(guò)程中通過(guò)加油鍵的按下瞬間把值傳給錢數(shù),接著就是與上面一樣的加油計(jì)數(shù)方式。3.數(shù)碼管顯示模塊我用了六個(gè)數(shù)值同時(shí)控制六個(gè)數(shù)碼管的顯示。具體我們可以看到不同的為顯示我想讓它顯示的地方,不妨把oil3in,oil2in,oilin設(shè)為123,money3in,money2in,mone

8、y1in設(shè)為246.4.點(diǎn)陣顯示模塊點(diǎn)陣在前面已經(jīng)提到分為狀態(tài)一:歡迎加油;狀態(tài)二:正在加油;狀態(tài)三:謝謝加油三種狀態(tài)。狀態(tài)一,在點(diǎn)陣上顯示英文字母HELLO和一個(gè)_的笑臉的動(dòng)畫,為了讓LL區(qū)分開,我把它做成閃爍的形式。HELO笑臉當(dāng)加油機(jī)正在加油時(shí),此時(shí)en1傳入1,en2傳入0,在點(diǎn)陣上顯示“加油”兩個(gè)字的動(dòng)畫?!凹印弊郑骸坝汀弊郑寒?dāng)en1=“0”且en2=“1”時(shí),進(jìn)入第三狀態(tài):謝謝加油,此時(shí),點(diǎn)陣顯示動(dòng)畫的“THANKS”和一個(gè)笑臉,其中笑臉與歡迎加油一樣,故略去。THANKS音樂(lè)模塊由于控制過(guò)于簡(jiǎn)單且仿真波形沒有實(shí)質(zhì)性意義,故略去。四VHDL源程序1.2k分頻器library iee

9、e;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity div2k isport(clk_in : in std_logic;clk_out : out std_logic);end;architecture fenpin of div2k issignal cnt :integer range 0 to 999; -當(dāng)記到999時(shí)反轉(zhuǎn)signal clk_tmp : std_logic;beginprocess(clk_in)beginif(clk_in'event and clk_in='1&

10、#39;)thenif cnt=999 thencnt<=0; clk_tmp<=not clk_tmp;elsecnt<=cnt+1;end if;end if;end process;clk_out<=clk_tmp;end;2.投幣計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity pay isport(clk : in std_logic;reset :in std_logic;pay100,pay10 :in std_logic;money : o

11、ut integer range 0 to 990;mpo3,mpo2,mpo1: out std_logic_vector(3 downto 0);end pay;architecture paymoney of pay issignal moneypay : integer range 0 to 990;signal money3,money2,money1 :std_logic_vector(3 downto 0);beginmpo3<=money3;mpo2<=money2;mpo1<=money1;process(clk)beginif(clk'event

12、and clk='1') then if reset='1' then moneypay<=0; money3<="0000"money2<="0000"money1<="0000" -復(fù)位 elsif(pay100='1' and pay10='0') then if(moneypay<=890) then moneypay<=moneypay + 100; -投100元 money3<=money3+1; end if; el

13、sif(pay100='0' and pay10='1') then if(moneypay<=980) then if(money2="1001") then money3<=money3+1;money2<="0000" moneypay<=moneypay + 10; -投10元 else money2<=money2+1; moneypay<=moneypay + 10; end if; end if; else moneypay<=moneypay; money3<

14、=money3;money2<=money2; end if; else moneypay<=moneypay; end if; money<=moneypay;end process;end paymoney;3.加油計(jì)數(shù)器library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jiayoucount isport(reset: in std_logic;jiayou,clk:in std_logic;chooseoil: in std_logic;dianzhenout

15、1 :out std_logic;dianzhenout2 :out std_logic;moneypayin :in integer range 0 to 990;mpi3,mpi2,mpi1 :in std_logic_vector(3 downto 0);money3out,money2out,money1out : out std_logic_vector(3 downto 0);oil3out,oil2out,oil1out : out std_logic_vector(3 downto 0);musiccontrol : out std_logic);end jiayoucount

16、;architecture simple of jiayoucount issignal deng : integer range 0 to 1999;signal money3,money2,money1 : std_logic_vector(3 downto 0);signal oil3,oil2,oil1 :std_logic_vector(3 downto 0);signal cnt2 :integer range 0 to 1;signal mpc : integer range 0 to 990;signal xiaobiao :std_logic;signal moneyrd1,

17、moneyrd2 : integer range 0 to 990;signal cnt100 : integer range 150 to 250;signal cnt200 : integer range 300 to 500;beginprocess(clk)beginif (clk'event and clk='1' ) thenif cnt100 = 250 thencnt100<=150;elsecnt100<=cnt100+1; -95號(hào)油的加滿油的計(jì)數(shù)器end if;if cnt200 = 500 thencnt200<=300;els

18、ecnt200<=cnt200+1; -97號(hào)油的加滿油計(jì)數(shù)器end if;end if;end process;process(clk,reset)beginif(reset='1') then -復(fù)位 xiaobiao<='0' -狀態(tài)轉(zhuǎn)換信號(hào) money3<="0000"money2<="0000"money1<="0000" oil3<="0000"oil2<="0000"oil1<="0000&q

19、uot; deng<=0;cnt2<=0;mpc<=0;dianzhenout1<='0'dianzhenout2<='0'musiccontrol<='1' elsif clk'event and clk ='1' then if(jiayou='1')then xiaobiao<='1' -狀態(tài)改變,讓其他鍵對(duì)加油進(jìn)程無(wú)影響 if(moneypayin=0) then -如果輸入錢等于零,則用計(jì)數(shù)器隨機(jī)3050升 moneyrd1<=cnt

20、100; moneyrd2<=cnt200; else -傳入錢數(shù)值 moneyrd1<=moneypayin; moneyrd2<=moneypayin; end if; end if; if(xiaobiao='0') thenif(chooseoil='0') then -95號(hào)油 money3out<=mpi3; money2out<=mpi2; money1out<=mpi1; oil3out<="1001" oil2out<="0101" oil1out<=

21、"0000"elsif(chooseoil='1') then -97號(hào)油 money3out<=mpi3; money2out<=mpi2; money1out<=mpi1; oil3out<="1001" oil2out<="0111" oil1out<="0000"end if; end if; if(xiaobiao='1') thencase chooseoil is -95號(hào)油的分支計(jì)數(shù)when '0' => if

22、 deng = 1999 then cnt2<=cnt2+1; if(mpc<moneyrd1) then dianzhenout1<='1'dianzhenout2<='0'musiccontrol<='1' if( oil3="1001" and oil2="1001" and oil1="1001") then oil3<="1001" oil2<="1001" oil1<="1001

23、" elsif(oil2="1001" and oil1="1001") then oil3<=oil3+1; oil2<="0000"oil1<="0000" elsif(oil1="1001") then oil2<=oil2+1; oil1<="0000" else oil1<=oil1+1; end if; if( money3="0101" and money2="0000" an

24、d money1="0000" and cnt2=1) then -此時(shí)設(shè)置cnt2,讓oil+2時(shí),money+1. money3<="0101" money2<="0000" money1<="0000"mpc<=mpc+1; elsif(money2="1001" and money1="1001" and cnt2=1) then money3<=money3+1; money2<="0000"money1<

25、;="0000" ;mpc<=mpc+1; elsif(money1="1001" and cnt2=1) then money2<=money2+1; money1<="0000"mpc<=mpc+1; elsif(cnt2=1) then money1<=money1+1;mpc<=mpc+1; else money3<=money3; money2<=money2; money1<=money1; end if; else dianzhenout1<='0

26、9;dianzhenout2<='1' -點(diǎn)陣輸出 musiccontrol<='0' money3<=money3; money2<=money2; money1<=money1; oil3<=oil3; oil2<=oil2; oil1<=oil1; mpc<=mpc; end if; deng <=0; else deng<=deng+1;money3out<=money3;money2out<=money2;money1out<=money1;oil3out<=oi

27、l3;oil2out<=oil2;oil1out<=oil1; end if;when '1' => -97號(hào)油的分支計(jì)數(shù) if deng = 1999 then if(mpc<moneyrd2) then dianzhenout1<='1'dianzhenout2<='0'musiccontrol<='1' if( oil3="1001" and oil2="1001" and oil1="0000") then oil3<

28、;="1001" oil2<="1001" oil1<="0000" elsif(oil2="1001" and oil1="1001") then oil3<=oil3+1; oil2<="0000"oil1<="0000" elsif(oil1="1001") then oil2<=oil2+1; oil1<="0000" else oil1<=oil1+1; en

29、d if; if( money3="1001" and money2="1001" and money1="0000") then -此時(shí)不用設(shè)置cnt2,oil計(jì)數(shù)與money計(jì)數(shù)同步。 money3<="1001" money2<="1001" money1<="0000"mpc<=mpc+1; elsif(money2="1001" and money1="1001") then money3<=mo

30、ney3+1; money2<="0000"money1<="0000" ;mpc<=mpc+1; elsif(money1="1001") then money2<=money2+1; money1<="0000"mpc<=mpc+1; else money1<=money1+1;mpc<=mpc+1; end if; else dianzhenout1<='0'dianzhenout2<='1' musiccontrol

31、<='0' money3<=money3; money2<=money2; money1<=money1; oil3<=oil3; oil2<=oil2; oil1<=oil1; mpc<=mpc; end if; deng <=0; else deng<=deng+1;money3out<=money3;money2out<=money2;money1out<=money1;oil3out<=oil3;oil2out<=oil2;oil1out<=oil1; end if;end

32、case; end if; end if; end process;end simple;4.數(shù)碼管顯示library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity shumaguanxianshi isport(clk :in std_logic;-jiayou : in std_logic;money3in,money2in,money1in :in std_logic_vector(3 downto 0);oil3in,oil2in,oil1in : in std_logic_vector(

33、3 downto 0);-moneypayin : in integer range 0 to 990;sg:out std_logic_vector(7 downto 0);bt:out std_logic_vector(5 downto 0);end;architecture xianshi of shumaguanxianshi issignal cnt6 : integer range 0 to 5;signal wei :integer range 0 to 5;signal clk_tmp :std_logic;signal money3,money2,money1 : std_l

34、ogic_vector(3 downto 0);signal oil3,oil2,oil1 : std_logic_vector(3 downto 0);beginmoney3<=money3in;money2<=money2in;money1<=money1in;oil3<=oil3in;oil2<=oil2in;oil1<=oil1in;clk_tmp<=clk;p1:process(cnt6)begincase cnt6 is -數(shù)碼管掃描when 0 =>bt<="011111" wei<=5;when 1

35、 =>bt<="101111" wei<=4;when 2 =>bt<="110111" wei<=3;when 3 =>bt<="111011" wei<=2;when 4 =>bt<="111101" wei<=1;when 5 =>bt<="111110" wei<=0;when others => null;end case;end process p1;p2:process(clk_tmp)

36、beginif (clk_tmp'event and clk_tmp='1' )thenif cnt6 = 5 thencnt6<=0;else cnt6 <= cnt6 + 1;end if;end if;end process p2;p3:process(wei)begincase wei is when 5 => case oil3(3 downto 0) is -油量十位 when "0000" => sg(7 downto 0) <="11111100" when "0001&qu

37、ot; => sg(7 downto 0) <="01100000" when "0010" => sg(7 downto 0) <="11011010" when "0011" => sg(7 downto 0) <="11110010" when "0100" => sg(7 downto 0) <="01100110" when "0101" => sg(7 downto 0)

38、 <="10110110" when "0110" => sg(7 downto 0) <="10111110" when "0111" => sg(7 downto 0) <="11100000" when "1000" => sg(7 downto 0) <="11111110" when "1001" => sg(7 downto 0) <="11110110&quo

39、t; when others => sg(7 downto 0) <="11111100" end case; when 4 => case oil2(3 downto 0) is -油量個(gè)位 when "0000" => sg(7 downto 0) <="11111101" when "0001" => sg(7 downto 0) <="01100001" when "0010" => sg(7 downto 0) <

40、;="11011011" when "0011" => sg(7 downto 0) <="11110011" when "0100" => sg(7 downto 0) <="01100111" when "0101" => sg(7 downto 0) <="10110111" when "0110" => sg(7 downto 0) <="10111111" w

41、hen "0111" => sg(7 downto 0) <="11100001" when "1000" => sg(7 downto 0) <="11111111" when "1001" => sg(7 downto 0) <="11110111" when others => sg(7 downto 0) <="11111101" end case;when 3 => case oil1(3 d

42、ownto 0) is -油量十分位 when "0000" => sg(7 downto 0) <="11111100" when "0001" => sg(7 downto 0) <="01100000" when "0010" => sg(7 downto 0) <="11011010" when "0011" => sg(7 downto 0) <="11110010" when

43、"0100" => sg(7 downto 0) <="01100110" when "0101" => sg(7 downto 0) <="10110110" when "0110" => sg(7 downto 0) <="10111110" when "0111" => sg(7 downto 0) <="11100000" when "1000" => s

44、g(7 downto 0) <="11111110" when "1001" => sg(7 downto 0) <="11110110" when others => sg(7 downto 0) <="11111100" end case;when 2 => case money3(3 downto 0) is -錢百位 when "0000" => sg(7 downto 0) <="11111100" when &quo

45、t;0001" => sg(7 downto 0) <="01100000" when "0010" => sg(7 downto 0) <="11011010" when "0011" => sg(7 downto 0) <="11110010" when "0100" => sg(7 downto 0) <="01100110" when "0101" => sg(7

46、downto 0) <="10110110" when "0110" => sg(7 downto 0) <="10111110" when "0111" => sg(7 downto 0) <="11100000" when "1000" => sg(7 downto 0) <="11111110" when "1001" => sg(7 downto 0) <="111

47、10110" when others => sg(7 downto 0) <="11111100" end case;when 1 => case money2(3 downto 0) is -錢十位 when "0000" => sg(7 downto 0) <="11111100" when "0001" => sg(7 downto 0) <="01100000" when "0010" => sg(7 down

48、to 0) <="11011010" when "0011" => sg(7 downto 0) <="11110010" when "0100" => sg(7 downto 0) <="01100110" when "0101" => sg(7 downto 0) <="10110110" when "0110" => sg(7 downto 0) <="1011111

49、0" when "0111" => sg(7 downto 0) <="11100000" when "1000" => sg(7 downto 0) <="11111110" when "1001" => sg(7 downto 0) <="11110110" when others => sg(7 downto 0) <="11111100" end case;when 0 => case

50、 money1(3 downto 0) is -錢個(gè)位 when "0000" => sg(7 downto 0) <="11111100" when "0001" => sg(7 downto 0) <="01100000" when "0010" => sg(7 downto 0) <="11011010" when "0011" => sg(7 downto 0) <="11110010&qu

51、ot; when "0100" => sg(7 downto 0) <="01100110" when "0101" => sg(7 downto 0) <="10110110" when "0110" => sg(7 downto 0) <="10111110" when "0111" => sg(7 downto 0) <="11100000" when "1000"

52、; => sg(7 downto 0) <="11111110" when "1001" => sg(7 downto 0) <="11110110" when others => sg(7 downto 0) <="11111100" end case;when others =>null;end case;end process p3;end xianshi;5.點(diǎn)陣顯示library ieee;use ieee.std_logic_1164.all;use ieee.

53、std_logic_unsigned.all;entity dianzhen isport(clk : in std_logic;en1,en2: in std_logic;lie : out std_logic_vector(7 downto 0);com : out std_logic_vector(7 downto 0);end dianzhen;architecture behave of dianzhen issignal cnt8 :integer range 0 to 7;signal wei :integer range 0 to 7;signal jydianzhen : i

54、nteger range 0 to 55999;beginp1:process(cnt8)begincase cnt8 is -點(diǎn)陣掃描when 0 =>com<="01111111" wei<=0;when 1 =>com<="10111111" wei<=1;when 2 =>com<="11011111" wei<=2;when 3 =>com<="11101111" wei<=3;when 4 =>com<="11

55、110111" wei<=4;when 5 =>com<="11111011" wei<=5;when 6 =>com<="11111101" wei<=6;when 7 =>com<="11111110" wei<=7;when others => null;end case;end process p1;p2:process(clk)beginif (clk'event and clk='1' )thenif cnt8 = 7 th

56、encnt8<=0;else cnt8 <= cnt8 + 1;end if;if(jydianzhen = 55999 ) thenjydianzhen<=0;else jydianzhen<=jydianzhen+1;end if;end if;end process p2;p3:process(wei,en1,en2)begincase en2 is when '0' =>case en1 iswhen '0' =>if(jydianzhen<6999) then -“H”case wei iswhen 0=>

57、;lie<="11000011"when 1=>lie<="11000011"when 2=>lie<="11000011"when 3=>lie<="11111111"when 4=>lie<="11111111"when 5=>lie<="11000011"when 6=>lie<="11000011"when 7=>lie<="11000011&quo

58、t;end case;elsif( jydianzhen>=6999 and jydianzhen<9999) then -NULLcase wei iswhen 0=>lie<="00000000"when 1=>lie<="00000000"when 2=>lie<="00000000"when 3=>lie<="00000000"when 4=>lie<="00000000"when 5=>lie<=&qu

59、ot;00000000"when 6=>lie<="00000000"when 7=>lie<="00000000"end case;elsif(jydianzhen>=9999 and jydianzhen<16999) then -Ecase wei iswhen 0=>lie<="11111111"when 1=>lie<="11111111"when 2=>lie<="00000011"when 3=>

60、;lie<="11111111"when 4=>lie<="11111111"when 5=>lie<="00000011"when 6=>lie<="11111111"when 7=>lie<="11111111"end case;elsif( jydianzhen>=16999 and jydianzhen<19999) then -NULLcase wei iswhen 0=>lie<="0000000

61、0"when 1=>lie<="00000000"when 2=>lie<="00000000"when 3=>lie<="00000000"when 4=>lie<="00000000"when 5=>lie<="00000000"when 6=>lie<="00000000"when 7=>lie<="00000000"end case;elsif(jydia

62、nzhen>=19999 and jydianzhen<26999)then -Lcase wei iswhen 0=>lie<="00000011"when 1=>lie<="00000011"when 2=>lie<="00000011"when 3=>lie<="00000011"when 4=>lie<="00000011"when 5=>lie<="00000011"when 6=&

63、gt;lie<="11111111"when 7=>lie<="11111111"end case;elsif( jydianzhen>=26999 and jydianzhen<29999) then -NULLcase wei iswhen 0=>lie<="00000000"when 1=>lie<="00000000"when 2=>lie<="00000000"when 3=>lie<="00000

64、000"when 4=>lie<="00000000"when 5=>lie<="00000000"when 6=>lie<="00000000"when 7=>lie<="00000000"end case;elsif(jydianzhen>=29999 and jydianzhen<36999) then -Lcase wei iswhen 0=>lie<="00000011"when 1=>lie<="00000011"wh

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論