




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、西安交通大學(xué)電子技術(shù)實(shí)驗(yàn)報(bào)告智力搶答器的設(shè)計(jì)班級(jí): 姓名:學(xué)號(hào):h期:2015 年 6 月 30 h聯(lián)系電話:一、實(shí)驗(yàn)?zāi)康碾娮蛹夹g(shù)專題實(shí)驗(yàn)是對(duì)數(shù)字邏輯電路課程內(nèi)容的全面、系統(tǒng)的總結(jié)、鞏 固和提高的一項(xiàng)課程實(shí)踐活動(dòng)。通過智力搶答器的設(shè)計(jì)與分析實(shí)驗(yàn),加強(qiáng)與鞏i古i 學(xué)對(duì)數(shù)字邏輯電路設(shè)計(jì)的基本方法和技巧的掌握,同時(shí)熟悉quartus ii軟件及實(shí) 驗(yàn)室多功能學(xué)習(xí)機(jī)硬件平臺(tái),并掌握數(shù)字邏輯電路測(cè)試的基木方法,訓(xùn)練學(xué)牛的 動(dòng)手能力和思維方法。通過本實(shí)驗(yàn),一方面提高學(xué)生運(yùn)用數(shù)字邏輯電路解決實(shí)際問題的能力,另一 方面使學(xué)生更深入的理解所學(xué)知識(shí),將理論與實(shí)際問題相結(jié)合,為以后的計(jì)算機(jī) 硬件課程的學(xué)習(xí)奠定良好的
2、基礎(chǔ)。二、系統(tǒng)設(shè)計(jì)概要智力搶答器的設(shè)計(jì)1、項(xiàng)目名稱2、系統(tǒng)設(shè)計(jì)要求在許多比賽活動(dòng)中,為了準(zhǔn)確、公正、直觀地判斷岀第一搶答者,通常設(shè)置 一臺(tái)搶答器,通過數(shù)顯、燈光及音響等多種手段指示出第一搶答者。同時(shí),還可 以設(shè)置計(jì)分、犯規(guī)及獎(jiǎng)懲計(jì)錄等多種功能。木設(shè)計(jì)的具體要求是:(1) 設(shè)計(jì)制作一個(gè)可容納四組參賽者的數(shù)字智力搶答器,每組設(shè)置一個(gè)搶答 按鈕供搶答者使用。(2) 電路具有第一搶答信號(hào)的鑒別和鎖存功能。(3) 設(shè)置計(jì)分電路。(4) 設(shè)置犯規(guī)電路。三、系統(tǒng)設(shè)計(jì)方案1、總體概述根據(jù)系統(tǒng)設(shè)計(jì)要求可知,系統(tǒng)的輸入信號(hào)有:各組的搶答按鈕a、b、c、d, 系統(tǒng)清零信號(hào)clr,系統(tǒng)時(shí)鐘信號(hào)clk,計(jì)分復(fù)位端rst
3、,加分按鈕端add,計(jì)時(shí) 預(yù)置控制端ldn,計(jì)時(shí)使能端en,計(jì)時(shí)預(yù)置數(shù)據(jù)調(diào)整按鈕ta、tb;系統(tǒng)的輸出 信號(hào)有:四個(gè)組搶答成功與否的指示燈控制信號(hào)輸出口 leda、ledb、ledc、ledd, 四個(gè)組搶答吋的計(jì)吋數(shù)碼顯示控制信號(hào)若干,搶答成功組別顯示的控制信號(hào)若 干,各組計(jì)分動(dòng)態(tài)顯示的控制信號(hào)若干。根據(jù)以上的分析,我們可將整個(gè)系統(tǒng)分為三個(gè)主要模塊:搶答鑒別模塊 qdjb;搶答計(jì)時(shí)模塊jsq;搶答計(jì)分模塊jfq。對(duì)于需顯示的信息,需增加或外 接譯碼器ymq,進(jìn)行顯示譯碼。考慮到fpga/cpld的可用接口及一般eda實(shí)驗(yàn)開 發(fā)系統(tǒng)提供的輸岀顯示資源的限制,這里我們將組別顯示和計(jì)時(shí)顯示的譯碼器內(nèi)
4、設(shè),而將各組的計(jì)分顯示的譯碼器外接。2、系統(tǒng)模塊圖計(jì)分器3. 系統(tǒng)總體電路圖二 3# 1噸 w oxrs qi lrcctewam * k k k k m sms )mhb:對(duì)芒堆 )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)單元模塊電路設(shè)計(jì)及工作原理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)原理說明在搶答鑒別電路設(shè)計(jì)中,a、b、c、d四組搶答,理論上應(yīng)該有16種可 能情況,但實(shí)際上由于芯片反應(yīng)速度快到一定程度時(shí),兩組以上同時(shí)搶答成 功的可能性非常小,因此我們可設(shè)計(jì)成只有四種情況,這大大簡化了電路的 設(shè)計(jì)復(fù)雜'性。rst為復(fù)位端,將輸出信號(hào)復(fù)位或停止警報(bào)聲。clk1端為警報(bào)時(shí)鐘信號(hào); 待測(cè)信號(hào),即搶答信號(hào)a, b, c, d輸入電路中后,通過判斷是哪個(gè)信號(hào)最先為 t得出搶答成功的組別1,2,3或4組,將組別號(hào)輸出到相應(yīng)端a1,b1,c1,d1,
9、并將組別序號(hào)換算為四位二進(jìn)制信號(hào)輸出到states3. 0端鎖存,等待輸出 到計(jì)分和顯示單元。同吋rtng端在有成功搶答的情況下發(fā)出警報(bào)。2、計(jì)分模塊(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)原理說明在計(jì)分器
16、電路的設(shè)計(jì)中,按照-般的設(shè)計(jì)原則,按一定數(shù)進(jìn)制進(jìn)行加減 即可,但是隨著計(jì)數(shù)數(shù)冃的增加,要將計(jì)數(shù)數(shù)fi分解成十進(jìn)制并進(jìn)行譯碼顯 示分變得越來越麻煩。由于設(shè)計(jì)要求加減分均為io的倍數(shù)故而可以將個(gè)位一直設(shè)為0,這樣既 減少了接口,又大大地簡化了設(shè)計(jì)。圖中,rst端為復(fù)位端,將計(jì)分起始分?jǐn)?shù)設(shè)為100。ch0se3.0端功能是 鎖存已搶答成功的組別序號(hào),當(dāng)接加分按鈕add后,將給cii0se3.0所存的 組別加分。每按一次加10分,并分為個(gè)、十、百位從高位到低位進(jìn)行顯示。3、計(jì)時(shí)模塊(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)中的計(jì)時(shí)器電路既有計(jì)時(shí)初始值的預(yù)置功能,又有減計(jì)數(shù)功能,功能 比較齊全。其中初始值的預(yù)置功能是將時(shí)間的兩位數(shù)(單位為秒)分解成兩個(gè)數(shù) 分別進(jìn)行預(yù)置,默認(rèn)時(shí)間為60秒倒計(jì)時(shí)。ta、tb端分別預(yù)置兩位數(shù)值,再經(jīng)過 ip"端確認(rèn)所置吋間,en端為高電平后開始計(jì)時(shí)。每個(gè)數(shù)的預(yù)置則采用高電平計(jì) 數(shù)的方式進(jìn)行,clk接時(shí)鐘信號(hào)。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)原理說明本譯碼器用于將搶答鑒別模塊搶答成功的組別和計(jì)吋器的吋間進(jìn)行顯 示,ain4e3.0端輸入需顯示的二進(jìn)制數(shù)組,d0ut7 6. 0端輸出顯示在數(shù) 碼管,顯示顯示范圍為09。k搶答鑒別模塊仿真波形d & q &創(chuàng)團(tuán)魚晝輕屬込|進(jìn)區(qū)目前角耳辣尊魁雜interval |l onsname:value:100.0ns200.0n$300.0ns400.0ns500.0ns600.0ns
24、7c/-ax01x0xho01oa1i-clr-001ad-cd1a states02、計(jì)時(shí)器模塊仿真波形jtltd目日?qǐng)D 金卜-|團(tuán)園血鳳厲創(chuàng)今綴?堂-l£>-ta| time: |224.0nsref |o.onsinterval 224 0ns色-oil:一一all*enclrclkqaqbq/tmpb0010hoi6do46jltue x o rncnr b6 o8 x5r 3、計(jì)分器模塊仿真波形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團(tuán)塑血站魚國簷韻創(chuàng)ref |o.onsname value: 護(hù)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 測(cè) 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五、實(shí)驗(yàn)結(jié)果分析通過電路的仿真圖形及eda的操作,可以發(fā)現(xiàn)該電路實(shí)現(xiàn)的結(jié)果:在搶答鑒別模塊屮,可容納四組參賽者進(jìn)行搶答,每組設(shè)置一個(gè)搶答按鈕供 搶答者使用,而且電路具有第一搶答信號(hào)的鑒別和鎖存功能。在主持人交系統(tǒng)復(fù) 位并發(fā)岀搶答指令后,如果有一組先按下?lián)尨痖_關(guān),則該組指示燈亮并用組別顯 示電路顯示搶答者的組別,同時(shí)揚(yáng)聲器發(fā)擊警報(bào),同時(shí)其他參賽組不可以再搶答。電路具有計(jì)分功能,使每組在開始時(shí)的分?jǐn)?shù)預(yù)置成100分,搶答后由主持人 計(jì)分,答對(duì)一次加10分。電路有計(jì)時(shí)功能,選手需在規(guī)定時(shí)間內(nèi)搶答和答題。如果有犯規(guī)行為,系統(tǒng) 也會(huì)發(fā)出警報(bào)。五、實(shí)驗(yàn)中的問題及解決此次試驗(yàn)遇到的最大的問題便是搶答鑒別模塊的設(shè)計(jì),之前的設(shè)計(jì)結(jié)果是搶 答的那組參賽人員必須在按鍵之后一直按住,才能保證后面的選手不能繼續(xù)搶 答,而且之前
溫馨提示
- 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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年飛機(jī)液壓檢查凈化設(shè)備項(xiàng)目建議書
- 工程清包合同工程清包合同
- 2025年黑河道路危險(xiǎn)品押運(yùn)從業(yè)資格證模擬考試0題
- 2025年毒素類診斷抗原合作協(xié)議書
- 合作造林投資協(xié)議書
- 園區(qū)綠化養(yǎng)護(hù)管理合作協(xié)議
- 無線通信網(wǎng)絡(luò)協(xié)議解析
- 農(nóng)業(yè)供應(yīng)鏈管理與服務(wù)提供合同
- 2025年管理學(xué)考試內(nèi)容詳解試題及答案
- 社區(qū)農(nóng)田社會(huì)化服務(wù)協(xié)議
- 2023春期國開電大行政管理本科選修課《政治學(xué)原理》形考、終考試題及答案
- 三年級(jí)小機(jī)靈杯試題(常用版)
- 2022年中國熱帶農(nóng)業(yè)科學(xué)院分析測(cè)試中心高層次人才及博士招聘筆試備考題庫及答案解析
- 閃存存儲(chǔ)技術(shù)應(yīng)對(duì)大數(shù)據(jù)挑戰(zhàn)
- 科普項(xiàng)目申報(bào)書-中國科協(xié)
- 食蚜蠅課件完整版
- 主題班會(huì)《中國夢(mèng)我的夢(mèng)》課件
- 義務(wù)教育數(shù)學(xué)新課程標(biāo)準(zhǔn)選擇題題庫測(cè)試卷精選450題(2022版)含答案
- 古詩詞誦讀《客至》-統(tǒng)編版高中語文選擇性必修下冊(cè)
- 建筑材料分類整理
- YY/T 0801.2-2010醫(yī)用氣體管道系統(tǒng)終端第2部分:用于麻醉氣體凈化系統(tǒng)的終端
評(píng)論
0/150
提交評(píng)論