【正文】
源。 數(shù)字萬年歷 是一種用數(shù)字電路技術(shù)實(shí)現(xiàn)時(shí)、分、秒計(jì)時(shí)的裝置,與機(jī)械式時(shí)鐘相比具有更高的準(zhǔn)確性和 靈活性 ,且無機(jī)械裝置,具有更長(zhǎng)的使用壽命,因此得到了廣泛的使用 。采用 FPGA設(shè)計(jì)的萬年歷由于成本低,精度高,可靠性好 等優(yōu)點(diǎn),使它有了非常廣闊的使用之處。按照系統(tǒng)設(shè)計(jì)功能的要求 ,設(shè)計(jì)一個(gè)簡(jiǎn)單的數(shù)字萬年歷,顯示年、月、日、時(shí)、分、秒等基本功能。每到新年,人們就會(huì)買來一本新的日歷,配上繪有圖畫的日歷牌掛在墻上,既是裝飾,又能指示年、月、日、星期等信息。同時(shí),該設(shè)計(jì)在精確度上遠(yuǎn)遠(yuǎn)超過鐘表,并且不需要維修,也不用像日歷一樣每天翻頁,極其方便,且能夠添加各種不同功能的要求。 進(jìn)入信息時(shí)代,時(shí)間觀念越來越重,但是老式的鐘表以及日歷等時(shí)間顯示工具已經(jīng)不太適合。電路設(shè)計(jì)模塊中分為幾個(gè)模塊:分頻、控制、時(shí)間顯示調(diào)整、時(shí)分秒 、年月日、顯示控制、譯碼器。各個(gè)模塊完成不同的任務(wù),合在一起就構(gòu)成了萬年歷的系統(tǒng)電路設(shè)計(jì)。如鐘表易壞,需要經(jīng)常維修,日歷需要每天翻頁等。例如:在萬年歷上添加鬧鐘,同時(shí)顯示陰陽歷等。但使用這種紙質(zhì)日歷,必須記得每天按時(shí)撕一張,否則反而會(huì)記錯(cuò)日期,常常有人因?yàn)橥浢刻焖旱舳涘e(cuò)日期,錯(cuò)過重要事情,造成損失。對(duì)此國內(nèi)外許多設(shè)計(jì)人員對(duì)其進(jìn)行了大量的設(shè)計(jì),有用單片機(jī)開發(fā)的,有用 FPGA開發(fā)的。 畢業(yè)設(shè)計(jì)(論文)專用紙 第 頁 2 第 1章 萬年歷的發(fā)展及 FPGA簡(jiǎn)介 萬年歷的發(fā)展 鐘表、日歷等的數(shù)字化大大方便了現(xiàn)代人的生活 , 同時(shí)也大大的擴(kuò)展了鐘表的功能,例如 自動(dòng)報(bào)警 、 打鈴 、 控制其他電子產(chǎn)品 等。數(shù)字萬年歷 從原理上 講是一種典型的數(shù)字電路,其中包括了組合邏輯電路和時(shí)序電路。設(shè)計(jì)者可以對(duì)這些器件進(jìn)行編程來完成各種各樣的任務(wù)。由于 FPGA 的設(shè)計(jì)成本低廉,修改方便,從而催生了的、許多富有創(chuàng)新意識(shí)的公司,這就意味著設(shè)計(jì)人員可以在基于 FPGA 的測(cè)試平臺(tái)上實(shí)現(xiàn)他們的軟件開發(fā),而不需要承擔(dān)數(shù)額巨大的不可重現(xiàn)工程的成本或昂貴的開發(fā)工具。設(shè)計(jì)思路是:用一個(gè)模 10計(jì)數(shù)器,該計(jì)數(shù)器每秒有 10個(gè)脈沖波形,如圖 3所示: 圖 3 模 10計(jì)數(shù)器波形 然后對(duì)該計(jì)數(shù)器每秒計(jì)數(shù)一次,也就是說在一秒內(nèi)有 10個(gè)脈沖,但是只要最后的一個(gè)脈沖,這樣就得到了一個(gè)周期為 1s的脈沖,如圖 4所示: 圖 4 1Hz脈沖 控制模塊( countr) 該模塊的主要功能是對(duì)時(shí)間顯示調(diào)整模塊( mux_4)進(jìn)行控制,并且參與外部控制。 時(shí)間顯示調(diào)整模塊( mux_4) 該模塊的功能是控制顯示器,決定顯示年月日還是時(shí)分秒。當(dāng)秒信號(hào)計(jì)數(shù)到 59時(shí),則要把秒信號(hào)計(jì)為0,同時(shí)進(jìn)位信號(hào) carry1=1。給予初始值: {qfh,qfl}=8’ h00,進(jìn)位信號(hào) carry1=0。最終分信號(hào) qf={qfh,qfl},分進(jìn)位信號(hào) enhour =carry1|jh(jh同秒信號(hào)中的 jf,一樣是外部按鍵信號(hào) )。amp。 date:一年又十二個(gè)月, 而且每個(gè)月的天數(shù)不完全相同,需要對(duì) date做不同的取值判斷。對(duì)于日信號(hào),當(dāng) qr=date時(shí),則令 qr=1, clky=1;否則若日信號(hào)的十位與 date的十位相同且個(gè)位小于 date的個(gè)位,則十位不變,個(gè)位每個(gè)脈沖加 1(這里的秒沖有外界和內(nèi)部?jī)煞N,內(nèi)部脈沖來自時(shí)分秒模塊的輸出 cout);若日信號(hào)十位小于 date的十位,但是個(gè)位相等,則令十位加 1,個(gè)位計(jì)為 0;若 日信號(hào)十位和個(gè)位均小于 date則令日信號(hào)十位不變,個(gè)位加 1。 顯示控制模塊 (mux_16) 該模塊的主要功能是控制是顯示時(shí)分秒還是年月日。 譯碼器( yimaqi) 譯碼器可以將輸入代碼的狀態(tài)翻譯成相應(yīng)的輸出信號(hào),以高、低電平的形式在各自的輸出端口送出,以表示其意愿。 時(shí)分秒模塊仿真 上圖顯示的是時(shí)分秒模塊的運(yùn)行仿真結(jié)果圖,秒針每到 60個(gè)計(jì)數(shù)時(shí)分針才走動(dòng)一次,秒針的走動(dòng)需要由分頻模塊輸出的 1HZ的脈沖來帶動(dòng),秒帶分走,分帶時(shí)走。與傳統(tǒng)紙質(zhì)的萬年歷相比 ,數(shù)字萬年歷得到了越來越廣泛的應(yīng)用。 本次畢業(yè)設(shè)計(jì)完成的主要工作和任務(wù)如下:對(duì)設(shè)計(jì)方案的理論研究,電路原理的設(shè)計(jì)制作,軟件的 編寫和調(diào)試以及畢業(yè)論文的制作。在這次的設(shè)計(jì)過程中主要 是在 Quartus2上使用 Verilog語言完成代碼的編寫與模擬仿真,在設(shè)計(jì)過程中出現(xiàn)了不少的問題,一些問題是因?yàn)樽约旱拇中拇笠?,也有一些問題則是對(duì)相關(guān)知識(shí)的認(rèn)識(shí)不夠徹底。他們的幫助不僅使我順利 解決問題,同時(shí)也使我感受到了溫暖,給了我強(qiáng)大的動(dòng)力,使我和同學(xué)們的關(guān)系更加緊密,使我更加深入明白了團(tuán)結(jié)就是力量。畢業(yè)設(shè)計(jì)是對(duì)大學(xué)以往知識(shí)的綜合運(yùn)用,但是由于學(xué)習(xí)的不夠認(rèn)真,導(dǎo)致這設(shè)計(jì)過程中遇見了很多看似簡(jiǎn)單卻沒法自我完成的問題。 同時(shí),我還要感謝 x老師,在做畢業(yè)設(shè)計(jì)的過程中我深深的感到了在去年和 x老師一起學(xué)習(xí)Quartus2對(duì)于我的畢業(yè)設(shè)計(jì)是多么的有用。 Secondly, a wide cannot exceed 36 biggest bits. Of course, can be more pieces of block RAM cascade up to form larger RAM, now only limited by the number of RAM chip inside block, and no longer subject to two above principle constraint. 5. Rich wiring resources Wiring resources connected all the units inside the FPGA, and the length of the attachment and process determines the signal on the wire transmission speed and driving 畢業(yè)設(shè)計(jì)(論文)專用紙 第 頁 18 ability. The FPGA chip has a wealth of wiring resources inside, according to the process, length, width and distribution in different position and are divided into four kinds of different categories. The first kind is global wiring resources, used for chip inside global clock and global reset/buy a wiring。t need direct selection wiring resources, layout wiring device can automatically according to the input logic s table topology and constraint condition selecting wiring resources to connect each module unit. Essentially, wiring resources use method and the results of the design, direct relationship is closely. 6. Underlying inline function units Inline function module mainly refers to the DLL Locked Loop (PLL), tow vehicle Phase Locked Loop), (soft processing DSP and CPU SoftCore nucleus (). Now more and more rich inline function units, makes the monolithic FPGA became systemlevel design tools, make its have the ability of the software and hardware joint design, gradually transition to the SOC platform. The DLL and with similar functions, PLL can be pleted in high precision, low jitter clock frequency multiplication of and points frequency, and occupies emptiespared to adjust and remove equal function. Xilinx pany produces the chip, Altera DLL used to bee the pany39。t have to face these challenges alone, because in the current leading FPGA pany application engineers every day to solve these problems, and they have put forward some amaze your design work easier design guiding principles and solutions. The I/O signal distribution Can provide the most multifunctional pins, I/O standards, termination scheme and difference right FPGA in signal distribution are the most plex design guiding principles. Although the Altera FPGA device no design guiding principles (because it realize rise pare easy), but the spirit of the FPGA design principles guiding thought is quite plex. But in either case, for I/O pins distribution, there are some signal to keep in mind is mon steps: 1. Use an electronic data list all plans signal allocation, and their important properties, such as I/O standard, voltage, need termination methods and relevant clock. 2. Check with the manufacturer block/regional patibility criteria. 畢業(yè)設(shè)計(jì)(論文)專用紙 第 頁 20 3. Consider using the second spreadsheets formulate FPGA layout to determine what tube feet is a universal, which is dedicated, which support difference signal to the and global and local clock, which need reference voltage. 4. Utilizing the above two spreadsheets information and regional patibility criterion, first distribution restricted the biggest signal to the extent the last distribution on pins, the smallest restricted. For example, you may need to distribution serial bus and the clock signal, because they usually only assigned to some special. At this stage, considering writing a contains only port distribution of HDL files. Then through the use of suppliers of tools or using a text editor manually create a limit files, for I/O standards and increase the SSO necessary support