基于FPGA的數(shù)字時(shí)鐘的設(shè)計(jì)1_第1頁
基于FPGA的數(shù)字時(shí)鐘的設(shè)計(jì)1_第2頁
基于FPGA的數(shù)字時(shí)鐘的設(shè)計(jì)1_第3頁
基于FPGA的數(shù)字時(shí)鐘的設(shè)計(jì)1_第4頁
基于FPGA的數(shù)字時(shí)鐘的設(shè)計(jì)1_第5頁
免費(fèi)預(yù)覽已結(jié)束,剩余21頁可下載查看

付費(fèi)下載

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、基于FPGA的數(shù)字時(shí)鐘的設(shè)計(jì)課題:基于FPGA勺數(shù)字時(shí)鐘的設(shè)計(jì)學(xué)院:電氣信息工程學(xué)院專業(yè):測量控制與儀器班級:08測控班姓 名:潘志東學(xué) 號:08314239合作者姓名:顏志林2010年 12 月 12 日綜述近年來隨著數(shù)字技術(shù)的迅速發(fā)展, 各種中、大規(guī)模集成電路在數(shù)字系統(tǒng)、控制系統(tǒng)、信號處理等方面都得到了廣泛的應(yīng)用。這就迫切要求理工科大學(xué)生熟悉與掌握常用中、大規(guī)模集成電路功能及其在實(shí)際中的應(yīng)用方法, 除通過實(shí)驗(yàn)教學(xué)培養(yǎng)數(shù)字電路的基本實(shí)驗(yàn)方法、分析問題與故障檢查方法以及雙蹤示波器等常用儀器使用方法等基本電路的基本實(shí)驗(yàn)技能外, 還必須培養(yǎng)大學(xué)生工程設(shè)計(jì)與組織實(shí)驗(yàn)?zāi)芰?。本次課程設(shè)計(jì)的目的在于培養(yǎng)學(xué)

2、生對基本電路的應(yīng)用與掌握, 使學(xué)生在實(shí)驗(yàn)原理的指導(dǎo)下, 初步具備基本電路的分析與設(shè)計(jì)能力, 并掌握其應(yīng)用方法; 自行擬定實(shí)驗(yàn)步驟, 檢查與排除故障、分析與處理實(shí)驗(yàn)結(jié)果及撰寫實(shí)驗(yàn)報(bào)告的能力。綜合實(shí)驗(yàn)的設(shè)計(jì)目的就是培養(yǎng)學(xué)生初步掌握小型數(shù)字系統(tǒng)的設(shè)計(jì)能力, 包括選擇設(shè)計(jì)方案, 進(jìn)行電路設(shè)計(jì)、安裝、調(diào)試等環(huán)節(jié), 運(yùn)用所學(xué)知識進(jìn)行工程設(shè)計(jì)、提高實(shí)驗(yàn)技能的實(shí)踐。數(shù)字電子鐘就是一種計(jì)時(shí)裝置, 它具有時(shí)、分、秒計(jì)時(shí)功能與顯示時(shí)間功能; 具有整點(diǎn)報(bào)時(shí)功能。本次設(shè)計(jì)我查閱了大量的文獻(xiàn)資料, 學(xué)到了很多關(guān)于數(shù)字電路方面的知識 , 并且更加鞏固與掌握了課堂上所學(xué)的課本知識, 使自己對數(shù)字電子技術(shù)有了更進(jìn)一步的認(rèn)識與了

3、解。1、課題要求1、 1 課程設(shè)計(jì)的性質(zhì)與任務(wù)本課程就是電子與信息類專業(yè)的專業(yè)的專業(yè)基礎(chǔ)必修課 “數(shù)字電路”的配套實(shí)驗(yàn)課程。目的在于培養(yǎng)學(xué)生的理論聯(lián)系實(shí)際,分析與解決問題的能力。通過本課程設(shè)計(jì),使學(xué)生在理論設(shè)計(jì)、計(jì)算機(jī)仿真、指標(biāo)調(diào)測、故障排除等方面得到進(jìn)一步的訓(xùn)練,加強(qiáng)學(xué)生的實(shí)踐能力。學(xué)生通過設(shè)計(jì)、仿真、調(diào)試、撰寫設(shè)計(jì)報(bào)告等過程 ,培養(yǎng)學(xué)生的動手能力與嚴(yán)謹(jǐn)?shù)墓ぷ髯黠L(fēng)。1、 2 課程設(shè)計(jì)的基本技術(shù)要求1)根據(jù)課題要求, 復(fù)習(xí)鞏固數(shù)字電路有關(guān)專業(yè)基礎(chǔ)知識;2)掌握數(shù)字電路的設(shè)計(jì)方法,特別就是熟悉模塊化的設(shè)計(jì)思想;3)掌握QUARTUS-2件的使用方法;4) 熟練掌握EDA 工具的使用,特別就是原理

4、圖輸入,波形仿真,能對仿真波形進(jìn)行分析 ;5)具備EDA技術(shù)基礎(chǔ),能夠熟練使用VHDL言進(jìn)彳T編程,掌握層次化設(shè)計(jì)方法;6) 掌握多功能數(shù)字鐘的工作原理, 學(xué)會不同進(jìn)制計(jì)數(shù)器及時(shí)鐘控制電路的設(shè)計(jì)方法 ;7) 能根據(jù)設(shè)計(jì)要求對設(shè)計(jì)電路進(jìn)行仿真與測試;8)掌握將所設(shè)計(jì)軟件下載到FPGAK片的下載步驟等等。9) 將硬件與軟件連接起來, 調(diào)試電路的功能。1、 3 課程設(shè)計(jì)的功能要求基本功能: 能進(jìn)行正常的時(shí)、分、秒計(jì)時(shí)功能, 分別由 6 個(gè)數(shù)碼管顯示24 小時(shí) ,60 分鐘 ,60 秒鐘的計(jì)數(shù)器顯示。附加功能:1) 能利用硬件部分按鍵實(shí)現(xiàn)“校時(shí)” “校分” “清零”功能 ;2) 能利用蜂鳴器做整點(diǎn)報(bào)時(shí)

5、: 當(dāng)計(jì)時(shí)到達(dá)59 59 時(shí)開始報(bào)時(shí),鳴叫時(shí)間1 秒鐘 ;3) 定時(shí)鬧鈴: 本設(shè)計(jì)中設(shè)置的就是在七點(diǎn)時(shí)進(jìn)行鬧鐘功能, 鳴叫過程中 , 能夠進(jìn)行中斷鬧鈴工作。本人工作: 負(fù)責(zé)軟件的編程與波形的仿真分析。1、 1 設(shè)計(jì)方案1、時(shí)鐘功能,具有顯示時(shí)、分、秒的功能;2、 具有整點(diǎn)報(bào)時(shí)功能,在整點(diǎn)時(shí)使用蜂鳴器進(jìn)行報(bào)時(shí),具有鬧鐘功能,鳴叫過程中 ,具有中斷鬧鈴功能。1、 2 設(shè)計(jì)要點(diǎn)數(shù)字鐘一般就是由振蕩器、分頻器、計(jì)數(shù)器、譯碼器、顯示器等幾部分組成。這些都就是數(shù)字電路中應(yīng)用最廣泛的基本電路,本設(shè)計(jì)分模塊設(shè)計(jì)實(shí)現(xiàn)各部分功能,采用軟件編程控制FPGA芯片內(nèi)部產(chǎn)生振動周期為1s的脈沖。并將信號送入計(jì) 數(shù)器進(jìn)行計(jì)

6、算,并把累加的結(jié)果以“時(shí)”、 “分”、 “秒”的數(shù)字顯示出來。 “秒”的顯示由兩級計(jì)數(shù)器與譯碼器組成的六十進(jìn)制計(jì)數(shù)電路實(shí)現(xiàn)“分”;的顯示電路 “秒”相同,“時(shí)”的顯示由兩級計(jì)數(shù)器與譯碼器組成的二十四進(jìn)制電路來實(shí)現(xiàn)。所有計(jì)時(shí)結(jié)果由六位數(shù)碼管顯示。1、 3工作原理數(shù)字電子鐘由振蕩器、分頻器計(jì)數(shù)器、譯碼顯示、報(bào)時(shí)等電路組成。振蕩器產(chǎn)生穩(wěn)定的高頻脈沖信號, 作為數(shù)字鐘的時(shí)間基準(zhǔn), 然后經(jīng)過分頻器輸出標(biāo)準(zhǔn)秒脈沖。 秒計(jì)數(shù)器滿60 后向分計(jì)數(shù)器進(jìn)位, 分計(jì)數(shù)器滿60 后向小時(shí)計(jì)數(shù)器進(jìn)位, 小時(shí)計(jì)數(shù)器按照“24 翻 1”規(guī)律計(jì)數(shù)。計(jì)滿后各計(jì)數(shù)器清零 , 重新計(jì)數(shù)。計(jì)數(shù)器的輸出分別經(jīng)譯碼器送數(shù)碼管顯示, 計(jì)時(shí)

7、出現(xiàn)誤差時(shí), 可以用校時(shí)電路 “校時(shí)” “校分”“清零” 。秒脈沖可以通過分頻電路得到。通過報(bào)時(shí)設(shè)計(jì)模塊可以實(shí)現(xiàn)整點(diǎn)報(bào)時(shí)及定時(shí)鬧鈴, 譯碼顯示由七段譯碼器完成, 顯示由數(shù)碼管構(gòu)成, 采用的就是動態(tài)顯示方式。數(shù)碼管動態(tài)顯示:動態(tài)掃描電路將計(jì)數(shù)器輸出的8421BG駟轉(zhuǎn)換為數(shù)碼管需要的邏輯狀態(tài), 并且輸出數(shù)碼管的片選信號與為選信號。所謂動態(tài)掃描顯示方式就是在顯示某一位LED顯示塊的數(shù)據(jù)的時(shí)候,讓其它位不顯示,然后再顯示下一位的數(shù)據(jù)。只要保證每一位顯示的時(shí)間間隔不要太大, 利用人眼的視覺暫留的現(xiàn)象 , 就可以造成各位數(shù)據(jù)同時(shí)顯示的假象。一般每一位的顯示時(shí)間為110ms。3、單元電路的設(shè)計(jì),仿真與分析1

8、) ) 分頻模塊(fenpin)1)程序 :library ieee;use ieee 、 std_logic_1164 、 all;entity fenpin isport(clk6:in std_logic;q1000,q5,q1:out std_logic);end fenpin;architecture ccc_arc of fenpin issignal x:std_logic;beginprocess(clk6)variable cnt:integer range 0 to 24999;beginif clk6event and clk6=1 thenif cnt24999 the

9、ncnt:=cnt+1;elsecnt:=0;x=not x;end if;end if;end process;q1000=x;process(x)variable cnt2:integer range 0 to 999;variable y:std_logic;begin if xevent and x=1 thenif cnt2999 thencnt2:=cnt2+1;q1=0;elsecnt2:=0;q1=1;end if;end if;if xevent and x=1 then y:=not y;end if;q5=y;end process;end ccc_arc;2)仿真波形:

10、3)仿真結(jié)果分析:產(chǎn)生用于計(jì)時(shí),掃描輸入,掃描顯示,以及蜂鳴器所需的各個(gè)頻 率的信號。秒模塊(second)1)程序:library ieee;use ieee、std_logic_1164 、all;use ieee、std_logic_unsigned 、all;entity second isport (clk1,en1:in std_logic;qa:out std_logic_vector(3 downto 0);co1:out std_logic;qb:out std_logic_vector(3 downto 0);end second;architecture cc of se

11、cond issignal cout2,cout1:std_logic_vector(3 downto 0);signal mm: std_logic;beginprocess(clk1,en1)beginif en1=1 thencout2=0000;cout1=0000;elsif (clk1event and clk1=1)thenif (cout2=1 and cout1=8) then cout2=cout2;cout1=cout1+1;mm=1;elsif (cout2=1 and cout1=9) then cout2=0000;cout1=0000;mm=0;else if (

12、cout1=9) then cout2=cout2+1;cout1=0000;mm=0;else cout2=cout2;cout1=cout1+1;mm=0;end if;end if;end if;end process;co1=mm;qa=cout2;qb=cout1;end cc;2) 仿真波形:Nlcn Tine SorV電JL9BcllclB colB 0疝B U國w11 0aaEOlR Dq11 DqAB 0q-3B 00 心U 0qb 口B QMiB 0心D 0D 0i11E56.7:爐10. 24 us i2D.43 us:30.T2 us40. 96 us .11 975

13、aJnruuuuTunnu皿則皿JuinwuiRm皿rwinwumr i ill ihiihii ii iiiai it i laia rii i i n i a i:11*F工一3 一 .一犬4 _Jsss_Ls.! ! I ri_=1 三.1f f ! |怛谿魏皺糜悔蹦目虢鈍期J的金的第明鶴解鏘腐盼美淡然nmLFUW1BLLnLrJTT.jl_tm mL_n_o_I-1 L1HMl1111-11.98ru 3Ht0 ps Interval;1U?5 na 7 Pcinlci77.22 us87. 46 heuwLrLmnjuLrLmnRfiwmwnnrmimrLirmmmrmjuuw il

14、 I I I H I I I | I I I I I d ii I I |l I I I d II; II LTLrLTLLu-JT!L 二卡匕饕堰激檄幽如匏8-L TLwruTurmTLniJTLnnirurwrinLrKruTun n_r-L_n_ I I3)仿真結(jié)果分析:該模塊實(shí)際就是一個(gè)六十進(jìn)制計(jì)數(shù)器,而六十秒為一分鐘,故用此模塊可以作為秒部分設(shè)計(jì),通過觀察可知,仿真波形就是正確可行的。 分模塊(minute)1)程序:library ieee;use ieee、std_logic_1164 、all;use ieee、std_logic_unsigned 、all;entity mi

15、nute isport (clk2,en2:in std_logic;qc:out std_logic_vector(3 downto 0);co2:out std_logic;qd:out std_logic_vector(3 downto 0);end minute;architecture bb of minute issignal cout2,cout1:std_logic_vector(3 downto 0);signal cc:std_logic;beginprocess(clk2,en2)beginif en2=1 thenif (clk2event and clk2=1)the

16、nif (cout2=1 and cout1=8) then cout2=cout2;cout1=cout1+1;cc=1;elsif (cout2=1 and cout1=9) then cout2=0000;cout1=0000;cc=0;else if (cout1=9) then cout2=cout2+1;cout1=0000;cc=0;else cout2=cout2;cout1=cout1+1;cc=0;end if;end if;end if;end if;end process;co2=cc;qc=cout2;qd=cout1;end bb2) 仿真波形:IT4me*1 te

17、 4t11第mclk源回抻M 國印 Tirr舊 B 就11375 ns |jj Pjinlr 2238 3 Iriaval 227 u$ $t$rlcO icl J q: qcl qd疝?!?qd: 小幾皿皿門mumMrjuui皿njunn川inn皿川iiuui皿romrjuui7S,57 us88. 81 iie58.09 nsnjwinnjwinnonnwLWLWuwwimmRnmjmwuumji rn3)仿真結(jié)果分析:此模塊實(shí)際也就是一個(gè)六十進(jìn)制的計(jì)數(shù)器模塊,六十分鐘即為 一個(gè)小時(shí),用此模塊就成功解決了分設(shè)計(jì)模塊這個(gè)難題。 從仿真波形可知,該設(shè)計(jì) 時(shí)正確的。時(shí)模塊(hour)1)程序:l

18、ibrary ieee;use ieee、std_logic_1164 、all;use ieee、std_logic_unsigned 、all;entity hour isport (clk3,en3:in std_logic;qe:out std_logic_vector(3 downto 0);qf:out std_logic_vector(3 downto 0);end hour;architecture aa of hour issignal cout2,cout1:std_logic_vector(3 downto 0);beginprocess(clk3,en3)beginif

19、 en3=1 thenif (clk3event and clk3=1)thenif (cout2=4 and cout1=0) then cout2=0000;cout1=0000;else if (cout1=9) then cout2=cout2+1;cout1=0000;else cout2=cout2;cout1=cout1+1;end if;end if;end if;end if;end process;qe=cout2;qf=cout1;end aa;2) 仿真波形:Mmeifd-n T1L.9B n:*_lk33 0aren33 1. VV 0Qq* 013 03q*?!?

20、0wq*E3 05 0i_ir1+ qJ ofCDS n0q巾3 0Q3 a0琥3 0V4&liae at11. $0 HED 01D 1ElV 023 qfU 03 jie5 12 11 975 ms10 平 us15 ht20. 4B uzJC2. J us31 4 srLrLrLrLrLrLn_rLrLmrLrvLrLrL-LrLrLrLTLrvi_rLrLrIIIIIDSSGRETOQ:口巨匚工3冠叵狂江炬通恒匚嵌3)仿真結(jié)果分析:這就是一個(gè)24計(jì)數(shù)器,用來表示24小時(shí),通過波形可知,程序設(shè)計(jì)正確,正常計(jì)時(shí)就是每次清零后從 00:00:00開始計(jì)時(shí)的,若要從預(yù)置時(shí)間開始,可以通過“校時(shí)

21、” “校分”“清零”三個(gè)按鍵調(diào)整時(shí)間(5)數(shù)碼顯示驅(qū)動模塊1)程序:library ieee;use ieee、std_logic_1164 、all;use ieee、std_logic_unsigned 、all;entity hhh isport(n1,n2,n3,n4,n5,n6:in std_logic_vector(3 downto 0);a:in std_logic_vector(2 downto 0);qqq:out std_logic_vector(3 downto 0);end hhh;architecture dd of hhh isbegin with a select

22、qqq=n1 when 000,n2 when 001,n3 when 010,n4 when 011,n5 when 100,n6 when 101,0000 when others;end dd;2)仿真波形:3)仿真結(jié)果分析:其實(shí)這就是一個(gè)選擇器,從波形圖可以很容易瞧出來。它就是 用來選擇需要顯示的數(shù)字,比如秒的十位,就會選擇n1到譯碼顯示器顯示出來 具備驅(qū)動數(shù)碼管的作用!如.9b ns61. 44 ueEl.中 UEJ 丁 m;ZD . 6 ms11 15 ni=(6)片選模塊(sell)1)程序:library ieee;use ieee、std_logic_1164 、all;us

23、e ieee、std_logic_unsigned 、all;entity ggg isport(m:in std_logic_vector(2 downto 0);b:out std_logic_vector(5 downto 0);end ggg;architecture ee of ggg isbeginwith m select b=100000 when 000,010000 when 001,001000 when 010,000100 when 011,000010 when 100,000001 when 101,000000 when others;end ee;2)仿真波形

24、:Tin血r:11仍修S8 46 ut IntqrvM99.45 ut勺ait;End畫 b e iowoc門口moi foi- fooKXid 片面口血口血而而口口面而0- 值皿:KM 期;3)仿真結(jié)果分析:設(shè)置時(shí)間時(shí)將所需的數(shù)據(jù)傳給顯示模塊,當(dāng)設(shè)置鬧鈴時(shí)將數(shù)據(jù) 傳給鬧鐘與顯示模塊。譯碼顯示模塊(display)1)程序:library ieee;use ieee、std_logic_1164 、all;use ieee、std_logic_unsigned 、all;entity decoder isport(x:in std_logic_vector(3 downto 0);y:out

25、std_logic_vector(6 downto 0);end decoder;architecture one of decoder isbeginwith x select y=1111110 when 0000,0110000 when 0001,1101101 when 0010,1111001 when 0011,0110011 when 0100,1011011 when 0101,1011111 when 0110,1110000 when 0111,1111111 when 1000,1111011 when 1001,0000000 when others;end one;

26、Yalme it.1.上 HE2)仿真波形:U *B (IUIMJEl j b mill)-y6B:-yB:-y41E3B-y2B1-ylHB1TOB0.p5ILL24 usZU.4ti USi11 15 ns【uuluimiuj 工 inn 工 nwu - K uiui -iiu 工Yuur :UU&iu 炯 UMJWXTiBHijrHipu加1期1 工luuqii/iihju】/171115;凹!夏】11!口!1 J3)仿真結(jié)果分析:此模塊就是用來顯示時(shí)間的,采用動態(tài)顯示方式。(8) 報(bào)時(shí)模塊(alart)1) 程序 :library ieee;use ieee 、 std_logic_1

27、164 、 all;entity sst isport(h1,h0,m1,m0,s1,s0:in std_logic_vector(3 downto 0);clk4:in std_logic;q500:out std_logic);end sst;architecture sss of sst isbeginprocess(clk4,m1,m0,s1,s0)beginif (clk4event and clk4=1) thenif (h1=0000 and h0=0111 and m1=0000 and m0=0000)or (m1=0101 and m0=1001 and s1=0101 a

28、nd s0=1001)then q500=1;elseq500=0;end if;end if;end process;end sss;2) 仿真波形:MasterTime Bar;11 975rs*| Pointier:工 12 解 Interval211Start;End:Vai ii a tt3 p=20. 4.840. 36 wiBl. 14. us:S1.92 1=:1 96 n?11.975 ns J1B 0注國hOU 0【口 T X | 1| !廠 舊口 口二 ! 1 ! I I 國hlV 0i i ; i ; i i i i ; i i i n圖ir ol,口X,. Xq一 一

29、 一一 : 0 mlu 0I f 1 d -1 1 V ;:虧,廣:,-, 1 1 ; 1 n1凡=/g S =0V 0【01B111B=11 I1r=prP1=s=111=11t=11t0 0 siIf 01口_X_ s fo:0q500B 01 I 1 a a 1 I 111 a 111 Ei a 111 i i i 11 i i i i h i i i ii|.Iu|.Is|aaa|i|s|i|ijiiji|ikii|1! ! Iiailil ! n ! i ! ! h 11 n3)仿真結(jié)果分析:通過觀察波形可知,當(dāng)時(shí)鐘時(shí)間與整點(diǎn)或鬧鈴預(yù)設(shè)時(shí)間相同時(shí) 給出一個(gè)脈沖信號,使蜂鳴器鳴叫,實(shí)現(xiàn)

30、整點(diǎn)報(bào)時(shí)與定時(shí)鬧鈴功能。(9)六進(jìn)制計(jì)數(shù)器模塊(cnt6)1)程序:library ieee;use ieee、std_logic_1164 、all;use ieee、std_logic_unsigned 、all;entity cnt6 isport (clk5:in std_logic;n:out std_logic_vector(2 downto 0);end cnt6;architecture behav of cnt6 issignal q1:std_logic_vector(2 downto 0);beginprocess(clk5)beginif clk5event and c

31、lk5=1 thenif q15 then q1=q1+1;else q10);end if;end if;end process;n=q1;end behav;2)仿真波形:Mwlci line Ear 11 975jJ * | Pdrta:6905 h Ntcr/alt 09-04 3 Sat:rd;3 j. s2.0, ue40. 56 us1.44 us.61.92 usfi- 113J jruTJnMnununurLLinMLnLLnunujTLrunununjnji:jyrxonrjCTxvmrncoKTmnnrryTXncncninn 丁3)仿真結(jié)果分析:很明顯可以瞧出這就是一個(gè)

32、簡單的六進(jìn)制計(jì)數(shù)器。它與 3-6譯碼器配合作用產(chǎn)生片選信號。(10)兩輸入與模塊(and2a)1)程序:library ieee;use ieee、std_logic_1164 、all;entity anda isport (a1,b1:in std_logic;y:out std_logic);end anda;architecture an of anda is beginy=a1 and b1;end an;2)仿真波形:IM 淞tai Tim日 Bar11 15 ns J| * | Pointer; 8158 g Ihteivat81,575 曰t;End;:3)仿真結(jié)果分析:經(jīng)觀察

33、波形,程序正確。該與門的兩個(gè)輸入端分別為秒模塊與分模塊的進(jìn)位輸出信號,當(dāng)它們均為高電平時(shí),時(shí)模塊使能端即為高電平,時(shí)模塊 工作。(11)兩輸入或模塊(or2a)1)程序:library ieee;use ieee、std_logic_1164 、all;entity or_1 isport (a1,b1:in std_logic;y:out std_logic);end or_1;architecture oo of or_1 isbeginy=a1 or b1;end oo;2)仿真波形:NdsDeiJneBdi; 11 6?5 ns clk,q1=h,q1000=z);u2:second

34、port map(clk1=h,en1=sc,qa=k,qb=l,co1=I);u0:or_1 port map(a1=i,b1=sb,y=a);u3:minute port map(clk2=h,en2=a,qc=e,qd=f,co2=j);u30:anda port map(a1=i,b1=j,y=b);u31:or_1 port map(a1=b,b1=sa,y=c);u4:hour port map(clk3=h,en3=c,qe=u,qf=v);u5:sst port map(h1=u,h0=v,m1=e,m0=f,s1=k,s0=l,clk4=h,q500=q1);u6:hhh p

35、ort map(n1=k,n2=l,n3=e,n4=f,n5=u,n6=v,qqq=t,a=s);u7:ggg port map(b=r,m=s);u8:cnt6 port map(n=s,clk5=z);u9:decoder port map(x=t,y=q0);end architecture main;2)仿真波形:c#B1國叩耳7E叩卬1BD蛇口】E1qp21|B1EB1B 1 呼1qOCBlB1q1BQ田 rB LOCCOZr 0B0rflBr 2B0r 13BDr 4B0rlSBIBDBDB0;1.153:TE 工 X 口 / 庫 X 飛 J; 邛 * 口米 丁 工F;1工1111

36、1111111111111111111111111111nn-irnri-irir-n i ni r i n i n i n i n i ni_r廠nnnn_L , n.i. rut ruL .rj_ n.i.ruL rn門廠irn-i口ri1:n : n i n i n :門; : mi5.24 M 10.4 ns 15.7S ns 20.97 h .21 ns ” M m= 36, T hs 41 94 ma 4T. rrs3)仿真結(jié)果分析:本次試驗(yàn)給出的頻率就是50MHz用QUARTUS-2件把數(shù)字鐘 的全部工作過程記錄下來不容易,故這幅圖只就是其工作的一小部分。將程序 下載到FPGA芯

37、片中,并與硬件部分對應(yīng)連接好,可以驗(yàn)證到我們所預(yù)期的所有 功能,故可知該頂層文件就是正確的,每一個(gè)模塊的功能也都就是正確的,模塊 之間的連接也都就是正確的。在軟件調(diào)試仿真過程中,我們以參考資料上的程序?yàn)槟0澹罁?jù)個(gè)人的需 要添加修改各個(gè)功能模塊,盡管有模板作為參考,仿真過程中還就是出了很多 的問題,例如在做數(shù)碼管動態(tài)顯示中,我們采用了 NPN型9013晶體三極管作為 數(shù)碼管的接地驅(qū)動,這里的片選信號應(yīng)該就是高電平有效 ,我們原程序就是低 電平,經(jīng)過多次的與其她組的學(xué)習(xí)交流中,找到了這個(gè)錯(cuò)誤。解決分頻問題中, 我們也在分頻模塊中做了修改,得到我們所需要的頻率。5、硬件電路設(shè)計(jì)與安裝電路(1)按照

38、電路功能設(shè)計(jì)好硬件部分安裝圖(電路安裝圖詳見末頁圖b);(2)焊接前應(yīng)先排好線,再焊接電路,注意不能飛線,可正反穿線焊接;(3)焊接過程中注意各引腳的功能,不能接錯(cuò);(4)焊接完后需要仔細(xì)檢查后方能通電,電源電壓為5V。所需元器件清單元器件規(guī)格數(shù)量元器件規(guī)格數(shù)量電阻1K Q11開關(guān)單刀雙置4電阻200 a18杜邦線八三極管90136插針50數(shù)碼管共陰6導(dǎo)線八萬能板1蜂鳴器16、硬件電路安裝與調(diào)試1)借助杜邦線將芯片與所焊接硬件電路根據(jù)之前鎖定好的引腳一一連接好,在本設(shè)計(jì)中,各引腳鎖定情況就是:clk:17,q00卜q06分別對應(yīng)芯片引腳:65,63,59,57,53,51,47;r0r5 分別對應(yīng)芯片引腳 :42,40,31,28,26,24,;sa,sb,sc 分別對應(yīng)芯片引腳: 80,86,92; q1 對應(yīng)芯片引腳 : 44,q00 q06 對應(yīng)數(shù)碼管的a,b,c,d,e,f,g;r 指片選信號的六個(gè)輸出 ;sa 、 sb、 sc 對應(yīng)校時(shí)電路的“校時(shí)” “校分

溫馨提示

  • 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論