![VHDL語言數(shù)字時(shí)鐘論文_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-5/29/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed8/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed81.gif)
![VHDL語言數(shù)字時(shí)鐘論文_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-5/29/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed8/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed82.gif)
![VHDL語言數(shù)字時(shí)鐘論文_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-5/29/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed8/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed83.gif)
![VHDL語言數(shù)字時(shí)鐘論文_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-5/29/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed8/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed84.gif)
![VHDL語言數(shù)字時(shí)鐘論文_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-5/29/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed8/e2bb9db5-1cd7-4a76-a1fc-bd9ed39faed85.gif)
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、實(shí)驗(yàn)名稱:基于FPGA的具有鬧鐘和校時(shí)功能的數(shù)字鐘設(shè)計(jì)一、 設(shè)計(jì)內(nèi)容和要求實(shí)驗(yàn)要求使用 VHDL進(jìn)行多功能時(shí)鐘的設(shè)計(jì)具體要求如下:1.能將基本的小時(shí)、分鐘、及秒鐘顯示在數(shù)碼管上。2能利用撥碼開關(guān)進(jìn)行時(shí)間的校正。3.具有整點(diǎn)報(bào)時(shí)和鬧鐘的功能。 二、 FPGA簡介以硬件描述語言(Verilog或VHDL)所完成的電路設(shè)計(jì),可以經(jīng)過簡單的綜合與布局,快速的燒錄至 FPGA 上進(jìn)行測試,是現(xiàn)代 IC設(shè)計(jì)驗(yàn)證的技術(shù)主流。這些可編輯元件可以被用來實(shí)現(xiàn)一些基本的邏輯門電路(比如AND、OR、XOR、NOT)或者更復(fù)雜一些的組合功能比如解碼器或數(shù)學(xué)方程式。在大多數(shù)的FPGA里面,這些可編輯的元件里也包含記憶元
2、件例如觸發(fā)器(Flipflop)或者其他更加完整的記憶塊。FPGA采用了邏輯單元陣列LCA(Logic Cell Array)這樣一個(gè)概念,內(nèi)部包括可配置邏輯模塊CLB(Configurable Logic Block)、輸入輸出模塊IOB(Input Output Block)和內(nèi)部連線(Interconnect)三個(gè)部分。 現(xiàn)場可編程門陣列(FPGA)是可編程器件,與傳統(tǒng)邏輯電路和門陣列(如PAL,GAL及CPLD器件)相比,F(xiàn)PGA具有不同的結(jié)構(gòu)。FPGA利用小型查找表(161RAM)來實(shí)現(xiàn)組合邏輯,每個(gè)查找表連接到一個(gè)D觸發(fā)器的輸入端,觸發(fā)器再來驅(qū)動其他邏輯電路或驅(qū)動I/O,由此構(gòu)成了
3、既可實(shí)現(xiàn)組合邏輯功能又可實(shí)現(xiàn)時(shí)序邏輯功能的基本邏輯單元模塊,這些模塊間利用金屬連線互相連接或連接到I/O模塊。FPGA的邏輯是通過向內(nèi)部靜態(tài)存儲單元加載編程數(shù)據(jù)來實(shí)現(xiàn)的,存儲在存儲器單元中的值決定了邏輯單元的邏輯功能以及各模塊之間或模塊與I/O間的聯(lián)接方式,并最終決定了FPGA所能實(shí)現(xiàn)的功能,F(xiàn)PGA允許無限次的編程。FPGA基本特點(diǎn)采用FPGA設(shè)計(jì)ASIC電路(專用集成電路),用戶不需要投片生產(chǎn),就能得到合用的芯片。FPGA可做其它全定制或半定制ASIC電路的中試樣片。FPGA內(nèi)部有豐富的觸發(fā)器和I/O引腳。FPGA是ASIC電路中設(shè)計(jì)周期最短、開發(fā)費(fèi)用最低、風(fēng)險(xiǎn)最小的器件之一。FPGA采用
4、高速CMOS工藝,功耗低,可以與CMOS、TTL電平兼容??梢哉f,F(xiàn)PGA芯片是小批量系統(tǒng)提高系統(tǒng)集成度、可靠性的最佳選擇之一。FPGA是由存放在片內(nèi)RAM中的程序來設(shè)置其工作狀態(tài)的,因此,工作時(shí)需要對片內(nèi)的RAM進(jìn)行編程。用戶可以根據(jù)不同的配置模式,采用不同的編程方式。加電時(shí),F(xiàn)PGA芯片將EPROM中數(shù)據(jù)讀入片內(nèi)編程RAM中,配置完成后,F(xiàn)PGA進(jìn)入工作狀態(tài)。掉電后,F(xiàn)PGA恢復(fù)成白片,內(nèi)部邏輯關(guān)系消失,因此,F(xiàn)PGA能夠反復(fù)使用。FPGA的編程無須專用的FPGA編程器,只須用通用的EPROM、PROM編程器即可。當(dāng)需要修改FPGA功能時(shí),只需換一片EPROM即可。這樣,同一片F(xiàn)PGA,不
5、同的編程數(shù)據(jù),可以產(chǎn)生不同的電路功能。因此,F(xiàn)PGA的使用非常靈活。如圖2.1所示,邏輯單元(LE)結(jié)構(gòu)主要由一個(gè)4輸入查找表和一個(gè)可編程寄存器構(gòu)成,4輸入查找表用以完成組合邏輯功能,每個(gè)邏輯單元中的可編程寄存器可被配置成為 D、T、JK 和 SR 觸發(fā)器。每個(gè)可編程觸發(fā)器具有數(shù)據(jù)、時(shí)鐘、時(shí)鐘時(shí)能、異步數(shù)據(jù)裝載、清零和異步置位/復(fù)位信號。邏輯單元中的時(shí)鐘、時(shí)鐘使能選擇邏輯可以靈活配置寄存器的時(shí)鐘以及時(shí)鐘使能信號。如果是純組合邏輯應(yīng)用,可將觸發(fā)器旁路,這樣查找表的輸出可以直接作為邏輯單元的輸出。每個(gè)邏輯單元的輸出都可以連接到局部連線、行列、寄存器鏈等布線資源。圖2.1: 查找表(LUT)結(jié)構(gòu)示意
6、圖三、設(shè)計(jì)原理1 工作原理多功能數(shù)字鐘系統(tǒng)共包括三個(gè)模塊,即分頻器模塊、計(jì)數(shù)器模塊和顯示譯碼模塊。多功能數(shù)字鐘的功能可以從整體上分為三類,分別是正常計(jì)時(shí)、時(shí)鐘校對和鬧鐘設(shè)置,所以考慮在系統(tǒng)中設(shè)置一個(gè)模式控制信號kb。模式控制信號對應(yīng)兩個(gè)按鍵,當(dāng)kb=00時(shí),則數(shù)字鐘將在正常計(jì)時(shí);當(dāng)kb=01時(shí),則數(shù)字鐘將在時(shí)間校對;當(dāng)kb=10或kb=11時(shí),則數(shù)字鐘將在鬧鐘設(shè)置;在設(shè)計(jì)中,時(shí)鐘校對和鬧鐘設(shè)置工作模式都需要對時(shí)間進(jìn)行設(shè)置,通常是對小時(shí)和分鐘進(jìn)行設(shè)置,所以需要在系統(tǒng)中設(shè)置一個(gè)時(shí)間設(shè)置信號turn,對應(yīng)一個(gè)按鍵,每按一次相當(dāng)于在小時(shí)設(shè)置和分鐘設(shè)置之間進(jìn)行轉(zhuǎn)換。時(shí)間設(shè)置時(shí),分鐘和小時(shí)計(jì)時(shí)單位之間互相
7、獨(dú)立,不存在進(jìn)位關(guān)系。同時(shí)設(shè)置一個(gè)時(shí)間調(diào)整信號change,每按一次與change對應(yīng)的按鍵,相當(dāng)于對需要調(diào)整的分鐘或小時(shí)的數(shù)字進(jìn)行加1操作。數(shù)字鐘的計(jì)時(shí)輸出信號時(shí)必不可少的,用hourh,hourl,minuteh,minutel,secondh和secondl信號分別表示需要顯示的小時(shí)、分鐘和秒鐘的計(jì)時(shí)結(jié)果,上述計(jì)時(shí)結(jié)果將通過譯碼顯示模塊進(jìn)行譯碼后,連接到外部的七段數(shù)碼顯示器。在帶有鬧鐘設(shè)置功能的數(shù)字鐘中,鬧鐘輸出信號也是必不可少的,到達(dá)到鬧鐘設(shè)置的時(shí)間后,要向外部揚(yáng)聲器發(fā)送一個(gè)鬧鈴信號,設(shè)置voice。另外,我們還提供了鬧鐘鈴聲信號alert,當(dāng)alert為0的時(shí)候,鬧鐘處于靜音狀態(tài)下,
8、即使時(shí)間達(dá)到鬧鐘設(shè)定的時(shí)間也不會發(fā)聲,當(dāng)alert為1的時(shí)候,可以正常鬧鈴,alert信號對應(yīng)一個(gè)撥碼開關(guān)。圖3.1:總體功能圖在設(shè)計(jì)中,其中rst為復(fù)位信號,當(dāng)rst為高電平是復(fù)位,clk為時(shí)鐘信號,en為使能信號,turn為調(diào)時(shí)調(diào)分轉(zhuǎn)換信號,kb為三種模式轉(zhuǎn)換信號,change為手動調(diào)時(shí)或調(diào)分信號,每按一次與change對應(yīng)的按鍵,相當(dāng)于對需要調(diào)整的分鐘或小時(shí)的數(shù)字進(jìn)行加1操作。alert 為鬧鐘設(shè)置信號,alert 為高電平是表示設(shè)置了鬧鐘,voice 為輸出鬧鐘信號。本設(shè)計(jì)中的小時(shí)、分鐘和秒鐘的計(jì)時(shí)結(jié)果采用BCD碼表示方法。采用這種表示方法便于對數(shù)結(jié)果的高位和低位分別進(jìn)行譯碼。2 秒、
9、分、時(shí)模塊原理圖或硬件描述語言程序程序中秒鐘和分鐘是以60進(jìn)制計(jì)數(shù)的,而60進(jìn)制又是由一個(gè)6進(jìn)制和一個(gè)10進(jìn)制組合而成的其代碼如下:6進(jìn)制:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity count6 isport (rst:in std_logic;clk:in std_logic;en:in std_logic;co:out std_logic;output:out std_logic_vector(3 downto 0)
10、;end count6;architecture c6 of count6 issignal qout:std_logic_vector(3 downto 0);beginoutput=qout;process(rst,clk)beginif (rst=1) thenqout=0000;elsif(clkevent and clk=1) thenif(en=1) thenif(qout=0101)thenqout=0000;co=1;elseqout=qout+1;co=0;end if;end if;end if;end process;end c6;10進(jìn)制:library ieee;us
11、e ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity count10 isport (rst:in std_logic;clk:in std_logic;en:in std_logic;co:out std_logic;output:out std_logic_vector(3 downto 0);end count10;architecture c10 of count10 issignal qout:std_logic_vector(3 downto 0);
12、beginoutput=qout;process(rst,clk)beginif (rst=1) thenqout=0000;elsif(clkevent and clk=1) thenif(en=1) thenif(qout=1001)thenqout=0000;co=1;elseqout=qout+1;co=0;end if;end if;end if;end process;end c10;24進(jìn)制:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsign
13、ed.all;entity count24 isport (rst:in std_logic;clk:in std_logic;en:in std_logic;outputh:out std_logic_vector(3 downto 0);outputl:out std_logic_vector(3 downto 0););end count24;architecture c24 of count24 issignal qouth:std_logic_vector(3 downto 0);signal qoutl:std_logic_vector(3 downto 0);beginoutpu
14、th=qouth;outputl=qoutl;process(rst,clk)beginif (rst=1) thenqouth=0000;qoutl=0000;elsif(clkevent and clk=1) thenif(en=1) thenif(qouth=0010and qoutl=0011)thenqouth=0000;qoutl=0000;elsif(qoutl=9)thenqoutl=0000;qouth=qouth+1;elseqoutl=qoutl+1;end if;end if;end if;end process;end c24;60進(jìn)制:library ieee;us
15、e ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity count60 isport (rst:in std_logic;clk:in std_logic;en:in std_logic;co:out std_logic;outputh:out std_logic_vector(3 downto 0);outputl:out std_logic_vector(3 downto 0);end count60;architecture c60 of count60 i
16、ssignal qouth:std_logic_vector(3 downto 0);signal qoutl:std_logic_vector(3 downto 0);beginoutputh=qouth;outputl=qoutl;process(rst,clk)beginif (rst=1) thenqouth=0000;qoutl=0000;elsif(clkevent and clk=1) thenif(en=1) thenif(qouth=0101and qoutl=1001)thenqouth=0000;qoutl=0000;co=1;elsif(qoutl=9)thenqout
17、l=0000;qouth=qouth+1;co=0;elseqoutl=qoutl+1;co=0;end if;end if;end if;end process;end c60;3 系統(tǒng)頂層設(shè)計(jì)及其他功能程序設(shè)計(jì) library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_arith.all;use ieee.std_logic_unsigned.all;entity clock isport (rst:in std_logic;clk:in std_logic;en:in std_logic;turn:in std_logic;k
18、b:in std_logic_vector(1 downto 0);change:in std_logic;stopvoice:in std_logic;voice:out std_logic;hourh:buffer std_logic_vector(3 downto 0);hourl:buffer std_logic_vector(3 downto 0);minuteh:buffer std_logic_vector(3 downto 0);minutel:buffer std_logic_vector(3 downto 0);secondh:buffer std_logic_vector
19、(3 downto 0);secondl:buffer std_logic_vector(3 downto 0);end clock;architecture clockqm of clock issignal change1: std_logic;signal change2: std_logic;signal change3: std_logic;signal hourh1:std_logic_vector(3 downto 0);signal hourl1:std_logic_vector(3 downto 0);signal minuteh1:std_logic_vector(3 do
20、wnto 0);signal minutel1:std_logic_vector(3 downto 0);signal secondh1:std_logic_vector(3 downto 0);signal secondl1:std_logic_vector(3 downto 0);signal cosm: std_logic;signal comh: std_logic;signal clockhourh1:std_logic_vector(3 downto 0);signal clockhourl1:std_logic_vector(3 downto 0);signal clockmin
21、uteh1:std_logic_vector(3 downto 0);signal clockminutel1:std_logic_vector(3 downto 0);component count60 isport (rst:in std_logic;clk:in std_logic;en:in std_logic;co:out std_logic;outputh:out std_logic_vector(3 downto 0);outputl:out std_logic_vector(3 downto 0);end component;component count24 isport (
22、rst:in std_logic;clk:in std_logic;en:in std_logic;outputh:out std_logic_vector(3 downto 0);outputl:out std_logic_vector(3 downto 0);end component;beginhourh=hourh1;hourl=hourl1;minuteh=minuteh1;minutel=minutel1;secondh=secondh1;secondl=secondl1;process(rst,clk,kb,stopvoice)beginif (stopvoice=0and (c
23、lockhourh1=hourh )and (clockhourl1=hourl) and (clockminuteh1=minuteh) and (clockminutel1=minutel)thenvoice=1;end if;if(minuteh=0000and minutel=0000)thenvoice=1;end if;if(kb=00)thenchange1=clk;change2=cosm;change3=comh;elsif(kb=01)thenif(turn=0)thenchange1=clk;change2=change;change3=0;elsechange1=clk
24、;change2=0;change3=change;end if;elseclockhourh1=hourh1;clockhourl1=hourl1;clockminuteh1=minuteh1;clockminutel1=minutel1;if(turn=0)thenchange1=clk;change2=change;change3=0;elsechange1=clk;change2=0;change3rst,clk=change1,en=en, co=cosm,outputh=secondh1,outputl=secondl1);minute60:count60 port map(rst=
溫馨提示
- 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)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度建筑木工環(huán)保建材研發(fā)與應(yīng)用合同
- 2025年度城市更新工程款支付保證委托擔(dān)保合同
- 邵陽2024年湖南邵陽市隆回縣部分事業(yè)單位招聘20人筆試歷年參考題庫附帶答案詳解
- 綏化2024年黑龍江綏化市北林區(qū)事業(yè)單位招聘77人筆試歷年參考題庫附帶答案詳解
- 深圳2024年廣東深圳市環(huán)境科學(xué)研究院招聘(第二批)筆試歷年參考題庫附帶答案詳解
- 棗莊2025年山東棗莊市商務(wù)發(fā)展促進(jìn)中心高層次急需緊缺人才招聘2人筆試歷年參考題庫附帶答案詳解
- 2025年中國復(fù)合材料籃球板市場調(diào)查研究報(bào)告
- 2025年中國全自動鍋爐軟化水裝置市場調(diào)查研究報(bào)告
- 2025年車門總成項(xiàng)目可行性研究報(bào)告
- 2025至2031年中國遙信電源浪涌保護(hù)器行業(yè)投資前景及策略咨詢研究報(bào)告
- 《有機(jī)化學(xué)》課件-第十章 羧酸及其衍生物
- 人教版道德與法治五年級下冊《第一單元 我們一家人》大單元整體教學(xué)設(shè)計(jì)2022課標(biāo)
- 2024-2030年中國茶具行業(yè)市場競爭格局及未來發(fā)展趨勢預(yù)測報(bào)告
- 2024年高考真題-政治(福建卷) 含解析
- 中醫(yī)培訓(xùn)課件:《經(jīng)穴推拿術(shù)》
- 新能源汽車畢業(yè)論文
- 壓瘡的預(yù)防及護(hù)理課件(完整版)
- 專升本-英語高頻詞匯
- 《修辭立其誠》課件+2023-2024學(xué)年統(tǒng)編版高中語文選擇性必修中冊
- excel培訓(xùn)課件教學(xué)
- 2024年浙江省中考社會試卷真題(含標(biāo)準(zhǔn)答案及評分標(biāo)準(zhǔn))
評論
0/150
提交評論