EDA3路搶答器課程設計_第1頁
EDA3路搶答器課程設計_第2頁
EDA3路搶答器課程設計_第3頁
EDA3路搶答器課程設計_第4頁
EDA3路搶答器課程設計_第5頁
已閱讀5頁,還剩28頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、目 錄第一章 EDA技術簡介.2 第二章 搶答器的設計要求.2第三章 搶答器的設計分析.3第四章 搶答器的搶答鑒別模塊.44.1搶答鑒別的功能.44.2搶答鑒別模塊的源程序.44.3搶答鑒別模塊的時序仿真圖.7第五章 搶答器的計時模塊.85.1計時模塊的功能.85.2計時模塊的源程序.85.3計時模塊的時序仿真圖.11第六章 搶答器的計分模塊.126.1計分模塊的功能.126.2計分模塊的源程序.126.3計分模塊的時序仿真圖.15第七章 搶答器的譯碼顯示模塊.167.1譯碼顯示模塊的功能.167.2譯碼顯示模塊的源程序.167.3譯碼顯示模塊的時序仿真圖.17第八章 搶答器的其他功能模塊.1

2、88.1其他功能模塊的具體信息.18第九章 搶答器的頂層原理圖設計.199.1頂層原理圖的源文件.209.2頂層設計的時序仿真圖.21第十章 搶答器的硬件測試.2210.1搶答器的引腳綁定.2210.2搶答器的測試結果.22第十一章 課程設計的總結.23 參考文獻.23第一章 EDA技術簡介隨著電子技術和計算機技術的飛速發(fā)展,電子線路的設計工作也日益顯得重要。經過人工設計、制作實驗板、調試再修改的多次循環(huán)才定型的傳統(tǒng)產品設計方法必然被計算機輔助設計所取代,因為這種費時費力又費資源的設計調試方法既增加了產品開發(fā)的成本,又受到實驗工作場地及儀器設備的限制。為了克服上述困難,加拿大Interacti

3、ve Image Technologies公司推出的基于Windows 9598NT操作系統(tǒng)的EDA軟件(Electronics Workbench“電子工作臺”,EWB)。他可以將不同類型的電路組合成混合電路進行仿真。EWB是用在計算機上作為電子線路設計模擬和仿真的新的軟件包,是一個具有很高實用價值的計算機輔助設計工具。目前已在電子工程設計等領域得到了廣泛地應用。與目前流行的電路仿真軟件相比較,EWB具有界面直觀、操作方便等優(yōu)點。他改變了有些電路仿真軟件輸入電路采用文本方式的不便之處,該軟件在創(chuàng)建電路、選用元器件的測試儀器等均可以直接從屏幕圖形中選取,而且測試儀器的圖形與實物外形基本相似,從

4、而大大提高了電子設計工作的效率。此外,從另一角度來看,隨著計算機技術和集成電路技術的發(fā)展,現代電子與電工設計,已經步入了電子設計自動化(EDA)的時代,采用虛擬仿真的手段對電子產品進行前期工作的調試,已成為一種發(fā)展的必然趨勢。通過對實際電子線路的仿真分析,從而提高對電路的分析、設計和創(chuàng)新能力。第二章 搶答器的設計要求 在許多比賽活動中,為了準確、公正、直觀地判斷出第一搶答者,通常設置一臺搶答器,通過數顯、燈光及音響等多種手段指示出第一搶答者。同時,還可以設置計分、犯規(guī)及獎懲計錄等多種功能。本設計的具體要求是: (1) 設計制作一個可容納四組參賽者的數字智力搶答器,每組設置一個搶答按鈕供搶答者使

5、用。(2) 電路具有第一搶答信號的鑒別和鎖存功能。(3) 系統(tǒng)具有計分電路。 (4) 系統(tǒng)具有犯規(guī)電路。 系統(tǒng)設計方案:系統(tǒng)的輸入信號有:各組的搶答按鈕A、B、C、D,系統(tǒng)清零信號CLR,系統(tǒng)時鐘信號CLK,計分復位端RST,加分按鈕端ADD,計時預置控制端LDN,計時使能端EN,計時預置數據調整按鈕可以用如TA、TB表示;系統(tǒng)的輸出信號有:四個組搶答成功與否的指示燈控制信號輸出口可用如LEDA、LEDB、LEDC、LEDD表示,四個組搶答時的計時數碼顯示控制信號若干,搶答成功組別顯示的控制信號若干,各組計分動態(tài)顯示的控制信號若干。整個系統(tǒng)至少有三個主要模塊:搶答鑒別模塊;搶答計時模塊;搶答計

6、分模塊,其他功能模塊(犯規(guī)警告模塊,輸出顯示模塊)。第三章 搶答器的設計分析按照要求,我們可以將整個系統(tǒng)分為四個主要模塊:搶答鑒別模塊;搶答計時模塊;搶答計分模塊;譯碼顯示模塊。對于需顯示的信息,需要增加或外接譯碼器,進行顯示譯碼。考慮到實驗開發(fā)平臺提供的輸出顯示資源的限制,我們將組別顯示和計時顯示的譯碼器內設,而將各組的計分顯示的譯碼器外接。整個系統(tǒng)的大致組成框圖如圖2.1所示。 圖 2.1第四章 搶答器的搶答鑒別模塊4.1搶答鑒別模塊的功能搶答隊伍共分為四組A,B,C,D。當主持人按下START鍵后,四組隊伍才可以按搶答鍵搶答。搶答成功后表示該組的指示燈見亮起,但在主持人未按下START鍵

7、之前,所有的搶答鍵按下均是無效的。當任意一個組搶答成功后,其余的組按搶答鍵無效。搶答鍵為A,B,C,D四個鍵。4.2搶答鑒別模塊的源程序library ieee;use ieee.std_logic_1164.all;entity jb is port(sta:in std_logic; rst:in std_logic; a,b,c,d:in std_logic; a1,b1,c1,d1:out std_logic; states: out std_logic_vector(3 downto 0); start: out std_logic);end entity jb;architectu

8、re art of jb is constant w1: std_logic_vector:=0001; constant w2: std_logic_vector:=0010; constant w3: std_logic_vector:=0100; constant w4: std_logic_vector:=1000; signal sinor: std_logic; signal nsinor: std_logic; signal s_start: std_logic; begin sinor=a or b or c or d; nsinor=not(a or b or c or d)

9、; start=s_start; process(sta,nsinor) is begin if (sta=1) then s_start=1; elsif(nsinorevent and nsinor=1)then s_start=0; end if; end process; process(rst,sta,sinor,nsinor) is begin if(rst=1 or sta=1 or nsinor=1)then a1=0;b1=0;c1=0;d1=0; elsif(sinorevent and sinor=1)then if(s_start=1)then if(a=1)then

10、a1=1;b1=0;c1=0;d1=0; elsif(b=1)then a1=0;b1=1;c1=0;d1=0; elsif(c=1)then a1=0;b1=0;c1=1;d1=0; elsif(d=1)then a1=0;b1=0;c1=0;d1=1; end if; end if; end if; end process; process(sinor) is begin if(rst=1)then states=0000; elsif(sinorevent and sinor=1)then if(s_start=1)then if(a=1)then states=w1; elsif(b=

11、1)then states=w2; elsif(c=1)then states=w3; elsif(d=1)then states=w4; end if; end if; end if; end process;end architecture art; 4.3搶答鑒別模塊的時序仿真圖圖 4.1搶答開始后,A組按下?lián)尨疰I,搶答成功第五章 搶答器的搶答計時模塊 5.1搶答計時模塊的功能主持人宣布搶答成功后,按下EN鍵,選手開始回答,系統(tǒng)開始計時。TA和TB鍵選擇計時的時間(TA:9秒,TB:7秒)5.2 搶答計時模塊的源程序library ieee; use ieee.std_logic_116

12、4.all;use ieee.std_logic_unsigned.all;entity js is port(clr,ldn,en,clk:in std_logic; ta,tb: in std_logic; qa: out std_logic_vector(3 downto 0); qb: out std_logic_vector(3 downto 0);end entity js;architecture art of js is signal da: std_logic_vector(3 downto 0); signal db: std_logic_vector(3 downto 0

13、);begin process(ta,clr) is begin if(clr=1)then da=1001; elsif(taevent and ta=1)then if(ldn=1)then if(da=0000)then da=1001; else da=da-1; end if; end if; end if; end process; process(tb,clr) is begin if(clr=1)then db=0101; elsif(tbevent and tb=1)then if(ldn=1)then if db=0000then db=1001; else db=db-1

14、; end if; end if; end if; end process; process(clk) is variable tmpa: std_logic_vector(3 downto 0); variable tmpb: std_logic_vector(3 downto 0); begin if(clr=1)then tmpa:=0000; tmpb:=0000; elsif clkevent and clk=1 then if en=1then tmpa:=da; tmpb:=db; elsif tmpa=0000then if tmpb=0000then tmpa:=0000;

15、else tmpa:=1001; end if; if tmpb=0000then tmpb:=0000; else tmpb:=tmpb-1; end if; else tmpa:=tmpa-1; end if; end if; qa=tmpa; qb=tmpb; end process;end architecture art; 5.3搶答計時模塊的時序仿真圖 圖 5.1按下EN開始答題,回答問題時,選擇TA模式計時第六章 搶答器的計分模塊 6.1搶答計分模塊的功能主持人確認選手回答正確后,按下ADD鍵為選手加分。 6.2搶答計分模塊的源程序 library ieee;use ieee.s

16、td_logic_1164.all;use ieee.std_logic_unsigned.all;entity jf is port(rst: in std_logic; add: in std_logic; chose: in std_logic_vector(3 downto 0); aa2,aa1,aa0,bb2,bb1,bb0: out std_logic_vector(3 downto 0); cc2,cc1,cc0,dd2,dd1,dd0: out std_logic_vector(3 downto 0);end entity jf;architecture art of jf

17、isbegin process(rst,add,chose) is variable a2,a1:std_logic_vector(3 downto 0); variable b2,b1:std_logic_vector(3 downto 0); variable c2,c1:std_logic_vector(3 downto 0); variable d2,d1:std_logic_vector(3 downto 0); begin if(rst=1)then a2:=0001;a1:=0000; b2:=0001;b1:=0000; c2:=0001;c1:=0000; d2:=0001;

18、d1:=0000; elsif(addevent and add=1)then if chose=0001then if a1=1001then a1:=0000; if a2=1001then a2:=0000; else a2:=a2+1; end if; else a1:=a1+1; end if; elsif chose=0010then if b1=1001then b1:=0000; if b2=1001then b2:=0000; else b2:=b2+1; end if; else b1:=b1+1; end if; elsif chose=0100then if c1=10

19、01then c1:=0000; if c2=1001then c2:=0000; else c2:=c2+1; end if; else c1:=c1+1; end if; elsif chose=1000then if d1=1001then d1:=0000; if d2=1001then d2:=0000; else d2:=d2+1; end if; else d1:=d1+1; end if; end if; end if; aa2=a2;aa1=a1;aa0=0000; bb2=b2;bb1=b1;bb0=0000; cc2=c2;cc1=c1;cc0=0000; dd2=d2;

20、dd1=d1;dd0out7out7out7out7out7out7out7out7out7out7out7=0000000; end case; end process;end architecture; 7.3譯碼顯示模塊的時序仿真圖圖 7.1輸入0001,輸出0000110,在共陰極數碼管上顯示1第八章 搶答器的其他功能模塊其他功能模塊的具體信息犯規(guī)功能模塊:但主持人未按下START鍵時,若有選手按搶答鍵,系統(tǒng)報警。犯規(guī)功能模塊的源程序:library ieee;use ieee.std_logic_1164.all;entity fg is port(a,b,c,d,start:in std_logic; y:out std_logic);end fg;architecture bhv of fg isbegin process(a,b,c,d,start) begin if start=0 then if (a or b or c or d)=1 then y=1; end if; else y=0; end if; end process;end architecture; 犯規(guī)功能模塊的時序仿真圖:圖 8.1B組提前搶答,報警鈴

溫馨提示

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

評論

0/150

提交評論