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

下載本文檔

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

文檔簡介

1、淮陰師范學(xué)院物理與電子電氣工程學(xué)院eda課程設(shè)計(jì)報(bào)告學(xué)生姓名學(xué) 號班 級物電0809專 業(yè)電氣工程及其自動(dòng)化題 目四位搶答器指導(dǎo)教師2010年12月eda課程設(shè)計(jì)報(bào)告1、 設(shè)計(jì)指標(biāo)1.搶答器同時(shí)供4名選手或4個(gè)代表隊(duì)比賽,分別用4個(gè)按鈕s0 s3表示。2.設(shè)置一個(gè)系統(tǒng)清除和搶答控制開關(guān)rst,該開關(guān)由主持人控制。3搶答器具有鎖存與顯示功能,即選手按動(dòng)按鈕,鎖存相應(yīng)的編號,并在led和數(shù)碼管上顯示,同時(shí)提示燈亮。選手搶答實(shí)行優(yōu)先鎖存,優(yōu)先搶答選手的編號一直保持到主持人將系統(tǒng)清除為止。4. 搶答器具有定時(shí)搶答功能,且一次搶答的時(shí)間由主持人設(shè)定。5. 如果定時(shí)時(shí)間已到,無人搶答,本次搶答無效,系統(tǒng)報(bào)

2、警并禁止搶答,定時(shí)顯示器上顯示定時(shí)時(shí)間。二、 總體設(shè)計(jì)方案 1、 概述將該任務(wù)分成五個(gè)模塊進(jìn)行設(shè)計(jì),分別為:搶答器鑒別模塊、搶答器計(jì)時(shí)模塊、報(bào)警模塊、分頻模塊、譯碼模塊。2、 搶答器鑒別模塊:在這個(gè)模塊中主要實(shí)現(xiàn)搶答過程中的搶答功能,并能對超前搶答進(jìn)行警告,還能記錄無論是正常搶答還是朝前搶答者的臺號,并且能實(shí)現(xiàn)當(dāng)有一路搶答按鍵按下時(shí),該路搶答信號將其余的搶答信號封鎖的功能。其中有四個(gè)搶答信號s0、s1、s2、s3;搶答狀態(tài)顯示信號states;搶答與警報(bào)時(shí)鐘信號clk2;系統(tǒng)復(fù)位信號rst;警報(bào)信號warm。3、 搶答器計(jì)數(shù)模塊:在這個(gè)模塊中主要實(shí)現(xiàn)搶答過程中的計(jì)時(shí)功能,在有搶答開始后進(jìn)行20

3、秒的倒計(jì)時(shí),并且在20秒倒計(jì)時(shí)后無人搶答顯示超時(shí)并報(bào)警。其中有搶答時(shí)鐘信號clk1;系統(tǒng)復(fù)位信號rst;搶答使能信號start;無人搶答警報(bào)信號warn;計(jì)時(shí)中止信號stop;計(jì)時(shí)十位和個(gè)位信號tb,ta。4、 報(bào)警模塊:在這個(gè)模塊中主要實(shí)現(xiàn)搶答過程中的報(bào)警功能,當(dāng)主持人按下控制鍵,有限時(shí)間內(nèi) 人搶答或是計(jì)數(shù)到時(shí)蜂鳴器開始報(bào)警,計(jì)數(shù)停止信號stop;狀態(tài)輸出信號alm;計(jì)數(shù)脈沖clk。5、 譯碼模塊:在這個(gè)模塊中主要實(shí)現(xiàn)搶答過程中將bcd碼轉(zhuǎn)換成7段的功能。6、 分頻模塊:在這個(gè)模塊中主要實(shí)現(xiàn)搶答過程中所需的時(shí)鐘信號。7、 頂層文件: 在這個(gè)模塊中是對前五個(gè)模塊的綜合編寫的頂層文件。三、設(shè)計(jì)原

4、理分析 各功能模塊電路的設(shè)計(jì) (一)搶答鑒別模塊 1.vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity xuanshou is port(rst,clk2:in std_logic; s0,s1,s2,s3:in std_logic; states:buffer std_logic_vector(3 downto 0); light:buffer std_logic_vector(3 downto 0);warm:out std_logic);end xuanshou ;

5、architecture one of xuanshou issignal st:std_logic_vector(3 downto 0);beginp1:process(s0,rst,s1,s2,s3,clk2) begin if rst=0 then warm=0;st=0000; elsif clk2event and clk2=1 then if (s0=1 or st(0)=1)and not( st(1)=1 or st(2)=1 or st(3)=1 ) then st(0)=1; end if ; if (s1=1 or st(1)=1)and not( st(0)=1 or

6、st(2)=1 or st(3)=1 ) then st(1)=1; end if ; if (s2=1 or st(2)=1)and not( st(0)=1 or st(1)=1 or st(3)=1 ) then st(2)=1; end if ; if (s3=1 or st(3)=1)and not( st(0)=1 or st(1)=1 or st(2)=1 ) then st(3)=1; end if ;warm=st(0) or st(1) or st(2) or st(3);end if ;end process p1;p2:process(states(0),states(

7、1),states(2),states(3),light) begin if (st=0000) then states=0000; elsif (st=0001) then states=0001;elsif (st=0010) then states=0010; elsif (st=0100) then states=0011;elsif (st=1000) then states=0100; end if; light=st;end process p2;end one;(二)計(jì)數(shù)模塊 1. vhdl源程序library ieee;use ieee.std_logic_1164.all;

8、use ieee.std_logic_unsigned.all;entity js is port(clk1,rst,start,stop:in std_logic; ta,tb:buffer std_logic_vector(3 downto 0);end js;architecture one of js issignal co:std_logic;beginp1:process(clk1,rst,start,stop,ta) begin if rst=0 or stop=1 then ta=0000; elsif clk1event and clk1=1 then co=0; if st

9、art=1 then if ta=0000 then ta=1001;co=1; else ta=ta-1; end if; end if; end if;end process p1;p2:process(co,rst,start,stop,tb) begin if rst=0 or stop=1 then tb=0010; elsif coevent and co=1 then if start=1 then if tb=0000 then tb=0011; else tb=tb-1; end if; end if; end if;end process p2;end one ; (三)報(bào)

10、警模塊 1. vhdl源程序library ieee;use ieee.std_logic_1164.all;entity shengyin isport(rst:in std_logic; warn:in std_logic; clk:in std_logic; ta,tb:in integer range 0 to 9; stop:in std_logic; alm:out std_logic ); end; architecture bhv of shengyin is begin process(warn,ta,tb,stop,clk) begin if rst=0then alm=0

11、; elsif stop=1then alm=0; elsif ta=0 and tb=0 then alm=clk; elsif warn=1then alm=clk; else almdoutdoutdoutdoutdoutdoutdoutdoutdoutdoutdout=1111111; end case; end process; end rtl;(五)分頻模塊(用500hz的時(shí)鐘和1hz的計(jì)數(shù)時(shí)鐘) 1vhdl源程序 library ieee; use ieee.std_logic_1164.all; entity div100 is port( clk:in std_logic;

12、clk100:out std_logic ); end div100; architecture art of div100 is signal num: integer range 0 to 99; signal temp:std_logic; begin process(clk) begin if clkevent and clk=1then if num=99 then num=0;temp=not temp; else num=num+1; end if; clk100=temp; end if; end process; end art; 2.div50m:這是一個(gè)50m分頻,將50

13、mhz的信號分為1hz。 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity fenpin is port(clk : in std_logic; clk50 : out std_logic); end fenpin; architecture rtl of fenpin is signal count : std_logic_vector(25 downto 0); begin process(clk) begin if

14、 (clkevent and clk=1) then if(count=10111110101111000010000000) then count =00000000000000000000000000; else count = count +1; end if ; end if ; end process; process(clk) begin if (clkevent and clk=1) then if(count=10111110101111000010000000) then clk50 = 1; else clk50 = 0; end if ; end if ; end process;end;整體電路設(shè)計(jì)四、總結(jié) 通過此課程設(shè)計(jì),讓我更加了解了eda以及更加熟識了quartus ii軟件的使用。其實(shí)在我們multisium實(shí)習(xí)中已經(jīng)做過搶答器,對它的原理也有了初步的了解,知道它的組成模塊,所以只要在已有的知識里去理解如何用quartus ii去實(shí)現(xiàn)它。在設(shè)計(jì)過程中,最容易出錯(cuò)的,就是如何設(shè)計(jì)頂層文件。在我設(shè)計(jì)過程中,第一次我在一個(gè)文件夾中放了幾個(gè)模板的文件夾,另外生成的元件各自放在自己的文件夾里,最后在top文件夾里設(shè)計(jì)原理圖,發(fā)現(xiàn)無法調(diào)用在生成的元件,

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(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

提交評論