EDA-數(shù)字秒表設(shè)計(jì)_第1頁(yè)
EDA-數(shù)字秒表設(shè)計(jì)_第2頁(yè)
EDA-數(shù)字秒表設(shè)計(jì)_第3頁(yè)
EDA-數(shù)字秒表設(shè)計(jì)_第4頁(yè)
EDA-數(shù)字秒表設(shè)計(jì)_第5頁(yè)
已閱讀5頁(yè),還剩13頁(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è)計(jì)自動(dòng)化大作業(yè)題 目 數(shù)字秒表設(shè)計(jì) 學(xué) 院 控制科學(xué)與工程學(xué)院班 級(jí) 自動(dòng)化0803 姓 名 學(xué) 號(hào) 二oo一一年五月十二日題 目:數(shù)字秒表的設(shè)計(jì)一、設(shè)計(jì)要求:(1)數(shù)字秒表的計(jì)時(shí)精度是10ms; (2)復(fù)位開關(guān)可以在任何情況下使用,計(jì)時(shí)在計(jì)時(shí)過(guò)程中,只要按一下復(fù)位開關(guān),計(jì)時(shí)器就清零,并做好下次計(jì)時(shí)的準(zhǔn)備; (3)具有啟/停開關(guān),即按一下啟/停開關(guān),啟動(dòng)計(jì)時(shí)器開始計(jì)時(shí),再按一下啟/停開關(guān)則停止計(jì)時(shí)。 (4)數(shù)字秒表的計(jì)時(shí)范圍是0秒59分59.99秒,顯示的最長(zhǎng)時(shí)間為59分59秒二、總體設(shè)計(jì):1、總體結(jié)構(gòu)圖通過(guò)3-8譯碼器控制8位數(shù)碼管的亮滅sel模塊選擇輸入信號(hào)控制選擇模塊輸出的數(shù)據(jù)時(shí)鐘

2、的分秒和毫秒 輸入到choice中通過(guò)數(shù)據(jù)的編碼控制數(shù)碼管的顯示2、各模塊功能1) sel模塊:將掃描信號(hào)輸給選擇(choice)模塊2)選擇模塊:按掃描信號(hào)的指定選擇輸出3)3-8譯碼模塊:通過(guò)sel給的信號(hào)來(lái)控制8位數(shù)碼管位的亮滅4)計(jì)時(shí)模塊:分別對(duì)毫秒,秒,分計(jì)時(shí) 5)顯示模塊:通過(guò)choice模塊的輸出信號(hào)來(lái)控制 三、單元模塊設(shè)計(jì)1、模塊名: sel模塊設(shè)計(jì)(1)模塊功能: clk為掃描時(shí)鐘脈沖,selout端不停的發(fā)出掃描到的信號(hào)(2)端口定義: clk為信號(hào)輸入端 selout2.0為選擇到的信號(hào)輸出(3)vhdl源程序library ieee;use ieee.std_logic

3、_1164.all;use ieee.std_logic_unsigned.all;entity sel is port(clk: in std_logic; selout: out std_logic_vector(2 downto 0);end sel;architecture one of sel is signal count: std_logic_vector(2 downto 0);begin process(clk) begin if clkevent and clk=1 then if (count=101) then count=000; else count=count+1

4、; end if; end if; end process; selout=count; end one;(4)仿真結(jié)果說(shuō)明:來(lái)一個(gè)上升沿,selout的值增1,可以證明模塊是正確的。2、模塊名:選擇模塊設(shè)計(jì)(1)模塊功能: 按掃描信號(hào)的指定選擇輸出(2)端口定義: a,b,c為控制信號(hào); data13.0, data23.0, data33.0, data43.0, data53.0, data63.0分別是毫秒的低位,毫秒的高位,秒的低位,秒的高位,分的低位,分的高位的數(shù)據(jù)值; ch_out3.0為選擇輸出端。(3)vhdl源程序library ieee;use ieee.std_logi

5、c_1164.all;use ieee.std_logic_unsigned.all;entity choice isport(a,b,c:in std_logic;data1,data2,data3,data4,data5,data6:in std_logic_vector(3 downto 0); ch_out:out std_logic_vector( 3 downto 0);end choice;architecture behave of choice issignal ch:std_logic_vector(2 downto 0);beginch(2)=c;ch(1)=b;ch(0

6、)ch_outch_outch_outch_outch_outch_out null;end case; end process;end behave;(4)仿真結(jié)果說(shuō)明:abc的值遞增,ch_out選擇輸出data1,data2,data3,data4,data5,data6的值,證明模塊是正確的3、模塊名: 3-8譯碼模塊設(shè)計(jì)(1)模塊功能: 通過(guò)sel給的信號(hào)來(lái)控制8位數(shù)碼管位的亮滅。(2)端口定義: 輸入端sel2.0值大小來(lái)選擇輸出q的值輸出端q7.0來(lái)控制燈哪位亮(3)vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.

7、std_logic_unsigned.all;entity decode3_8 isport(sel: in std_logic_vector(2 downto 0); q: out std_logic_vector(7 downto 0);end decode3_8;architecture a of decode3_8 isbeginq = 11111110 when sel = 0 else 11111101 when sel = 1 else 11111011 when sel = 2 else 11110111 when sel = 3 else 11101111 when sel

8、= 4 else 11011111 when sel = 5 else 11111111;end a;(4)仿真結(jié)果說(shuō)明:sel的值遞增,q的相應(yīng)位會(huì)亮,證明模塊是正確的。41模塊名: 毫秒計(jì)時(shí)模塊設(shè)計(jì)(1)模塊功能: 對(duì)毫秒位的計(jì)數(shù)(2)端口定義: clk為信號(hào)時(shí)鐘輸入端 reset為復(fù)位端 pause為暫停端 co為進(jìn)位信號(hào)輸出端 qh:毫秒信號(hào)的高位輸出端 ql: 毫秒信號(hào)的低位輸出端(3)vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity m100 isport(c

9、lk:in std_logic; reset:in std_logic; pause:in std_logic; co:out std_logic; qh:buffer std_logic_vector(3 downto 0); ql:buffer std_logic_vector(3 downto 0);end m100;architecture behave of m100 isbeginco=1 when (qh=1001 and ql=1001) else 0; process(clk,reset,pause)begin if(reset=0) thenqh=0000;ql=0000;

10、 elsif(pause=0)then qh=qh; ql=ql; elsif (clkevent and clk=1) thenif (ql=1001) thenql=0000; if (qh=1001) then qh=0000; else qh=qh+1; end if; else ql=ql+1;end if; end if; end process;end behave;(4)仿真結(jié)果說(shuō)明:毫秒為100進(jìn)制,高位和地位都是10進(jìn)制,高位到10會(huì)有進(jìn)位,可以證明模塊的正確性4.2模塊名: 秒計(jì)時(shí)模塊設(shè)計(jì)(1)模塊功能: 對(duì)毫秒位的計(jì)數(shù)(2)端口定義: clk為信號(hào)時(shí)鐘輸入端 reset

11、為復(fù)位端 pause為暫停端 co為進(jìn)位信號(hào)輸出端 qh:毫秒信號(hào)的高位輸出端 ql: 毫秒信號(hào)的低位輸出端(3)vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity m60_sec isport(reset:in std_logic; pause:in std_logic; ci:in std_logic; co:out std_logic; qh:buffer std_logic_vector(3 downto 0); ql:buffer std_logic_vector

12、(3 downto 0);end m60_sec;architecture behave of m60_sec isbegin co=1 when (qh=0101 and ql=1001 and ci=1) else 0;process(reset,pause,ci)begin if(reset=0) thenqh=0000;ql=0000; elsif(pause=0)then qh=qh; ql=ql; elsif (cievent and ci=1) thenif (ql=1001) thenql=0000; if (qh=0101) then qh=0000; else qh=qh+

13、1; end if; else ql=ql+1;end if; end if;end process;end behave;(4)仿真結(jié)果說(shuō)明:秒進(jìn)制為60進(jìn)制,高位到6會(huì)有進(jìn)位,低位為10進(jìn)制,可以證明模塊的正確性4.3模塊名: 分計(jì)時(shí)模塊設(shè)計(jì)(1)模塊功能: 對(duì)毫秒位的計(jì)數(shù)(2)端口定義: clk為信號(hào)時(shí)鐘輸入端 reset為復(fù)位端 pause為暫停端 co為進(jìn)位信號(hào)輸出端 qh:毫秒信號(hào)的高位輸出端 ql: 毫秒信號(hào)的低位輸出端(3)vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.al

14、l;entity m60_min isport(reset:in std_logic; pause:in std_logic; ci:in std_logic; qh:buffer std_logic_vector(3 downto 0); ql:buffer std_logic_vector(3 downto 0);end m60_min;architecture behave of m60_min isbeginprocess(reset,pause,ci)begin if(reset=0) thenqh=0000;ql=0000; elsif(pause=0)then qh=qh; ql

15、=ql; elsif (cievent and ci=1) thenif (ql=1001) thenql=0000; if (qh=0101) then qh=0000; else qh=qh+1; end if; else qlq_showq_showq_showq_showq_showq_showq_showq_showq_showq_shownull;end case;end process;end behave;(4)仿真結(jié)果說(shuō)明:隨著adr的值增加,q_show輸出相應(yīng)的值,數(shù)碼管相應(yīng)的段會(huì)亮,證明模塊是正確的四、數(shù)字秒表整體組裝1、頂層原理圖1.工作情況輸入信號(hào)經(jīng)過(guò)分頻器輸給計(jì)時(shí)

16、模塊,計(jì)時(shí)模塊的各位輸給選擇(choice)模塊,選擇模塊選擇輸出,再經(jīng)過(guò)轉(zhuǎn)碼(bcd_7)模塊控制數(shù)碼管段的亮滅;輸入信號(hào)的另一路經(jīng)過(guò)分頻器給掃描(sel)模塊,sel的輸出信號(hào)一方面給choice模塊提供提供選擇信號(hào),另一方面又給譯碼器(decode3_8)模塊提供譯碼信號(hào)來(lái)控制燈位的亮滅。,pause和reset分別控制暫停和復(fù)位。 2.模塊間的連接關(guān)系:掃描(sel)模塊的輸出端接譯碼(decode3_8)模塊和選擇(choice)模塊,計(jì)時(shí)模塊接選擇(choice)模塊,選擇(choice)模塊將選到的信號(hào)給轉(zhuǎn)碼(bcd_7)模塊控制數(shù)碼管段的亮滅2、仿真結(jié)果說(shuō)明:輸入信號(hào)后,數(shù)碼管會(huì)不停的被掃描,段和位會(huì)選擇亮,可以證明模塊的正確性管腳分配:管腳編號(hào)管腳

溫馨提示

  • 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ù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 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)論