計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì)_第1頁
計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì)_第2頁
計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì)_第3頁
計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì)_第4頁
計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì)_第5頁
已閱讀5頁,還剩12頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、北 華 航 天 工 業(yè) 學(xué) 院EDA技術(shù)綜合設(shè)計(jì)課程設(shè)計(jì)報(bào)告報(bào)告題目: 計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì) 作者所在系部: 電子工程系 作者所在專業(yè): 自動化專業(yè) 作者所在班級: B11222 作 者 姓 名 : 指導(dǎo)教師姓名: 崔瑞雪 完 成 時 間 : 1內(nèi) 容 摘 要 在quatrusII 中 利用VHDL語言編寫數(shù)碼管顯示程序,然后進(jìn)行功能仿真,然后進(jìn)行鎖定引腳,然后硬件進(jìn)行下載,調(diào)試。關(guān)鍵詞: VHDL,數(shù)碼管顯示,quatrusII,時序仿真圖。 目 錄 內(nèi) 容 摘 要I目 錄II課程設(shè)計(jì)任務(wù)書III一、 實(shí)驗(yàn)?zāi)康?二、硬件要求1三、方案論證1四、模塊說明21.計(jì)數(shù)器(counter60)2

2、2.計(jì)數(shù)器(counter16)33.計(jì)數(shù)器(counter12)44.計(jì)數(shù)器(counter10)56.譯碼器(deled)77.分頻器(div)88.頂層文件9五、圖7計(jì)數(shù)顯示的整體連接圖11六、實(shí)驗(yàn)步驟11七、實(shí)驗(yàn)結(jié)果12八、總結(jié)12九、參考文獻(xiàn)12課程設(shè)計(jì)任務(wù)書課題名稱計(jì)數(shù)器及數(shù)碼顯示綜合設(shè)計(jì)完成時間2013-12-03 指導(dǎo)教師崔瑞雪職稱副教授學(xué)生姓名班 級B11222總體設(shè)計(jì)要求和技術(shù)要點(diǎn)利用VHDL進(jìn)行數(shù)字鐘設(shè)計(jì),主要完成以下功能:一、  實(shí)驗(yàn)?zāi)康?、設(shè)計(jì)一個帶使能輸入、進(jìn)位輸出及同步清0的增1十進(jìn)制計(jì)數(shù)器。2、設(shè)計(jì)一個帶使能輸入及同步清0的增1十二進(jìn)制計(jì)數(shù)器。3、設(shè)計(jì)

3、一個帶使能輸入及同步清0的六十進(jìn)制同步加法計(jì)數(shù)器。4、設(shè)計(jì)一個四位二進(jìn)制可逆計(jì)數(shù)器。5、設(shè)計(jì)一個共陰7段數(shù)碼管控制接口,要求:在時鐘信號的控制下,使7位數(shù)碼管動態(tài)刷新顯示上述計(jì)數(shù)器的計(jì)數(shù)結(jié)果。 工作內(nèi)容及時間進(jìn)度安排課程設(shè)計(jì)成果1 213一、 實(shí)驗(yàn)?zāi)康?. 熟悉QUARATE工具軟件2. 熟悉VHDL語言設(shè)計(jì)3. 學(xué)習(xí)EDA課程的綜合設(shè)計(jì)4. 學(xué)習(xí)計(jì)數(shù)器的VHDL語言設(shè)計(jì)5. 了解器件編程和下載及硬件接口連接. 二、硬件要求1. 主芯片EPF10K10LC84-4。2. 7個八段掃描共陰極數(shù)碼顯示管。3. 三個按鍵開關(guān)(使能端,清零端,可逆端)。三、方案論證本次設(shè)計(jì)中將任務(wù)分成幾個部來完成分別

4、是:分頻部分、十進(jìn)制計(jì)數(shù)器、十二進(jìn)制計(jì)數(shù)器、十六進(jìn)制可逆計(jì)數(shù)器、六十進(jìn)制計(jì)數(shù)器、譯碼部分、時間掃描模塊和頂層文件。分頻部分:在這個部分里,接受20mhz的頻率,然后分出1hz的計(jì)數(shù)頻率和100hz的掃描頻率。十進(jìn)制計(jì)數(shù)器、十二進(jìn)制計(jì)數(shù)器、六十進(jìn)制計(jì)數(shù)器:在這個部分中要實(shí)現(xiàn)帶使能輸入、同步清0的增1十進(jìn)制、十二進(jìn)制、六十進(jìn)制的計(jì)數(shù)器計(jì)數(shù)功能。使能端en高電平有效計(jì)數(shù)器開始計(jì)數(shù),高電平停止計(jì)數(shù),清零端CLR高電平清零低電平正常計(jì)數(shù)。十六進(jìn)制可逆計(jì)數(shù)器:在這個部分中要實(shí)現(xiàn)帶使能輸入、同步清0的增1十六進(jìn)制的可逆計(jì)數(shù)器計(jì)數(shù)功能。計(jì)數(shù)部分分為計(jì)數(shù)的個位和十位,使能端en高電平有效計(jì)數(shù)器開始計(jì)數(shù),低電平停

5、止計(jì)數(shù),清零端rst高電平清零低電平計(jì)數(shù),可逆計(jì)數(shù)器的控制端plus_sub低電平實(shí)現(xiàn)加法計(jì)數(shù)器的功能,高電平實(shí)現(xiàn)減法計(jì)數(shù)器的功能。分時掃描及譯碼部分:在這個部分需設(shè)計(jì)一個共陰7段數(shù)碼管控制接口,在時鐘信號的控制下,分時選擇數(shù)碼管顯示相應(yīng)計(jì)數(shù)器的計(jì)數(shù)脈沖,使7位數(shù)碼管動態(tài)刷新顯示4個計(jì)數(shù)器的計(jì)數(shù)結(jié)果,并將送來的計(jì)數(shù)器的計(jì)算值轉(zhuǎn)換為相應(yīng)的段碼在數(shù)碼管上顯示計(jì)數(shù)脈沖的個數(shù)。頂層文件:在這一部分確定上述幾個部分中相應(yīng)輸入輸出端口的連接關(guān)系。四、模塊說明計(jì)數(shù)器及數(shù)碼顯示的設(shè)計(jì)共化分為3個模塊:計(jì)數(shù)器,掃描電路(seltime),譯碼電路(deled)。下面具體分析各個模塊的原理、內(nèi)容和功能。1.計(jì)數(shù)器

6、(counter60)能夠?qū)崿F(xiàn)60進(jìn)制循環(huán)計(jì)數(shù),帶有清零端clr ,受時鐘上升沿信號控制,其文本語言(文件名:count60er.vhd)為底層文本,圖1為計(jì)數(shù)器的仿真波形圖。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter60 isport(en,clr,clk:in std_logic; ql,qh:buffer std_logic_vector(3 downto 0);end counter60;architecture behave of counter60 i

7、sbeginprocess(en,clr,clk)beginif(en='1')thenif(clk'event and clk='1')thenif(clr='1')then ql<=(others=>'0'); qh<=(others=>'0'); elsif(ql=9)then if(qh=5)then qh<="0000" ql<="0000" else qh<=qh+1; ql<="0000"

8、; end if; else ql<=ql+1; end if; end if; end if; end process; end behave;圖1. 六十進(jìn)制秒計(jì)數(shù)器的仿真波形2.計(jì)數(shù)器(counter16)能夠?qū)崿F(xiàn)16進(jìn)制可逆循環(huán)計(jì)數(shù),帶有清零端clr ,受時鐘上升沿信號控制,其文本語言(文件名:count16er.vhd)為底層文本,圖2為計(jì)數(shù)器的仿真波形圖。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter16 isport(en,clr,clk:in s

9、td_logic; plus_sub:in std_logic; ql,qh:buffer std_logic_vector(3 downto 0);end counter16;architecture behave of counter16 isbeginprocess(en,clr,clk,plus_sub)beginif(en='1')thenif(clk'event and clk='1')then if(clr='1')then ql<=(others=>'0'); qh<=(others=&g

10、t;'0'); elsif(plus_sub='1')then if(qh=1 and ql=5)then ql<="0000" qh<="0000" elsif(ql=9)then qh<="0001" ql<="0000" else ql<=ql+1; end if; elsif(plus_sub='0')then if(qh=0 and ql=0)then ql<="0101" qh<="0

11、001" elsif(ql=0)then ql<="1001" qh<="0000" else ql<=ql-1; end if; end if; end if; end if; end process; endbehave; 圖2. 十六進(jìn)制分計(jì)數(shù)器的仿真波形3.計(jì)數(shù)器(counter12)能夠?qū)崿F(xiàn)12進(jìn)制循環(huán)計(jì)數(shù),帶有清零端clr ,受時鐘上升沿信號控制,其文本語言(文件名:count12er.vhd)為底層文本,圖3為計(jì)數(shù)器的仿真波形圖。library ieee;use ieee.std_logic_1164.all;u

12、se ieee.std_logic_unsigned.all;entity counter12 isport(en,clr,clk:in std_logic; ql,qh:buffer std_logic_vector(3 downto 0);end counter12;architecture behave of counter12 isbeginprocess(en,clr,clk)beginif(en='1')thenif(clk'event and clk='1')thenif(clr='1')then ql<=(other

13、s=>'0'); qh<=(others=>'0');elsif(qh=1 and ql=1)then ql<="0000" qh<="0000" elsif(ql=9)then qh<="0001" ql<="0000" else ql<=ql+1; end if; end if; end if; end process; end behave;圖3. 十二進(jìn)制分計(jì)數(shù)器的仿真波形4.計(jì)數(shù)器(counter10)能夠?qū)崿F(xiàn)10進(jìn)制循環(huán)計(jì)數(shù)

14、,帶有清零端clr ,受時鐘上升沿信號控制,其文本語言(文件名:count10er.vhd)為底層文本,圖4為計(jì)數(shù)器的仿真波形圖。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity counter10 isport(en,clr,clk:in std_logic; q:buffer std_logic_vector(3 downto 0);end counter10;architecture behave of counter10 isbeginprocess(clr,clk,en)be

15、ginif(en='1') thenif(clk'event and clk='1')thenif(clr='1')then q<=(others=>'0');elsif(q=9)then q<="0000" else q<=q+1; end if; end if; end if; end process; end behave; 圖4. 十進(jìn)制分計(jì)數(shù)器的仿真波形5.掃面器(seltime)此模塊能夠?qū)崿F(xiàn)分別對前邊的數(shù)值進(jìn)行掃描,有清零段,復(fù)位段,以及上升沿有效,其文本語言(文件

16、名:seltime.vhd)為底層文本,圖5為計(jì)數(shù)器的仿真波形圖。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity seltime isport( clk1,ret:in std_logic; q10,q12l,q12h,q16l,q16h,q60l,q60h:in std_logic_vector(3 downto 0); q:out std_logic_vector(3 downto 0); sel:out std_logi

17、c_vector( 2 downto 0); end seltime; architecture behave of seltime is signal count:std_logic_vector(2 downto 0); begin sel<=count; process(clk1,ret) begin if(ret='1')then count<="001" elsif(clk1'event and clk1='1')then if(count=7)then count<="001" els

18、e count<=count+1; end if; end if; case count is when"001"=>q<=q16h; when"010"=>q<=q16l; when"011"=>q<=q60h; when"100"=>q<=q60l; when"101"=>q<=q12h; when"110"=>q<=q12l; when"111"=>q<=q10

19、; when others=>null; end case; end process; end behave; 圖5. 掃描器的仿真波形6.譯碼器(deled)此模塊能夠?qū)崿F(xiàn)分別對前邊的數(shù)值進(jìn)行掃描,有清零段,復(fù)位段,以及上升沿有效,其文本語言(文件名:deled.vhd)為底層文本,圖6為計(jì)數(shù)器的仿真波形圖。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity deled isport( num:in std_logic_vector(3 downto 0); led:out st

20、d_logic_vector(6 downto 0); end deled;architecture behave of deled is begin led<="1111110"when num="0000"else "0110000"when num="0001"else "1101101"when num="0010"else "1111001"when num="0011"else "0110011"w

21、hen num="0100"else "1011011"when num="0101"else "1011111"when num="0110"else "1110000"when num="0111"else "1111111"when num="1000"else "1111011"when num="1001"else "1110111"when nu

22、m="1010"else "0011111"when num="1011"else "1001110"when num="1100"else "0111101"when num="1101"else "1001111"when num="1110"else "1000111"when num="1111" end behave; 圖6. 譯碼器的仿真波形7.分頻器(div)此模

23、塊能夠?qū)崿F(xiàn)對接受的20mhz的頻率進(jìn)行分頻,分別得到1hz的計(jì)數(shù)頻率,和100hz的掃描頻率。library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity div isport( clk:in std_logic; fclk100:buffer std_logic; fclk1:buffer std_logic); end div;architecture behave of div is signal c0 :std_logic_vector(25 downto 0); signal c1 :s

24、td_logic_vector(25 downto 0); begin process(clk) begin if(clk'event and clk='1')then if(c0=20000000)then c0<="00000000000000000000000000" fclk1<=not fclk1; else c0<=c0+1; end if; end if; if(clk'event and clk='1')then if(c1=200000)then c1<="000000000

25、00000000000000000" fclk100<=not fclk100; else c1<=c1+1; end if; end if; end process; end behave; 8.頂層文件 利用元件例化,對各個模塊進(jìn)行連線。 library ieee;use ieee.std_logic_1164.all;entity over isport(plus_sub, clk,en,clr,ret:in std_logic; sel:out std_logic_vector(2 downto 0); led:out std_logic_vector(6 dow

26、nto 0); end over; architecture behave of over is component div port( clk:in std_logic; fclk:buffer std_logic); end component; component counter10 port(en,clr,clk:in std_logic; q:buffer std_logic_vector(3 downto 0); end component; component counter12 port(en,clr,clk:in std_logic; ql,qh:buffer std_log

27、ic_vector(3 downto 0); end component; component counter60 port(en,clr,clk:in std_logic; ql,qh:buffer std_logic_vector(3 downto 0); end component; component counter16 port(en,clr,clk:in std_logic; plus_sub:in std_logic; ql,qh:buffer std_logic_vector(3 downto 0); end component; component seltime port(

28、 clk1,ret:in std_logic; q10,q12l,q12h,q16l,q16h,q60l,q60h:in std_logic_vector(3 downto 0); q:out std_logic_vector(3 downto 0); sel:out std_logic_vector( 2 downto 0); end component; component deled port( num:in std_logic_vector(3 downto 0); led:out std_logic_vector(6 downto 0); end component; signal

29、fcl_k: std_logic; signal q_10:std_logic_vector(3 downto 0); signal q_12l:std_logic_vector(3 downto 0); signal q_12h:std_logic_vector(3 downto 0); signal q_60l:std_logic_vector(3 downto 0); signal q_60h:std_logic_vector(3 downto 0); signal q_16l:std_logic_vector(3 downto 0); signal q_16h:std_logic_vector(3 downto 0); signal q_q:std_logic_vector(3 downto 0); begin u1:counter10 port map(en,clr,fcl_k,q_10); u2:counter12 port map(en,clr,fcl_k,q_12l,q_12h); u3:counter60 port map(en,clr,fcl_k,q_60l,q_60h)

溫馨提示

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

評論

0/150

提交評論