




版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、西安交通大學電子技術實驗報告智力搶答器的設計班級: 姓名:學號:h期:2015 年 6 月 30 h聯(lián)系電話:一、實驗目的電子技術專題實驗是對數(shù)字邏輯電路課程內(nèi)容的全面、系統(tǒng)的總結、鞏 固和提高的一項課程實踐活動。通過智力搶答器的設計與分析實驗,加強與鞏i古i 學對數(shù)字邏輯電路設計的基本方法和技巧的掌握,同時熟悉quartus ii軟件及實 驗室多功能學習機硬件平臺,并掌握數(shù)字邏輯電路測試的基木方法,訓練學牛的 動手能力和思維方法。通過本實驗,一方面提高學生運用數(shù)字邏輯電路解決實際問題的能力,另一 方面使學生更深入的理解所學知識,將理論與實際問題相結合,為以后的計算機 硬件課程的學習奠定良好的
2、基礎。二、系統(tǒng)設計概要智力搶答器的設計1、項目名稱2、系統(tǒng)設計要求在許多比賽活動中,為了準確、公正、直觀地判斷岀第一搶答者,通常設置 一臺搶答器,通過數(shù)顯、燈光及音響等多種手段指示出第一搶答者。同時,還可 以設置計分、犯規(guī)及獎懲計錄等多種功能。木設計的具體要求是:(1) 設計制作一個可容納四組參賽者的數(shù)字智力搶答器,每組設置一個搶答 按鈕供搶答者使用。(2) 電路具有第一搶答信號的鑒別和鎖存功能。(3) 設置計分電路。(4) 設置犯規(guī)電路。三、系統(tǒng)設計方案1、總體概述根據(jù)系統(tǒng)設計要求可知,系統(tǒng)的輸入信號有:各組的搶答按鈕a、b、c、d, 系統(tǒng)清零信號clr,系統(tǒng)時鐘信號clk,計分復位端rst
3、,加分按鈕端add,計時 預置控制端ldn,計時使能端en,計時預置數(shù)據(jù)調(diào)整按鈕ta、tb;系統(tǒng)的輸出 信號有:四個組搶答成功與否的指示燈控制信號輸出口 leda、ledb、ledc、ledd, 四個組搶答吋的計吋數(shù)碼顯示控制信號若干,搶答成功組別顯示的控制信號若 干,各組計分動態(tài)顯示的控制信號若干。根據(jù)以上的分析,我們可將整個系統(tǒng)分為三個主要模塊:搶答鑒別模塊 qdjb;搶答計時模塊jsq;搶答計分模塊jfq。對于需顯示的信息,需增加或外 接譯碼器ymq,進行顯示譯碼。考慮到fpga/cpld的可用接口及一般eda實驗開 發(fā)系統(tǒng)提供的輸岀顯示資源的限制,這里我們將組別顯示和計時顯示的譯碼器內(nèi)
4、設,而將各組的計分顯示的譯碼器外接。2、系統(tǒng)模塊圖計分器3. 系統(tǒng)總體電路圖二 3# 1噸 w oxrs qi lrcctewam * k k k k m sms )mhb:對芒堆 )mm» »owoe«owst® jnir vniiwvmtv9mtvtiiitetii add o-_.;cwi )miuoteot«iie«miieat.;ldn o-xii-, )ui«» mom 04 mowp-lla艸”1i呻 q dout?m1: h廠一、r蒂刁i1)11 t1 三、系統(tǒng)單元模塊電路設計及工作原理k搶答鑒別模
5、塊(1) vhdl源程序library ieee;use ieee.std_logic_1164.all;entity qdjb isport(clr: in std_logic;a,b,c, d:in std_logic;al,bl,cl,di: out std_logic;states: out std_logic_vector(3 downto 0);end entity qdjb;architecture art of qdjb isconstant wl:constant w2:std_logic_vector:=h0001n;std_logic_vector:=',0010
6、m;constant w3:std_logic_vector:=no 100n;constant w4:std_logic_ vector:=u 1000”;beginprocess(clr,a,b,c,d) isbeginif clr三 1' then a1b1 cl<=*0*; d1 v=o;elsif (a二t)and (bo'and c=oand d=o) or(b二tor c=tor d 二 t) thenalv二t; blv二o; clv='0; d1<=,o,;states<=w1;elsif (a=,0,and b='1'
7、;and c=,0,and d=,0,) thena1b1 v二t; c1 v='0; d1 <=*0*; statesv二w2;elsif (a=oand b=0*and c=tand d=o) thenalv二o; blv二o; clv=t; div二o; statesv二w3;elsif (a=,0,and b=,0,and c=,0,and dv) thenalv=o; bl<='0*; clv='0; dl<=r; states v二w4;end if;end process;end architecture art;(2)電路模塊qdjb0
8、 i iclk1a1hen1b1jirstc1 had1 1bringt cstates3.o id s insto/ j.(3)原理說明在搶答鑒別電路設計中,a、b、c、d四組搶答,理論上應該有16種可 能情況,但實際上由于芯片反應速度快到一定程度時,兩組以上同時搶答成 功的可能性非常小,因此我們可設計成只有四種情況,這大大簡化了電路的 設計復雜'性。rst為復位端,將輸出信號復位或停止警報聲。clk1端為警報時鐘信號; 待測信號,即搶答信號a, b, c, d輸入電路中后,通過判斷是哪個信號最先為 t得出搶答成功的組別1,2,3或4組,將組別號輸出到相應端a1,b1,c1,d1,
9、并將組別序號換算為四位二進制信號輸出到states3. 0端鎖存,等待輸出 到計分和顯示單元。同吋rtng端在有成功搶答的情況下發(fā)出警報。2、計分模塊(1) vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jfq isport(rst1: in std_logic;add: in std_logic;chos: in std_logic_vector(3 downto 0); aa2,aa1,aao,bb2,bb1,bbo: out std_logic_vector(3
10、 downto 0); cc2,cc 1 ,cc0,dd2,dd 1 ,dd0: out std_logic_vector(3 downto 0);end entity jfq ;architecture art of jfq isbeginprocess(rst 1,add,chos) isvariable points_a2,points_a 1: std_logic_vector(3 downto 0); variable points_b2,points_b 1: std_logic_vector(3 downto 0); variable points_c2,points_c 1:
11、std_logic_vector(3 downto 0); variable points_d2,points_d 1: std_logic_vector(3 downto 0);beginif (add'event and add=! 1j thenif rst l=r thenpoints_a2:=,ooor,; points_a 1 =0000”;points_b2:=hooor,; points_b 1 :=n0000u;points_c2:=nooo 1 ”; points_c l:=”0000”; points_d2:=nooor*; points_d 1 :=h0000m
12、;elsif chos=”0001 “ thenif points_a 1 =” 1001” thenpoints_a1:=,0000,*;if points a2二” 1001” thenpoints_a2:=,oooon;elsepoints_a2:=points_a2+, lr;end if;elsepoints_a 1 :=points_a 1+t; end if;elsif chos=n0010n thenif points_b1 二”1001” thenpoints_bl:=hoooon;if points_b2=n 1001" thenpoints_b2:=”0000”
13、;elsepoints_b2:二 points_b2+ 1 :end if;elsepoints_b 1 :二points_b 1+t; end if;elsif chos=n0011n thenif points_c1 二”1001” thenpoints_c1:=”0000”;if points_c2=” 1001" then points_c2:二”0000”;elsepoints_c2:=points_c2+, f;end if;elsepoints.c 1 :二 points_c 1+t; end if;elsif chos=h0100n thenif points_d 1
14、 二t 001 ” thenpoints_dl:=noooo"if points_d2=”1001” thenpoints_d2:=nooooh;elsepoints_d2:=points_d2+, 1 :end if;elsepoints.d 1 :=points_d 1+t;end if;end if;end if;aa2<=points_a2; aa1<=points_a1; aa0<=n0000h;bb2<=points_b2; bb1<=points_b1; bbov二”0000”;cc2v=points_c2; cc1<=points_
15、c1; cco<=nooooh;dd2v=points_d2; dd1 <二points_d1; ddo<二”0000”;end process;end architecture art;(2)電路模塊;jfq:i 1 1 b rstaa23.ob rb r1ii|addaa13.o0b b 'chos3.0aao3.o r1ii1bb23.o b r1bbb13.o0eibbo3.o ri icc23.o0 e0iicc13.o 二i icco3.o0e0idd23.o iiidd13.o0e0ii11b11i0 ddo3.o i 0 r0 r(3)原理說明在計分器
16、電路的設計中,按照-般的設計原則,按一定數(shù)進制進行加減 即可,但是隨著計數(shù)數(shù)冃的增加,要將計數(shù)數(shù)fi分解成十進制并進行譯碼顯 示分變得越來越麻煩。由于設計要求加減分均為io的倍數(shù)故而可以將個位一直設為0,這樣既 減少了接口,又大大地簡化了設計。圖中,rst端為復位端,將計分起始分數(shù)設為100。ch0se3.0端功能是 鎖存已搶答成功的組別序號,當接加分按鈕add后,將給cii0se3.0所存的 組別加分。每按一次加10分,并分為個、十、百位從高位到低位進行顯示。3、計時模塊(1) vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.
17、std_logic_unsigned.all;entity jsq isport(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 jsq;architecture art of jsq issignal da: std_logic_vector(3 downto 0);signal db: std_logic_vector(3 downto 0);beginprocess(
18、ta,tb,clr) isbeginif clrm p thenda<=n0000n;dbvoooo”;elseif ta 二 t thendav=da+l ;end if;if tb 二 tthendb<=db+1;end if;end if;end process;process(clk) isvariable tmpa: std_logic_vector(3 downto 0);variable tmpb: std_logic_vector(3 downto 0); beginif clr二t then tmpa:二”0000”; tmpb:=n0110h;elsif (cl
19、k event and clk=t) thenif ldn二t then tmpa:=da; tmpb:二db;elsif en=tthenif tmpa=n0000u thentmpa:二 t001”;if tmpb=n0000n then tmpbu'ol 10”; elsetmpb:二 tmpb1;end if;elsetmpa:=tmpa-1;end if;end if;end if;qa<=tmpa; qbv二tmpb;end process;end architecture art;(2)電路模塊fjsqti1 hi1clrqa3.oh1ldnqb3.ohi1enh1
20、i1clk(i1 ita,ibibi1i1tbi inst7r-« g j(3)原理說明本系統(tǒng)中的計時器電路既有計時初始值的預置功能,又有減計數(shù)功能,功能 比較齊全。其中初始值的預置功能是將時間的兩位數(shù)(單位為秒)分解成兩個數(shù) 分別進行預置,默認時間為60秒倒計時。ta、tb端分別預置兩位數(shù)值,再經(jīng)過 ip"端確認所置吋間,en端為高電平后開始計時。每個數(shù)的預置則采用高電平計 數(shù)的方式進行,clk接時鐘信號。4、譯碼器模塊(1) vhdl源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsign
21、ed.all;entity ymq isport(ain4: in std_logic_vector(3 downto 0); dout7: out std_logic_vector(6 downto 0); end ymq;architecture art of ymq isbeginprocess(ain4)begincase ain4 iswhen n0000n=>dout7<=m0111111"-0when n0001 n=>dout7<=noooo 110n;-1when "0010m=>dout7<=n 1011011&quo
22、t;2when ”001 l”=>dout7v=t001111”;3when "01 oon=>dout7<=n 1100110h;4when m0101 u=>dout7<=n 110110;5when n0110n=>dout7<=h 111110ln;-6when n0111 n=>dout7<=n0000111when tooo”=>dout7v=” 1111111”;-8when n 1001 n=>dout7<=" 1101111"9when others二dout7v=”0000
23、000”;end case;end process;end architecture art;(2)電路模塊fymqrrr 00 0 00 00 ain43.odout76.0 inst5夕(3)原理說明本譯碼器用于將搶答鑒別模塊搶答成功的組別和計吋器的吋間進行顯 示,ain4e3.0端輸入需顯示的二進制數(shù)組,d0ut7 6. 0端輸出顯示在數(shù) 碼管,顯示顯示范圍為09。k搶答鑒別模塊仿真波形d & q &創(chuàng)團魚晝輕屬込|進區(qū)目前角耳辣尊魁雜interval |l onsname:value:100.0ns200.0n$300.0ns400.0ns500.0ns600.0ns
24、7c/-ax01x0xho01oa1i-clr-001ad-cd1a states02、計時器模塊仿真波形jtltd目日圖 金卜-|團園血鳳厲創(chuàng)今綴?堂-l£>-ta| time: |224.0nsref |o.onsinterval 224 0ns色-oil:一一all*enclrclkqaqbq/tmpb0010hoi6do46jltue x o rncnr b6 o8 x5r 3、計分器模塊仿真波形0ax lix itoa 脫1hl 1 丄, £vu yahuvi* jjya k?®a& sfiiqeebih 21 dlref 20ns11*|
25、<1 time: 25 0nsinterval|230ns142 ons1|name:50 0ns1000ns150.0ns1 1 200 ont250.0ns300 ons350 ons400 0ns450 0ns500iu-rst1a- add0n mnjutmnjtnj-lnjmnjtnjtrlrlrlnjttlnj"iv- chosho0 x8a4*2 jl8茁aa2ho1uk aalho"ozmzm:t2 aaoto01-u> bb2e19 bblho04bboho0cc2ho11/ cclho0zjzxze313 ccoho0ydd2ho1ita d
26、dlho0xi x2"m4(zxixlilxidh7 ddoho0qz potnt$_a2ho1qz pomtsa!ho0dqqdcnz4q/ pointsho1qz po»nt$_b1ho0ldcixzc4olz pointsho1qz pomtsdho0zxuzxz3q/ pointsd2ho1x 2qz pomtsdlho0hytyiraxdcdcdsmcdcd j4、譯碼器模塊仿真波形ni ijwrw a«rvym色雖圖込雖i團塑血站魚國簷韻創(chuàng)ref |o.onsname value: 護n4 dout7bocoib 00001102 03 time: 2
27、3.2ns0.0ns50.0ns100.0ns150.0ns200.0ns250.0ns300.0ns350.1- l -l_l1110001 0010 0011 0100 01010110 x 0111 interval: 23.2ns血 0110h 1011011 h10011 廠it11001101101 血 h 1111101 ik 測 115、系統(tǒng)總體仿真波形acir ldn i>-ta tb 滬 rst1 i-en1 i-clk arst u-a ab 滬c i*-0 if-ado -t>led_d -oled.c "led.8 "led.a -tf
28、asxsig z0xs|6o 4jf1.ai3 0553 0<>jfupo匕 jf1.di3 000011500ns3000nsa50 0n$ o n nax: 1x癒r0h7d7d x3fx7dih3f3f gf(7f i 07 i 70 i 60 i k i 4fy « i 3f i 6fh3f3fx ® bl 50m阿»代® x瑞581h0o jl1ho0i1ho0丄1h001五、實驗結果分析通過電路的仿真圖形及eda的操作,可以發(fā)現(xiàn)該電路實現(xiàn)的結果:在搶答鑒別模塊屮,可容納四組參賽者進行搶答,每組設置一個搶答按鈕供 搶答者使用,而且電路具有第一搶答信號的鑒別和鎖存功能。在主持人交系統(tǒng)復 位并發(fā)岀搶答指令后,如果有一組先按下?lián)尨痖_關,則該組指示燈亮并用組別顯 示電路顯示搶答者的組別,同時揚聲器發(fā)擊警報,同時其他參賽組不可以再搶答。電路具有計分功能,使每組在開始時的分數(shù)預置成100分,搶答后由主持人 計分,答對一次加10分。電路有計時功能,選手需在規(guī)定時間內(nèi)搶答和答題。如果有犯規(guī)行為,系統(tǒng) 也會發(fā)出警報。五、實驗中的問題及解決此次試驗遇到的最大的問題便是搶答鑒別模塊的設計,之前的設計結果是搶 答的那組參賽人員必須在按鍵之后一直按住,才能保證后面的選手不能繼續(xù)搶 答,而且之前
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年信息技術與信息管理基礎知識考試試卷及答案
- 2025年小學語文知識考核試題及答案
- 2025年企業(yè)內(nèi)部審計考試試卷及答案
- 2025年企業(yè)管理實務能力測試試題及答案
- 2025年美術學與設計專業(yè)考試題及答案
- 2025年公共管理學科試題及答案
- 2025年合同管理專業(yè)資格考試試卷及答案
- 2025年管理學考研復習試題及答案
- 2025年古典文學作品賞析考試試卷及答案
- 《小學二年級美術色彩搭配教學教案》
- AQ/T 2081-2023 金屬非金屬礦山在用帶式輸送機安全檢測檢驗規(guī)范(正式版)
- 2023-2024學年天津市部分區(qū)八年級(下)期末數(shù)學試卷(含答案)
- 旅游服務合作協(xié)議模板
- 嘉興市桐鄉(xiāng)市六校文理科聯(lián)合調(diào)研2022-2023學年七年級下學期5月月考數(shù)學試題
- DL-T-5161.5-2018電氣裝置安裝工程質(zhì)量檢驗及評定規(guī)程第5部分:電纜線路施工質(zhì)量檢驗
- 辦公大樓安全隱患排查清單
- 產(chǎn)科危急重癥早期識別中國專家共識(2024年版)要點解讀
- DZ∕T 0219-2006 滑坡防治工程設計與施工技術規(guī)范(正式版)
- 車間級班組級安全培訓教材
- 探索心理學的奧秘智慧樹知到期末考試答案章節(jié)答案2024年北京大學
- 個體工商戶公司章程模板
評論
0/150
提交評論