您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > EDA课程设计报告书抢答器
1职业技术学院学生课程设计报告课程名称:EDA数字抢答器专业班级:电子102班姓名:刘森学号:20100309212学期:2011-2012第二学期目录一、课程设计目的...................................32二、课程设计题目描述和要求.........................3三、课程设计报告内容...............................4四、结论...........................................21五、结束语.........................................22六、参考书目.......................................22一、课程设计目的.设计一个可容纳4组参赛的数字式抢答器。通过此次设计熟练掌握VHDL语言,并掌握设计所用的软件。3二、课程设计题目描述和要求在许多比赛活动中,为了准确、公正、直观地判断出第一抢答者通常设置一台抢答器,通过数显、灯光及音响等多种手段指示出第一抢答者。同时,还可以设置计分、犯规及奖惩计录等多种功能。本设计的具体要求是:(1)设计制作一个可容纳四组参赛者的数字智力抢答器,每组设置一个抢答按钮供抢答者使用。(2)电路具有第一抢答信号的鉴别和锁存功能。(3)系统具有计分电路。(4)系统具有犯规电路。系统设计方案:系统的输入信号有:各组的抢答按钮A、B、C、D,系统清零信号CLR,系统时钟信号CLK,计分复位端RST,加分按钮端ADD,计时预置控制端LDN,计时使能端EN,计时预置数据调整按钮可以用如TA、TB表示;系统的输出信号有:四个组抢答成功与否的指示灯控制信号输出口可用如LEDA、LEDB、LEDC、LEDD表示,四个组抢答时的计时数码显示控制信号若干,抢答成功组别显示的控制信号若干,各组计分动态显示的控制信号若干。整个系统至少有三个主要模块:抢答鉴别模块;抢答计时模块;抢答计分模块,其他功能模块(犯规警告模块,输出显示模块)。三、课程设计报告内容按照要求,我们可以将整个系统分为四个主要模块:抢答鉴别模块;抢4答计时模块;抢答计分模块;译码显示模块。对于需显示的信息,需要增加或外接译码器,进行显示译码。考虑到实验开发平台提供的输出显示资源的限制,我们将组别显示和计时显示的译码器内设,而将各组的计分显示的译码器外接。整个系统的大致组成框图如图2.1所示。图2.13.1抢答鉴别模块3.1.1抢答鉴别模块的功能抢答队伍共分为四组A,B,C,D。当主持人按下START键后,四组队伍才LEDALEDBLEDCLEDD5可以按抢答键抢答。抢答成功后表示该组的指示灯见亮起,但在主持人未按下START键之前,所有的抢答键按下均是无效的。当任意一个组抢答成功后,其余的组按抢答键无效。抢答键为A,B,C,D四个键。3.1.2抢答鉴别模块的源程序libraryieee;useieee.std_logic_1164.all;entityjbisport(sta:instd_logic;rst:instd_logic;a,b,c,d:instd_logic;a1,b1,c1,d1:outstd_logic;states:outstd_logic_vector(3downto0);start:outstd_logic);endentityjb;architectureartofjbisconstantw1:std_logic_vector:=0001;constantw2:std_logic_vector:=0010;constantw3:std_logic_vector:=0100;constantw4:std_logic_vector:=1000;signalsinor:std_logic;signalnsinor:std_logic;signals_start:std_logic;beginsinor=aorborcord;nsinor=not(aorborcord);start=s_start;process(sta,nsinor)is6beginif(sta='1')thens_start='1';elsif(nsinor'eventandnsinor='1')thens_start='0';endif;endprocess;process(rst,sta,sinor,nsinor)isbeginif(rst='1'orsta='1'ornsinor='1')thena1='0';b1='0';c1='0';d1='0';elsif(sinor'eventandsinor='1')thenif(s_start='1')thenif(a='1')thena1='1';b1='0';c1='0';d1='0';elsif(b='1')thena1='0';b1='1';c1='0';d1='0';elsif(c='1')thena1='0';b1='0';c1='1';d1='0';elsif(d='1')thena1='0';b1='0';c1='0';d1='1';endif;endif;endif;endprocess;process(sinor)isbeginif(rst='1')thenstates=0000;7elsif(sinor'eventandsinor='1')thenif(s_start='1')thenif(a='1')thenstates=w1;elsif(b='1')thenstates=w2;elsif(c='1')thenstates=w3;elsif(d='1')thenstates=w4;endif;endif;endif;endprocess;endarchitectureart;3.1.3抢答鉴别模块的时序仿真图8图4.1抢答开始后,A组按下抢答键,抢答成功3.2抢答器的抢答计时模块3.2.1抢答计时模块的功能9主持人宣布抢答成功后,按下EN键,选手开始回答,系统开始计时。TA和TB键选择计时的时间(TA:9秒,TB:7秒)3.2.2抢答计时模块的源程序libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityjsisport(clr,ldn,en,clk:instd_logic;ta,tb:instd_logic;qa:outstd_logic_vector(3downto0);qb:outstd_logic_vector(3downto0));endentityjs;architectureartofjsissignalda:std_logic_vector(3downto0);signaldb:std_logic_vector(3downto0);beginprocess(ta,clr)isbeginif(clr='1')thenda=1001;elsif(ta'eventandta='1')thenif(ldn='1')thenif(da=0000)thenda=1001;elseda=da-1;10endif;endif;endif;endprocess;process(tb,clr)isbeginif(clr='1')thendb=0101;elsif(tb'eventandtb='1')thenif(ldn='1')thenifdb=0000thendb=1001;elsedb=db-1;endif;endif;endif;endprocess;process(clk)isvariabletmpa:std_logic_vector(3downto0);variabletmpb:std_logic_vector(3downto0);beginif(clr='1')thentmpa:=0000;tmpb:=0000;elsifclk'eventandclk='1'thenifen='1'thentmpa:=da;tmpb:=db;11elsiftmpa=0000theniftmpb=0000thentmpa:=0000;elsetmpa:=1001;endif;iftmpb=0000thentmpb:=0000;elsetmpb:=tmpb-1;endif;elsetmpa:=tmpa-1;endif;endif;qa=tmpa;qb=tmpb;endprocess;endarchitectureart;123.2.3抢答计时模块的时序仿真图图5.1按下EN开始答题,回答问题时,选择TA模式计时3.3抢答器的译码显示模块133.3.1译码显示模块的功能译码显示模块用于显示每组选手的分数,计时的的时间等信息。3.3.2译码显示模块的源程序libraryieee;useieee.std_logic_1164.all;useieee.std_logic_unsigned.all;entityymisport(in4:instd_logic_vector(3downto0);out7:outstd_logic_vector(6downto0));endym;architectureartofymisbeginprocess(in4)begincasein4iswhen0000=out7=0111111;when0001=out7=0000110;when0010=out7=1011011;when0011=out7=1001111;when0100=out7=1100110;when0101=out7=1101101;when0110=out7=1111101;when0111=out7=0000111;when1000=out7=1111111;when1001=out7=1101111;whenothers=out7=0000000;14endcase;endprocess;endarchitecture;3.3.3译码显示模块的时序仿真图图7.1输入0001,输出0000110,在共阴极数码管上显示13.4抢答器的其他功能模块153.4.1其他功能模块的具体信息犯规功能模块:但主持人未按下START键时,若有选手按抢答键,系统报警。犯规功能模块的源程序:libraryieee;useieee.std_logic_1164.all;entityfgisport(a,b,c,d,start:instd_logic;y:outstd_logic);endfg;architecturebhvoffgisbeginprocess(a,b,c,d,start)beginifstart='0'thenif(aorborcord)='1'theny='1';endif;elsey='0';endif;endprocess;endarchitecture;16犯规功能模块的时序仿真图:图8.1B组提前抢答,报警铃鸣叫示意173.5总体电路的源程序以及仿真波形LIBRARYIEEE;USEIEEE.STD_LOGIC_1164.ALL;USEIEEE.STD_LOGIC_UNSIGNED.ALL;ENTITYqdqISPORT(A,B,C,D,tset,INI,EN,CLK:INSTD_LOGIC;tih:INSTD_LOGIC_VECTOR(5DOWNTO4);til:INSTD_LOGIC_VECTOR(3DOWNTO0);bell:OUTSTD_LOGIC;timeh:BUFFERSTD_LOGIC_VECTOR(5DOWNTO4);timel:BUFFERSTD_LOGIC_VECTOR(3DOWNTO0);obcd:OUTSTD_LOGIC_VECTOR(2DOWNTO0));END;AR
本文标题:EDA课程设计报告书抢答器
链接地址:https://www.777doc.com/doc-3915702 .html