HDL課程設(shè)計(jì)報(bào)告_第1頁
HDL課程設(shè)計(jì)報(bào)告_第2頁
HDL課程設(shè)計(jì)報(bào)告_第3頁
HDL課程設(shè)計(jì)報(bào)告_第4頁
HDL課程設(shè)計(jì)報(bào)告_第5頁
已閱讀5頁,還剩11頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

1、河海大學(xué)計(jì)算機(jī)與信息學(xué)院(常州)HDL課程設(shè)計(jì)報(bào)告題 目:四路搶答器設(shè)計(jì)專 業(yè): 10自動(dòng)化 學(xué) 號(hào): 姓 名: 羅天澤 指導(dǎo)老師: 溪吉 完成時(shí)間: 2013/1/7 課程設(shè)計(jì)(報(bào)告)任務(wù)書(理 工 科 類)、課程設(shè)計(jì)(報(bào)告)題目: 四人搶答器設(shè)計(jì) 、課程設(shè)計(jì)(論文)工作內(nèi)容一、課程設(shè)計(jì)目標(biāo) 1、培養(yǎng)綜合運(yùn)用知識(shí)和獨(dú)立開展實(shí)踐創(chuàng)新的能力;2、更加深入的掌握所學(xué)知識(shí)的應(yīng)用3、熟悉利用verilog來設(shè)計(jì)實(shí)用電路二、研究方法及手段應(yīng)用1、將任務(wù)分成若干模塊,查閱相關(guān)論文資料,分模塊調(diào)試和完成任務(wù);2、通過完成該項(xiàng)任務(wù),總結(jié)所學(xué)知識(shí);三、課程設(shè)計(jì)預(yù)期效果1、完成仿真效果;2、完成實(shí)驗(yàn)環(huán)境搭建;3、

2、實(shí)現(xiàn)四人搶答器功能,有一人搶答成功后蜂鳴器響一秒,然后倒計(jì)時(shí)30秒,時(shí)間結(jié)束通過蜂鳴器響一秒來提示主持人,主持人按下復(fù)位鍵進(jìn)入下一輪搶答。學(xué)生姓名: 羅天澤 專業(yè)年級(jí): 10自動(dòng)化 摘 要為更好的將所學(xué)Verilog HDL語言的理論知識(shí)與實(shí)際應(yīng)用結(jié)合起來,學(xué)會(huì)分析、解決實(shí)際的數(shù)字電路問題,鍛煉獨(dú)立進(jìn)行某些數(shù)字應(yīng)用系統(tǒng)的開發(fā)設(shè)計(jì)工作能力,我們?cè)诶蠋煹闹笇?dǎo)下完成了此次項(xiàng)目設(shè)計(jì)。本設(shè)計(jì)為四人搶答器電路,用Verilog HDL語言編寫軟件實(shí)現(xiàn)四人搶答功能。當(dāng)有人搶答成功后蜂鳴器響1秒提示搶答成功,并在數(shù)碼管上顯示搶答者的序號(hào),此時(shí)其他人再搶答無效,直到主持人按下清除鍵清除搶答信息,方可再次搶答,并

3、開始三十秒倒計(jì)時(shí)。若在30s內(nèi)無人搶答,倒計(jì)時(shí)結(jié)束后,蜂鳴器響1s提示答題時(shí)間已到,再搶答無效,直到主持人再次按鍵清除搶答信息。本設(shè)計(jì)實(shí)現(xiàn)的關(guān)鍵是搶答信息的鎖存,時(shí)鐘和倒計(jì)時(shí)電路及搶答結(jié)果提示,并實(shí)現(xiàn)各個(gè)模塊的可綜合編程。關(guān)鍵詞:四人搶答 數(shù)碼管顯示 蜂鳴器提示 倒計(jì)時(shí)電路 AbstractFor better to study the Verilog HDL language theoretical knowledge and practical application combined, learn to analyze and solve practical problems of di

4、gital circuit, exercise independently some digital application system development and design work ability, we are under the guidance of teachers completed the project design.This design is four responder circuit, use Verilog HDL language to write software to realize four vies to answer first functio

5、n. When someone vies to answer first after the success of the buzzer rang 1 second prompt vies to answer first success, and in the digital tube display vies to answer first the serial number, the others to contest null and void, until the host host press clear key clear vies to answer first informat

6、ion, can again vies to answer first, and began to thirty seconds countdown. If in the 30 s in which no one vies to answer first, after the end of the countdown, buzzer rang 1 s prompt answer time is up, then vies to answer first is invalid, the button again until clear vies to answer first informati

7、on.The design and implementation of the key is vies to answer first information latched, clock and countdown circuit and vies to answer first the results indicate, and realize the modules can be comprehensive programming.Keywords:Four people vies to answer first、LED display、Beeper On、Countdown circu

8、it第一章 系統(tǒng)設(shè)計(jì)一、設(shè)計(jì)目標(biāo)1、實(shí)現(xiàn)四人搶答器功能,有人搶答成功后,其他人再搶答無效;2、通過蜂鳴器響1秒來提示搶答成功,并在數(shù)碼管上顯示搶答者的序號(hào);3、主持人通過按鍵清除搶答信息,并開始30秒的答題倒計(jì)時(shí),當(dāng)?shù)褂?jì)時(shí)結(jié)束時(shí),通過蜂鳴器響1秒來提示回答問題時(shí)間到,此時(shí)可以開始新一輪的搶答二、系統(tǒng)框圖 圖(1) 系統(tǒng)原理框圖三、電路設(shè)計(jì)1、頂層模塊(主函數(shù))module Responder(rst,clk,ina,inb,inc,ind,judge,beep,wei,duan,wei1,duan1); input rst,clk;/Clk 時(shí)鐘為50Mhz PIN_28 200nsinput

9、 ina,inb,inc,ind,judge; output3:0 wei,wei1; output7:0 duan,duan1;output beep; wire clk_1khz,clk_1hz; Divider u1(rst,clk,clk_1khz,clk_1hz); Main u2(clk,ina,inb,inc,ind,judge,clk_1hz,wei,duan); Buzzer u3(rst,clk_1hz,clk_1khz,beep,wei1,duan1); endmodule2、搶答模塊鑒別模塊用以實(shí)現(xiàn)電路中的搶答功能,通過檢測(cè)ina,inb,inc,ind四個(gè)按鍵中最先按

10、下的按鈕并鎖存,保證這以后的搶答無效。程序如下:module Main(clk,ina,inb,inc,ind,judge,clk_1hz,wei,duan); input clk,clk_1hz; input ina,inb,inc,ind,judge;output3:0 wei; output7:0 duan; reg3:0 wei; reg7:0 duan; reg flag; always (posedge clk) begin if(!judge)/主持人復(fù)位 begin flag=0;/搶答限制,未搶答為0 wei=4b1111; duan=8hff; end else begin

11、 if(!ina)/選手1搶答 begin if(!flag) begin wei=4b1101; duan=8hf9; /一號(hào)數(shù)碼管亮 flag=1;/已搶答 end end else if(!inb) begin if(!flag) begin wei=4b1101; duan=8ha4; flag=1; end end else if(!inc) begin if(!flag) begin wei=4b1101; duan=8hb0; flag=1; end end else if(!ind) begin if(!flag) begin wei=4b1101; duan=8h99; fl

12、ag=1; end end end endendmodule 3、時(shí)鐘分頻模塊 此分頻模塊實(shí)現(xiàn)了分頻的功能,將50M的主時(shí)鐘經(jīng)過分頻得到1KHZ和1HZ的時(shí)鐘,程序如下:module Divider(rst,clk,clk_1khz,clk_1hz); input rst,clk;output clk_1khz,clk_1hz; reg clk_1khz,clk_1hz; reg24:0 count1; reg14:0 count2; always (posedge clk or negedge rst)/異步復(fù)位 begin if(!rst) count1 = 0; else if(coun

13、t1=25d)/計(jì)數(shù)滿25M begin clk_1hz = clk_1hz; count1 = 0; end else count1 = count1+25b1; end always (posedge clk or negedge rst) begin if(!rst) count2 = 0; else if(count2=15d25000) begin clk_1khz = clk_1khz; count2 = 0; end else count2 = count2+15b1; end endmodule 4、倒計(jì)時(shí)模塊module Buzzer(rst,clk_1hz,clk_1khz

14、,beep,wei1,duan1); input rst,clk_1hz,clk_1khz; output 3:0 wei1; output 7:0 duan1;output beep; reg 5:0 shi,ge,data; reg 4:0 count; reg 3:0 wei1; reg 7:0 duan1; reg beep; always(posedge clk_1hz or negedge rst) begin if(!rst) count = 0; else if(count = 5d30)/超過30s時(shí)時(shí)間停止 count = count; else count = count

15、+5b1; end always (count)/數(shù)碼管時(shí)間顯示 begin if(count=5b10101)/2130,剩余時(shí)間小于10s begin shi = 5b00000;/十位為0 ge = 5b11110-count;/個(gè)位為30-count end else if(count=5b01011) /1120,剩余時(shí)間小于20s begin shi=5b00001; ge=5b10100-count; end else if(count=5b00001) /110s,剩余時(shí)間小于30s begin shi=5b00010; ge=5b01010-count; end else /

16、0 begin shi=5b00011; ge=5b0; end end always (shi or ge) beginbeep=0; if(shi=0 & ge=0) begin beep=1; endend always (clk_1khz) begin if(!rst) wei1 = 4b0000; else if(clk_1khz) begin wei1=4b0111;/個(gè)位 data=ge; end else begin wei1=4b1011;/十位 data=shi; end end always (data) begin case(data) 6b: duan1=8b1100

17、_0000; 6b: duan1=8b1111_1001; 6b: duan1=8b1010_0100; 6b: duan1=8b1011_0000; 6b: duan1=8b1001_1001; 6b: duan1=8b1001_0010; 6b: duan1=8b1000_0010; 6b: duan1=8b1111_1000; 6b: duan1=8b1000_0000; 6b: duan1=8b1001_0000; default:duan1=8b1111_1111; endcase end endmodule第二章 調(diào)試結(jié)果及討論一、調(diào)試步驟1、打開Quartus II軟件,進(jìn)入Qu

18、artus II集成開發(fā)環(huán)境,新建工程項(xiàng)目文件并在該項(xiàng)目下新建Verilog源程序文件保存。2、配置相應(yīng)的管腳。選擇實(shí)驗(yàn)箱上的對(duì)應(yīng)器件應(yīng)該為Altera公司的EPM1270T144C5N芯片,管腳鎖定方法如表1所示。表1 管腳鎖定PinNode NamePinNode Name64S0143Out665S1161Out766S2117sound67S375clear163out158Out0144Out1162Out2160Out3159Out4156Out53、編譯相應(yīng)的軟件,待通過后再與硬件相連接,實(shí)現(xiàn)硬件仿真。二、調(diào)試的現(xiàn)象 當(dāng)選手按下按鍵時(shí),數(shù)碼管上會(huì)顯示相應(yīng)的選手的號(hào)碼,此時(shí)stop

19、停止信號(hào)輸出高電平,進(jìn)行鎖存,使得其他按鍵無效,直到當(dāng)主持人按下clear鍵進(jìn)行清零操作。三、調(diào)試中的問題及解決 1、剛開始將編譯好的軟件與硬件相連接進(jìn)行仿真時(shí),發(fā)現(xiàn)程序老是下載不進(jìn)去,在當(dāng)正確的編譯了程序之后,引腳也配對(duì)了之后,看了一下add Hardware 發(fā)現(xiàn)里面沒有對(duì)應(yīng)的選項(xiàng),我們反復(fù)連接下載線,同時(shí)更換了3臺(tái)實(shí)驗(yàn)箱之后,發(fā)現(xiàn)程序才能下進(jìn)去了。2、在進(jìn)行硬件仿真時(shí)發(fā)現(xiàn)按下鍵時(shí)數(shù)碼管上不能顯示任何數(shù)字,在仔細(xì)檢查程序后才發(fā)現(xiàn)試驗(yàn)箱上的數(shù)碼管都是共陽的,而我們的程序是按照共陰的來寫的。3、在選手按下按鍵時(shí)蜂鳴器一直響,經(jīng)檢查程序if(warn)Begin sound=1 end;當(dāng)按下鍵時(shí)stop停止信號(hào)觸動(dòng)warn為高電平,使得sound腳輸出一直為高電平,導(dǎo)致蜂鳴器一直響,在經(jīng)思考后在程序中加了延時(shí)有效的解決這一問題。第三章 心得體會(huì)通過兩天的HDL課程設(shè)計(jì),我從自己的設(shè)計(jì)實(shí)踐中學(xué)習(xí)到了很多東西。在課程設(shè)計(jì)之前,我只是在課程學(xué)習(xí)中編寫過幾次作業(yè)程序,因?yàn)槌绦蚨急容^簡單易懂,編寫

溫馨提示

  • 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)論