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

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(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)域中來。eda技術(shù)在電子系統(tǒng)設(shè)計(jì)領(lǐng)域越來越普及,本設(shè)計(jì)主要利用vhdl語言在eda平臺(tái)上設(shè)計(jì)一個(gè)電子數(shù)字鐘,它的計(jì)時(shí)周期為24小時(shí),顯示滿刻度為23時(shí)59分59秒,另外還具有校時(shí)功能和鬧鐘功能??偟某绦?/p>

2、由幾個(gè)各具不同功能的單元模塊程序拼接而成,其中包括分頻程序模塊、時(shí)分秒計(jì)數(shù)和設(shè)置程序模塊、比較器程序模塊、三輸入數(shù)據(jù)選擇器程序模塊、譯碼顯示程序模塊和拼接程序模塊。并且使用quartus  ii軟件進(jìn)行電路波形仿真,下載到eda實(shí)驗(yàn)箱進(jìn)行驗(yàn)證。關(guān)鍵詞:eda vhdl語言 數(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í)

3、工具,數(shù)字鐘的基本組成部分離不開計(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ù)字鐘真正具有使用功能。我們可以通過實(shí)驗(yàn)板上的鍵7和鍵4分別對(duì)時(shí)、分進(jìn)行調(diào)整,因?yàn)槲覀冇玫臅r(shí)鐘信號(hào)均是1hz的,所以每

4、led燈變化一次就來一個(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語言設(shè)計(jì),頂層文件用原理圖的設(shè)計(jì)方法。小時(shí)采用24進(jìn)制,而分鐘均是60進(jìn)制,而60進(jìn)制計(jì)數(shù)器可采用

5、6進(jìn)制和10進(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_logi

6、c_vector(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<="0000

7、000" -若reset為0,則異步清零 elsif(clk 'event and clk='1')then -否則,若clk上升沿到 if(count(3 downto 0)="1001")then -若個(gè)位計(jì)時(shí)恰好到"1001"即9 if(count<16#60#)then -又若count小于16#60#,即60h if(count="1011001")then -又若已到59d enmin_1<='1'count<="0000000"-則置

8、進(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" -count復(fù)0 end if; -end if(count<16#60#) elsif(count<16#60#)then -若個(gè)位計(jì)數(shù)未到"1001"則轉(zhuǎn)此句再判 count<=count+1; -若count<16#60#則count加1

9、 enmin_1<='0'after 100 ns; -沒有發(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 ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity

10、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: std_logic; -enmin_1為59分時(shí)的進(jìn)位信號(hào) begin -enmin_2由clk調(diào)制后的手動(dòng)調(diào)時(shí)脈沖信號(hào)串 daou

11、t<=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(clk'event and clk='1')then -否則,若clk上升沿到 if(count (3 downto 0) ="

12、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的容量

13、 else count<="0000000"-count復(fù)0(有此句,則對(duì)無效狀態(tài)電路可自啟動(dòng)) end if; -end if(count<16#60#) elsif (count <16#60#) then count<=count+1; -若count<16#60#則count加1 enhour_1<='0' after 100 ns; -沒有發(fā)生進(jìn)位 else count<="0000000" -否則,若count不小于16#60# count復(fù)0 end if; -end if(coun

14、t(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_unsigned.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 coun

15、t:std_logic_vector(5 downto 0); begin daout<=count; process(clk,reset) begin if(reset='0')then count<="000000" -若reset=0,則異步清零 elsif(clk'event and clk='1')then -否則,若clk上升沿到 if(count(3 downto 0)="1001")then -若個(gè)位計(jì)時(shí)恰好到"1001"即9 if(count<16#23#)t

16、hen -23進(jìn)制 count<=count+7; -若到23d則 else count<="000000" -復(fù)0 end if; elsif (count<16#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 fun; 4、主程序

17、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); signal co

18、unt1:std_logic_vector(1 downto 0); begin speaker:process(clk) begin -speak<=count1(1); if(clk'event and clk='1')then if(dain="0000000")then speak<=count1(1); if(count1>="10")then count1<="00"-count1為三進(jìn)制加法計(jì)數(shù)器 else count1<=count1+1; end if ; end

19、 if ; end if ; end process speaker; lamper:process(clk) begin if(rising_edge(clk)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 i

20、f; count<=count+1; else count<="00" end if; end if; end process lamper;end fun;四、設(shè)計(jì)儀器、設(shè)備pc機(jī)一臺(tái)、gw48教學(xué)實(shí)驗(yàn)系統(tǒng)一臺(tái)、下載電纜一根(已接好)五、設(shè)計(jì)步驟1、用vhdl程序設(shè)計(jì)步驟1:為本項(xiàng)設(shè)計(jì)建立文件夾任何一項(xiàng)設(shè)計(jì)都是一項(xiàng)工程,都必須首先為此工程建立一個(gè)放置與此工程相關(guān)的所有的文件夾,在此文件夾被eda軟件默認(rèn)為工作庫。一個(gè)設(shè)計(jì)項(xiàng)目可以包含多個(gè)設(shè)計(jì)文件,一般不同的設(shè)計(jì)項(xiàng)目最好放在不同的文件夾中。注意:文件名不能使用中文,且不能帶空格。步驟2:輸入設(shè)計(jì)項(xiàng)目和存盤1) 打

21、開quartus|,單擊“file”菜單,將鼠標(biāo)移到new project wizard 選項(xiàng)單擊則顯示如下圖內(nèi)容,在其中輸入項(xiàng)目名和實(shí)體名,項(xiàng)目名和實(shí)體必須保持一致,最后點(diǎn)擊finish完成(如果文件夾不存在,系統(tǒng)會(huì)提示用戶,確認(rèn)后系統(tǒng)會(huì)自動(dòng)建立該文件夾)。 建立 new project2) 在工具欄中,選擇filenew,選擇原理圖編輯器,在這里我們建立vhdl文件,點(diǎn)擊ok則顯示下圖情況,可以在里面鍵入本實(shí)驗(yàn)程序,如下圖。步驟3:選擇目標(biāo)器件并編譯1)在assign選項(xiàng)的下拉菜單中選擇器件選擇項(xiàng)device,如圖所示。在device family(器件序列欄)中選定目標(biāo)器件對(duì)應(yīng)的序列名,

22、ep1c6對(duì)應(yīng)的是cyclone系列。在availbale devices里選擇ep1c6q240c8,為了選擇器件,有時(shí)應(yīng)將此欄下方標(biāo)有show only fastest speed grades的勾消去,以便顯示出所有速度級(jí)別的器件。完成器件選擇后,按ok鍵。(注意:所選器件必須與目標(biāo)板的器件型號(hào)完全一致。)選擇目標(biāo)板器件型號(hào)3) 輸入完程序以后,單擊水平工具條上的紫色的三角符號(hào)“”,此時(shí)開始編譯程序,程序編譯完畢后,如果出現(xiàn)錯(cuò)誤,需及時(shí)改正。步驟4:時(shí)序仿真1)建立波形文件:選擇file->new,出現(xiàn)圖示屏幕,選擇vector waveform file,單擊ok。建立波形文件2

23、)雙擊name下方的空白處,彈出insert nod or bus對(duì)話框。如圖:選擇添加結(jié)點(diǎn)設(shè)置3)單擊對(duì)話框右側(cè)中間的node finder···。在filter中選擇pins:all,單擊list,而后,單擊<<,即可把所有輸入/輸出都拷貝到右邊的一側(cè),這正是我們希望的各個(gè)引腳。如圖: 選擇結(jié)點(diǎn)4)設(shè)定仿真時(shí)間寬度。選擇edit->end time···選項(xiàng),在end time選擇窗中選擇適當(dāng)?shù)姆抡鏁r(shí)間域,如可選10微秒,以便有足夠長的觀察時(shí)間。5)加上輸入信號(hào)后波形文件存盤。選擇file->save as

24、選項(xiàng),因?yàn)榇姹P窗中的波形文件名是默認(rè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:引腳鎖定選擇assign®pinlocationchip,在跳出的窗口中的node name欄中用鍵盤輸入半加器的端口名,步驟5:引腳鎖定選擇assign®pinlocationchip,在跳出的窗口中的node name欄中用鍵盤輸入半加器的端口名,如a、b等。如果輸入的端口名正確,在右側(cè)的pin type欄將顯示該信號(hào)的屬性。輸入以后如下圖,設(shè)定完成以后再運(yùn)行一次程序。 引腳鎖定步驟6:編程下載1)首先將下載線把計(jì)算機(jī)的打印機(jī)口與目標(biāo)板(如開發(fā)板或?qū)嶒?yàn)板)連接好,打開電源。2)下載方式設(shè)定。選擇max+plusii®programmer選項(xiàng),跳出下圖左側(cè)所示的編程器窗口,然后選擇options®hardware setu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(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)論