【正文】
士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 19 頁(yè) 共 56 頁(yè) 表示時(shí)間設(shè)置數(shù)據(jù)顯示的同步信號(hào), time_disp_select 表示顯示動(dòng)態(tài)位選輸出信號(hào)。 output [5:0] time_disp_select。 input TimeSet_EN。 reg clk。b1。b1) begin clk= clk_1khz。 disp_drive = timeset_disp_drive。 339。b010: time_disp_select = 639。b000100。 339。b000000。 output [5:0] disp_select。 input Alarmclock_EN。 input [5:0] date_disp_select。 reg [3:0] Data。b100000: Data = hour1。b001000: Data = minute1。b000010: Data = second1。b0。b100000: Data = hour1。b001000: Data = minute1。b000010: Data = second1。b0。b100000: Data = month1。b001000: Data = day1。b0。 439。b0010: disp_data = 739。b1111001。 439。b0110: disp_data = 739。b1110000。 439。b0。 input EN。b0: F_out = clk1。b0。 圖 329 日期自動(dòng)工作模塊邏輯框圖 圖 330( a)日期自動(dòng)工作模塊仿真波形圖 圖 330( b)日期自動(dòng)工作模塊仿真波形圖 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 29 頁(yè) 共 56 頁(yè) 日期設(shè)置模塊( setdate) 該模塊用于日期設(shè)置,邏輯框圖如圖 331 所示。 日期控制模塊( datecontrol) 該模塊用來(lái)選擇向顯示單元傳輸所要顯示的數(shù)據(jù), Date_Set_EN=1 時(shí)顯示設(shè)置后的日期,否則顯示自動(dòng)模式時(shí)的日期。鬧鐘一直處于工作狀態(tài),當(dāng)前時(shí)間( hour1, hour0, minute1, minute0, second1, second0)與設(shè)置的鬧鐘時(shí)間相比較, 當(dāng)小時(shí)、分鐘、秒鐘的時(shí)間完全相同時(shí),則鬧鈴響,輸出信號(hào) alarm為有效信號(hào) 1。 b 1鬧 鐘 工 作根 據(jù) 不 同 的d i s p _ d r i v e 選 擇不 同 的 位 置 上 的數(shù) 值 加 1d i s p _ d r i v e = 3 39。 b 0鬧 鐘 不 工 作是否S W 1S W 2 圖 334 鬧鐘模塊流程圖 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 31 頁(yè) 共 56 頁(yè) 圖 335 鬧鐘模塊波形仿真圖 該模塊的 VerilogHDL 程序如下: module alarmclock(clk_200hz,EN,SW1,SW2,hour1,hour0,minute1,minute0,second1,second0,alarm,alarmclock_disp_select)。 input [3:0] hour1,hour0,minute1,minute0,second1,second0。 //存放設(shè)置的小時(shí) reg [3:0] minute_set1,minute_set0。amp。amp。amp。b0。b1。b000: begin if(hour_set1 439。b0。amp。 else if((hour_set1 == 439。b0100)) hour_set0 = hour_set0 + 439。 end 339。 else minute_set1 = 439。b1001) minute_set0 = minute_set0 + 439。 end 339。 else second_set1 = 439。b1001) second_set0 = second_set0 + 439。 end default: begin end endcase end //閃爍顯示 always (posedge clk_200hz) begin case(disp_drive) // 339。b001: alarmclock_disp_select = 639。b001000。 // 339。b101: alarmclock_disp_select = 639。 endcase end endmodule 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 36 頁(yè) 共 56 頁(yè) 第四章 總結(jié)與展望 總結(jié) 在此次的數(shù)字 鐘設(shè)計(jì)過(guò)程中,進(jìn)一步地熟悉有關(guān)數(shù)字電路的知識(shí)和具體應(yīng)用。 此次的數(shù)字 鐘設(shè)計(jì)重在于各個(gè)模塊代碼的編寫,雖然能把各個(gè)模塊的代碼編寫出來(lái),但對(duì)于各個(gè)模塊的優(yōu)化設(shè)計(jì)還有一定的缺陷和不足。 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 37 頁(yè) 共 56 頁(yè) 致謝 在論文完成之際,我首先要向指導(dǎo) 老師周春艷 老師表示最真摯的謝意。這篇畢業(yè)論文從開題、資料查找、修改到最后定稿 , 周 老師都給予了諸多幫助, 使我得到不少的提高, 如果沒(méi)有 他 的心血,尚不知以何等糟糕的面目出現(xiàn)。 感謝和我共度四年美好大學(xué)生活的的 所有 同學(xué)。 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 38 頁(yè) 共 56 頁(yè) 參考文獻(xiàn) [ 1]潘松. EDA 技術(shù)實(shí)用教程.北京科學(xué)技術(shù)出版社, 20xx: 22175. [ 2] 譚會(huì)生,張昌凡. EDA 技術(shù)及應(yīng)用. 西安電子科技大學(xué)出版社 , 20xx. [ 3] 張定祥 . EDA 技術(shù) . 西南交通大學(xué)出版社 , 20xx [ 4] 廖日坤 . CPLD/FPGA 嵌入式應(yīng)用開發(fā)技術(shù)白金手冊(cè). 中國(guó)電力出版社, 20xx, 212218. [ 5] (美 )帕爾尼卡、夏宇聞. VERILOG HDL 數(shù)字設(shè)計(jì)與綜合.電子工業(yè)出版社, 20xx. [ 6] 冼進(jìn),戴仙金 , 潘懿萱 . Verilog HDL 數(shù)字控制系統(tǒng)設(shè)計(jì)實(shí)例 . 中國(guó)水利水電出版社,20xx. [ 7] 夏宇聞 . Verilog HDL 數(shù)字系統(tǒng)設(shè)計(jì)教程 . 北京航空航天大學(xué)出版社, 20xx. [ 8] 王金明等 . 數(shù)字系統(tǒng)設(shè)計(jì)與 Verilog HDL. 電子工業(yè) 出版社, 20xx. [ 9] 褚振勇,翁木云 . FPGA 設(shè)計(jì)與應(yīng)用(第二版) . 西安電子科技大學(xué)出版社, 20xx. [ 10]趙曙光,郭萬(wàn)有.可編程邏輯器件原理.西安電子科技大學(xué)出版社, 20xx. [ 11] 劉君,常明,秦娟.基于硬件描述語(yǔ)言( VHDL)的數(shù)字時(shí)鐘設(shè)計(jì).天津理工大學(xué)學(xué)報(bào), 20xx,第 23 卷 第 4 期, 4041. [ 12] 李可. 數(shù)字鐘電路及應(yīng)用 [M]. 北京 :電子工業(yè)出版社 , 1996. 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 39 頁(yè) 共 56 頁(yè) 附錄一 英文原文 FPGA FPGAs (FieldProgrammable Gate, the Array), field programmable gate array, it is PAL, GAL, CPLD and other programmable devices on the basis of the further development of the product. It appears as the field of application specific integrated circuit (ASIC) in a semicustom circuit, which addresses the lack of custom circuits, but also to overe the original programmable devices gate a limited number of shortings. FPGA Introduction Hardware description language (Verilog or VHDL) to plete the circuit design can be simple and layout, fast burning to the FPGA for testing is the proven technology of modern IC design mainstream. These editable ponents can be used to implement some of the basic logic gates (AND, OR, XOR, NOT) or a more plex bination of functions such as decoders or mathematical equations. Inside most of the FPGA, memory devices such as trigger (Flipthe flop) or a more plete memory block also contains editable ponents. System designers can through the editable connections within the FPGA logic blocks connected together like a breadboard was placed on a chip. A factory finished FPGA logic blocks and connections can be changed in accordance with the designer, so the FPGA can plete the required logic function. FPGA Generally speaking, slower than the speed of the ASIC (application specific integrated chip), unable to plete a plex design, but also consume more power. But they also have many advantages such as can be quickly finished, you can modify the program to correct errors and cheaper cost. Editing capability FPGA vendors may also offer cheap. Because these chips are relatively poor editing capabilities, the development of these designs is, in the ordinary FPGA design will transfer to one similar to the ASIC chip. Another method is to prepare 北方民族大學(xué)學(xué)士學(xué)位論文 基于 FPGA的電子鐘的設(shè)計(jì) 第 40 頁(yè) 共 56 頁(yè) the CPLD (plex programmable logic device). As early as the mid1980s, the FPGA has been rooted in the PLD device. CPLDs and