EDA報(bào)告吳廣嶺_第1頁(yè)
EDA報(bào)告吳廣嶺_第2頁(yè)
EDA報(bào)告吳廣嶺_第3頁(yè)
EDA報(bào)告吳廣嶺_第4頁(yè)
EDA報(bào)告吳廣嶺_第5頁(yè)
已閱讀5頁(yè),還剩9頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、合肥學(xué)院eda技術(shù)課程設(shè)計(jì)報(bào)告課程名稱 在系統(tǒng)編程技術(shù) 設(shè)計(jì)題目 數(shù)字鐘的設(shè)計(jì) 班級(jí) 11級(jí)電子(1)班 姓名 吳廣嶺 學(xué)號(hào) 1105011030 日期 2013.12.28 摘要:隨著eda技術(shù)的發(fā)展和應(yīng)用領(lǐng)域的擴(kuò)大,eda技術(shù)在電子信息、通信、自動(dòng)控制及計(jì)算機(jī)應(yīng)用等領(lǐng)域的重要性日益突出。同時(shí),隨著技術(shù)市場(chǎng)與人才市場(chǎng)對(duì)eda技術(shù)需求的不斷提高,產(chǎn)品的市場(chǎng)效率和技術(shù)要求也必然會(huì)反映到教學(xué)和科研領(lǐng)域中來(lái)。eda技術(shù)在電子系統(tǒng)設(shè)計(jì)領(lǐng)域越來(lái)越普及,本設(shè)計(jì)主要利用vhdl語(yǔ)言在eda平臺(tái)上設(shè)計(jì)一個(gè)電子數(shù)字鐘,它的計(jì)時(shí)周期為24小時(shí),顯示滿刻度為23時(shí)59分59秒,另外還具有校時(shí)功能和鬧鐘功能。總的程序

2、由幾個(gè)各具不同功能的單元模塊程序拼接而成,其中包括分頻程序模塊、時(shí)分秒計(jì)數(shù)和設(shè)置程序模塊、比較器程序模塊、三輸入數(shù)據(jù)選擇器程序模塊、譯碼顯示程序模塊和拼接程序模塊。并且使用quartus ii軟件進(jìn)行電路波形仿真,下載到eda實(shí)驗(yàn)箱進(jìn)行驗(yàn)證。關(guān)鍵詞:eda vhdl語(yǔ)言 數(shù)字鐘一、設(shè)計(jì)目的1、熟練地運(yùn)用數(shù)字系統(tǒng)的設(shè)計(jì)方法進(jìn)行數(shù)字系統(tǒng)設(shè)計(jì);2、能進(jìn)行較復(fù)雜的數(shù)字系統(tǒng)設(shè)計(jì);3、按要求設(shè)計(jì)一個(gè)數(shù)字鐘。二、設(shè)計(jì)內(nèi)容1、要求顯示秒、分、時(shí),顯示格式如下:顯示格式2、可清零、可調(diào)時(shí),具有整點(diǎn)報(bào)時(shí)和鬧鐘功能。三、設(shè)計(jì)原理1、數(shù)字鐘的基本工作原理:數(shù)字鐘以其顯示時(shí)間的直觀性、走時(shí)準(zhǔn)確性作為一種計(jì)時(shí)工具,數(shù)字鐘

3、的基本組成部分離不開(kāi)計(jì)數(shù)器,在控制邏輯電路的控制下完成預(yù)定的各項(xiàng)功能。數(shù)字鐘的基本原理方框圖如下:數(shù)字時(shí)鐘控制單元時(shí)調(diào)整分調(diào)整使能端信號(hào)clk信號(hào)時(shí)顯示分顯示秒顯示24進(jìn)制60進(jìn)制60進(jìn)制led顯示整點(diǎn)報(bào)時(shí)花樣顯示數(shù)字鐘實(shí)現(xiàn)原理框圖1)時(shí)鐘計(jì)數(shù):完成時(shí)、分、秒的正確計(jì)時(shí)并且顯示所計(jì)的數(shù)字;其中秒、分采用60進(jìn)制計(jì)數(shù),即從0到59循環(huán)計(jì)數(shù),時(shí)鐘采用24進(jìn)制計(jì)數(shù),即從0到23循環(huán)計(jì)數(shù),數(shù)值顯示在數(shù)碼管上。2)時(shí)間設(shè)置:手動(dòng)調(diào)節(jié)時(shí)、分,可以對(duì)所設(shè)計(jì)的時(shí)鐘任意調(diào)時(shí)間,這樣使數(shù)字鐘真正具有使用功能。我們可以通過(guò)實(shí)驗(yàn)板上的鍵7和鍵4分別對(duì)時(shí)、分進(jìn)行調(diào)整,因?yàn)槲覀冇玫臅r(shí)鐘信號(hào)均是1hz的,所以每led燈變化

4、一次就來(lái)一個(gè)脈沖,即計(jì)數(shù)一次。3)清零功能:reset為復(fù)位鍵,低電平時(shí)實(shí)現(xiàn)清零功能,高電平時(shí)正常計(jì)數(shù)??梢愿鶕?jù)我們自己任意時(shí)間的復(fù)位。4)蜂鳴器在整點(diǎn)時(shí)有報(bào)時(shí)信號(hào)產(chǎn)生,蜂鳴器報(bào)警。產(chǎn)生“滴答.滴答”的報(bào)警聲音。5)led燈在時(shí)鐘顯示時(shí)有花樣顯示信號(hào)產(chǎn)生。即根據(jù)進(jìn)位情況,led不停的閃爍,從而產(chǎn)生“花樣”信號(hào)。根據(jù)總體方框圖及各部分分配的功能可知,本系統(tǒng)可以由秒計(jì)數(shù)器、分鐘計(jì)數(shù)器、小時(shí)計(jì)數(shù)器、整點(diǎn)報(bào)時(shí)、分的調(diào)整以及小時(shí)的調(diào)整和一個(gè)頂層文件構(gòu)成。采用自頂向下的設(shè)計(jì)方法,子模塊利用vhdl語(yǔ)言設(shè)計(jì),頂層文件用原理圖的設(shè)計(jì)方法。小時(shí)采用24進(jìn)制,而分鐘均是60進(jìn)制,而60進(jìn)制計(jì)數(shù)器可采用6進(jìn)制和10

5、進(jìn)制計(jì)數(shù)器構(gòu)成。2、數(shù)字鐘設(shè)計(jì)的電路原理圖 24進(jìn)制數(shù)字鐘的電路圖3、實(shí)驗(yàn)源程序1、秒library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity second isport( clk,reset,setmin:std_logic; enmin:out std_logic; daout:out std_logic_vector(6 downto 0);end entity second;architecture fun of second issignal count:std_logic_vect

6、or(6 downto 0);signal enmin_1,enmin_2:std_logic; -enmin_1為59秒時(shí)的進(jìn)位信號(hào) begin -enmin_2由clk調(diào)制后的手動(dòng)調(diào)分脈沖信號(hào)串 daout=count; enmin_2=(setmin and clk); -setmin為手動(dòng)調(diào)分控制信號(hào),高電平有效 enmin=(enmin_1 or enmin_2); -enmin為向分進(jìn)位信號(hào) process(clk,reset,setmin) begin if(reset=0)then count=0000000; -若reset為0,則異步清零 elsif(clk event a

7、nd clk=1)then -否則,若clk上升沿到 if(count(3 downto 0)=1001)then -若個(gè)位計(jì)時(shí)恰好到1001即9 if(count16#60#)then -又若count小于16#60#,即60h if(count=1011001)then -又若已到59d enmin_1=1;count=0000000;-則置進(jìn)位為1及count復(fù)0 else -未到59d count=count+7; -則加7,而+7=+1+6,即作加6校正 end if; else -若count不小于16#60#(即count等于或大于16#60#) count=0000000; -

8、count復(fù)0 end if; -end if(count16#60#) elsif(count16#60#)then -若個(gè)位計(jì)數(shù)未到1001則轉(zhuǎn)此句再判 count=count+1; -若count16#60#則count加1 enmin_1=0after 100 ns; -沒(méi)有發(fā)生進(jìn)位 else -否則,若count不小于16#60# count=0000000; -則count復(fù)0 end if; -end if(count(3 downto 0)=1001) end if; -end if(reset=0)end process;end fun;2、分library ieee;use

9、 ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity minute is port(clk,clk1,reset,sethour:in std_logic; enhour:out std_logic; daout:out std_logic_vector(6 downto 0);end entity minute ;architecture fun of minute is signal count :std_logic_vector (6 downto 0); signal enhour_1, enhour_2: st

10、d_logic; -enmin_1為59分時(shí)的進(jìn)位信號(hào) begin -enmin_2由clk調(diào)制后的手動(dòng)調(diào)時(shí)脈沖信號(hào)串 daout=count; enhour_2= (sethour and clk1); -sethour為手動(dòng)調(diào)時(shí)控制信號(hào),高電平有效 enhour= (enhour_1 or enhour_2); process(clk,reset,sethour) begin if(reset=0) then -若reset為0,則異步清零 count=0000000; elsif(clkevent and clk=1)then -否則,若clk上升沿到 if(count (3 downt

11、o 0) =1001)then-若個(gè)位計(jì)時(shí)恰好到1001即9 if(count 16#60#) then -又若count小于16#60#,即60 if(count=1011001) then-又若已到59d enhour_1=1; -則置進(jìn)位為1 count=0000000; -count復(fù)0 else count=count+7; -若count未到59d,則加7,即作加6校正 end if; -使前面的16#60#的個(gè)位轉(zhuǎn)變?yōu)?421bcd的容量 else count=0000000;-count復(fù)0(有此句,則對(duì)無(wú)效狀態(tài)電路可自啟動(dòng)) end if; -end if(count16#6

12、0#) elsif (count 16#60#) then count=count+1; -若count16#60#則count加1 enhour_1=0 after 100 ns; -沒(méi)有發(fā)生進(jìn)位 else count=0000000; -否則,若count不小于16#60# count復(fù)0 end if; -end if(count(3 downto 0)=1001) end if; -end if(reset=0) end process;end fun;3、時(shí)library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsi

13、gned.all;entity hour is port(clk,reset:in std_logic; daout:out std_logic_vector(5 downto 0);end entity hour;architecture fun of hour issignal count:std_logic_vector(5 downto 0); begin daout=count; process(clk,reset) begin if(reset=0)then count=000000; -若reset=0,則異步清零 elsif(clkevent and clk=1)then -否

14、則,若clk上升沿到 if(count(3 downto 0)=1001)then -若個(gè)位計(jì)時(shí)恰好到1001即9 if(count16#23#)then -23進(jìn)制 count=count+7; -若到23d則 else count=000000; -復(fù)0 end if; elsif (count16#23#)then -若未到23d,則count進(jìn)1 count=count+1; else -否則清零 count=000000; end if; -end if(count(3 downto 0)=1001) end if; -end if(reset=0) end process;end

15、fun; 4、主程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity alert is port(clk:in std_logic; dain:in std_logic_vector(6 downto 0); speak:out std_logic; lamp:out std_logic_vector(2 downto 0);end alert;architecture fun of alert is signal count:std_logic_vector(1 downto 0);

16、 signal count1:std_logic_vector(1 downto 0); begin speaker:process(clk) begin -speak=count1(1); if(clkevent and clk=1)then if(dain=0000000)then speak=10)then count1=00;-count1為三進(jìn)制加法計(jì)數(shù)器 else count1=count1+1; end if ; end if ; end if ; end process speaker; lamper:process(clk) begin if(rising_edge(clk)

17、then if(count=10)then if(count=00)then lamp=001;-循環(huán)點(diǎn)亮三只燈 elsif(count=01)then lamp=010; elsif(count=10)then lamp=100; end if; count=count+1; else countnew,出現(xiàn)圖示屏幕,選擇vector waveform file,單擊ok。建立波形文件2)雙擊name下方的空白處,彈出insert nod or bus對(duì)話框。如圖:選擇添加結(jié)點(diǎn)設(shè)置3)單擊對(duì)話框右側(cè)中間的node finder。在filter中選擇pins:all,單擊list,而后,單擊e

18、nd time選項(xiàng),在end time選擇窗中選擇適當(dāng)?shù)姆抡鏁r(shí)間域,如可選10微秒,以便有足夠長(zhǎng)的觀察時(shí)間。5)加上輸入信號(hào)后波形文件存盤(pán)。選擇file-save as選項(xiàng),因?yàn)榇姹P(pán)窗中的波形文件名是默認(rèn)的,所以直接存盤(pán)即可。6)仿真器參數(shù)設(shè)置并運(yùn)行。選擇菜單assignment中的settings項(xiàng),在settings窗口下選擇category-simulator settings項(xiàng),單擊ok。然后在processing菜單下選擇startsimulation項(xiàng),直到simulator was successful出現(xiàn),仿真結(jié)束。完成波形如圖所示。步驟5:引腳鎖定選擇assignpinloc

19、ationchip,在跳出的窗口中的node name欄中用鍵盤(pán)輸入半加器的端口名,步驟5:引腳鎖定選擇assignpinlocationchip,在跳出的窗口中的node name欄中用鍵盤(pán)輸入半加器的端口名,如a、b等。如果輸入的端口名正確,在右側(cè)的pin type欄將顯示該信號(hào)的屬性。輸入以后如下圖,設(shè)定完成以后再運(yùn)行一次程序。 引腳鎖定步驟6:編程下載1)首先將下載線把計(jì)算機(jī)的打印機(jī)口與目標(biāo)板(如開(kāi)發(fā)板或?qū)嶒?yàn)板)連接好,打開(kāi)電源。2)下載方式設(shè)定。選擇max+plusiiprogrammer選項(xiàng),跳出下圖左側(cè)所示的編程器窗口,然后選擇optionshardware setup硬件設(shè)置選項(xiàng),其窗口圖中左側(cè)所示。在其下拉菜單中選byteblaster(mv)編程方式。此編程方式對(duì)應(yīng)計(jì)算機(jī)的并行口下載通道,“mv”是混合電壓的意思,主要指對(duì)altera的各類芯核電壓(如5v、3.3v、2.5v與1.8v等)的fpga/cpld都能由此下載。此項(xiàng)設(shè)置只在初次裝軟件后第一

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論