【正文】
。 cout : out std_logic。 U1: count10 port map (reset_tmp,co1,clk0,co2,sec01)。 library ieee。 min10 : in std_logic_vector(2 downto 0)。 end display。 ponent time_choose 36 port ( sel : in std_logic_vector(2 downto 0)。 sec001 : in std_logic_vector(3 downto 0)。 signal sel :std_logic_vector(2 downto 0)。 sec : in std_logic_vector(3 downto 0)。 choose: out std_logic_vector(7 downto 0))。 choose : out std_logic_vector(7 downto 0)。 hr10 : in std_logic_vector(1 downto 0)。 U7: count13 port map (reset_tmp, co7,clk0,co83,hr10)。 begin reset_tmp = sysreset or reset0。 enable : in std_logic。 end ponent。 sec01 : out std_logic_vector(3 downto 0)。 enable : in std_logic。 cout = ?1? when q_tmp =”10” and enable =?1? else ?0?。 begin process(clk) begin if (clk?event and clk =?1?) then if (reset = ?1?) then q_tmp = (others = ?0?)。 use 。 end if。 q : out std_logic_vector(2 downto 0))。 library ieee。 end ponent。 end clk_div。 library ieee。 end if。 reset : in std_logic。 signal sec : std_logic_vector(3 downto 0)。 signal clk1 : std_logic。 sec01 : out std_logic_vector(3 downto 0)。 ponent display port ( sysreset : in std_logic。 27 hr : out std_logic_vector(3 downto 0)。 on_off0 : in std_logic; clk0 : in std_logic。 end ponent。 再次 向 身邊所有的同學、朋友、老師 表示衷心的感謝!最后感謝我的母校安陽工學院這兩年來的全力培養(yǎng)。 在這里首先要感謝趙老師。 剛開始做 的時候 就發(fā)現(xiàn)自己的知識漏洞好多,僅 僅靠專業(yè)課本知識解決 不了 問題的,在著手之前還必須學習相關 的 知識。 end case; end process; end rtl; 對跑表顯示模塊中的四個子電路描述以后,就可以進行跑表顯示模塊的總體功能描述了。 when “0011” = segment = “1001111”。 源代碼 7 library ieee。 end rtl。 architecture rtl of count8 is signal sel_tmp : std_logic_vector(2 downto 0)。 源代碼 6 library ieee。 end rtl。 elsif (enable =?1?) then if (q_tmp =”1001”) then q_tmp = (others = ?0?)。 entity count10 is port ( reset : in std_logic。計時模塊有八個部分組成,它們分別是:小時十位信號、小時各位信號、分十位、分個位、秒十位、秒個位、秒 、秒 信號組成的。 architecture rtl of control is signal strobe : std_logic。控制模塊的功能描述如源代碼 4 所示。 end process。 else count = count +1。 use 。 圖 鍵 入模塊 仿真波形 時鐘分頻模塊 分頻模塊的功能就是講一個整的時鐘信號進行分割,分割成時鐘需要的那種頻率。 on_off_tmp3 = not on_off_tmp2。 entity keyin is port ( reset : in std_logic。 跑表的各個模塊分析 鍵輸入模塊 因為有抖動的緣故,會產(chǎn)生持續(xù)時間長短和不穩(wěn)定的情況。根據(jù)大部分資料的情況,本文采用了最普遍使用的一種消抖同步電路,結構圖如 所示。 entity stopwatch is port ( reset1 : in std_logic。 (3)對跑表進行更換電源操作 是 由系統(tǒng)電源復位電路提供給跑表的電源復位信號來控制跑表的復位操作。 不同點: 方案一主要是單片機來完成跑表,應用范圍略廣,但考慮到單片機本身的特點,不適合結合比較高端的設備。實體中的類屬和端口用來說明所設計的系統(tǒng)或者電路與其它模塊通信的對象。 (2) VHDL 是 通用硬件描述語言。 數(shù)字跑表的 發(fā)展方向將會為以后的航空航天、航空母艦、高鐵磁懸浮列車等科技方面做出更加可靠的計時參考和更加精確的依據(jù),也會為競技競賽、公平競爭等項目比賽提供更加公平公正的參考。所以,制作一個 精確計時的跑表 系統(tǒng)是多么明智的選擇 。 VHDL language。 VHDL 語言 ...................................... 錯誤 !未定義書簽。 作者簽名: 日 期: 目 錄 摘 要 ........................................錯誤 !未定義書簽。 作 者 簽 名: 日 期: 指導教師簽名: 日 期: 使用授權說明 本人完全了解安陽工學院關于收集、保存、使用畢業(yè)設計(論文)的規(guī)定,即:按照學校要求提交畢業(yè)設計(論文)的印刷本和電子版 本;學校有權保存畢業(yè)設計(論文)的印刷本和電子版,并提供目錄檢索與閱覽服務;學校可以采用影印、縮印、數(shù)字化或其它復制手段保存論文;在不以贏利為目的前提下,學??梢怨颊撐牡牟糠只蛉績热荨? MAX+plusⅡ軟件 ................................ 錯誤 !未定義書簽。 關鍵詞: 跑表 ; VHDL 語言; MAX+plus Ⅱ ; FPGA II Digital stopwatch design based on FPGA ABSTRACT: The digital stopwatch for detection requires accurate timing or timing occasions more accurate and more sophisticated environment. In the current petition, scientific research, test environment, stopwatch still plays a very important role. With the development of electronic technology, it has a more broad development space, also has a more extensive application. In this paper, the digital stopwatch were hardware circuit design and software design, and is divided into five modules: key input module, frequency module, control module, timing module and display module. Each module is realized by the stopwatch with reasonable, all functions are acplished with VHDL description language. This experiment mainly by Altera corporation development of EDA tools MAX + PLUS II software as pilation and simulation experiment environment, the main use of epf10k10lc844 device in FPGA experimental box pleted the design of digital stopwatch. Keywords: Stopwatch。例如 :在醫(yī)院中,病體發(fā)作時間頻率值、手術的時間間隔、麻藥的藥效長短等高危手術中,計時就顯得尤為重要;在科研中,火箭的發(fā)射、飛機的起飛、導彈的攻擊、 航母 的運行、空間站的對接等高科技產(chǎn)品中,一秒鐘的誤差就會產(chǎn)生極其嚴重的后果;在競賽中,即使是相差 那也會有一個先后 ,分秒必爭的理念就變得尤為的突出;在工程的測試中;在萬物生長中等等觀測結果的情 況下,這種對時間的精確度要求就變的非常高了,這時對于數(shù)字跑表的研究就變得尤為突出的重要 。 跑表 的發(fā)展趨勢 數(shù)字 跑表 已 經(jīng) 成為 了人類在科技、競賽和檢測 中 的一種十分必要的計時裝置 ,給人們的生活、學習、工作、娛樂帶來極大的方便。 VHDL 語言 的主要優(yōu)點是: (1)有良好的可讀性,容易被讀者理解。 它描述了一個系統(tǒng)或者電路的外觀圖。都能按照設計要求完成有百分秒計時功能的數(shù)字跑表。 6 (2)計時精度 高 于 秒 , 內部定時時鐘信號頻率 采用 1000Hz 的時鐘輸入信號 ,以24h 為 最長 計時周期 。 use 。 頂層結構體的設計 因我們通常用的跑表大部分都由按鍵產(chǎn)生的,但這種操作會產(chǎn)生一定的誤差,因為當需要計時的時候你的手按下的速度,和按鍵接觸的速度以及彈簧反應的速度都直接影響計時的精度,因此設計一款消抖同步電路就顯的十分重要。 (5) 跑表顯示模塊 由了跑表計時模塊的數(shù)據(jù),數(shù)碼管就可以根據(jù)提供的內容,將其展現(xiàn)八個 LED 七段數(shù)碼管顯示上。 use 。 on_off_tmp1 = on_off。 end rtl。 use 。 elsif ( count = “1001”) then count = ( others = ?0?)。 end if。 圖 輸入和輸出信號的關系 根據(jù) 上面 的時序關系,不難寫出控制模塊的 VHDL 描述。 end control。 圖 控制模塊 仿真波形 跑表計時模塊 跑表計時模塊主要就是面對跑表的計時工作,由系統(tǒng)分頻 來支配計時的工作,由控制電路的信號來安排跑表。 use 。 begin process(clk) begin if (clk?event and clk =?1?) then if (reset = ?1?) then q_tmp = (others = ?0?)。