EDA课程设计抢答器.docx

上传人:b****5 文档编号:14305256 上传时间:2023-06-22 格式:DOCX 页数:15 大小:99.19KB
下载 相关 举报
EDA课程设计抢答器.docx_第1页
第1页 / 共15页
EDA课程设计抢答器.docx_第2页
第2页 / 共15页
EDA课程设计抢答器.docx_第3页
第3页 / 共15页
EDA课程设计抢答器.docx_第4页
第4页 / 共15页
EDA课程设计抢答器.docx_第5页
第5页 / 共15页
EDA课程设计抢答器.docx_第6页
第6页 / 共15页
EDA课程设计抢答器.docx_第7页
第7页 / 共15页
EDA课程设计抢答器.docx_第8页
第8页 / 共15页
EDA课程设计抢答器.docx_第9页
第9页 / 共15页
EDA课程设计抢答器.docx_第10页
第10页 / 共15页
EDA课程设计抢答器.docx_第11页
第11页 / 共15页
EDA课程设计抢答器.docx_第12页
第12页 / 共15页
EDA课程设计抢答器.docx_第13页
第13页 / 共15页
EDA课程设计抢答器.docx_第14页
第14页 / 共15页
EDA课程设计抢答器.docx_第15页
第15页 / 共15页
亲,该文档总共15页,全部预览完了,如果喜欢就下载吧!
下载资源
资源描述

EDA课程设计抢答器.docx

《EDA课程设计抢答器.docx》由会员分享,可在线阅读,更多相关《EDA课程设计抢答器.docx(15页珍藏版)》请在冰点文库上搜索。

EDA课程设计抢答器.docx

EDA课程设计抢答器

EDA课程设计抢答器

内容摘要

抢答器是为智力竞赛参赛者答题时进行抢答而设计的一种优先判决器电路,竞赛者可以分为若干组,抢答时各组对主持人提出的问题要在最短的时间内做出判断,并按下抢答按键回答问题。

当第一个人按下按键后,则在显示器上显示该组的号码,对应的灯亮,同时电路将其他各组按键封锁,使其不起作用。

若抢答时间内无人抢答,则报警灯亮。

回答完问题后,由主持人将所有按键恢复,重新开始下一轮抢答。

因此要完成抢答器的逻辑功能,该电路应包括抢答器鉴别模块、抢答器计数模块、报警模块、译码模块、分频模块。

关键词:

抢答鉴别封锁计数报警

Abstract

Responderistheanswerforthequizparticipantstoanswerinthedesignwhenaprioritydecisioncircuit,andtheracecanbedividedintoseveralgroups,answerineachgrouponthehostissuesraisedintheshortestpossibletimetomakejudgments,andpresstheanswerinanswerkey.Afterpressingthebuttonwhenthefirstperson,thenthedisplayshowsthenumberofthegroup,thecorrespondinglights,whileothergroupswillbekeycircuitblock,itdoesnotwork.Iftheanswerintime,noanswerin,thealarmlights.Answeringquestions,allthekeysfromthehosttorestoreandre-startthenextroundoftheResponder.Sotocompletetheansweringdevicelogicfunctions,thecircuitshouldincludeResponderidentificationmodule,Respondercountingmodule,alarmmodule,decodingmodule,frequencymodule.

KEY:

ResponderIdentificationBlockadeCountAlarm

 

一、设计要求

1.抢答器同时供4名选手或4个代表队比赛,分别用4个按钮S0~S3表示。

2.设置一个系统清除和抢答控制开关rst,该开关由主持人控制。

3.抢答器具有锁存与显示功能。

即选手按动按钮,锁存相应的编号,并在LED和数码管上显示,同时提示灯亮。

选手抢答实行优先锁存,优先抢答选手的编号一直保持到主持人将系统清除为止。

4.抢答器具有定时抢答功能,且一次抢答的时间由主持人设定(如20秒)

5.如果定时时间已到,无人抢答,本次抢答无效,系统报警并禁止抢答,定时显示器上显示20。

二、方案设计与论证

1、概述

将该任务分成五个模块进行设计,分别为:

抢答器鉴别模块、抢答器计时模块、报警模块、分频模块、译码模块。

2、抢答器鉴别模块:

在这个模块中主要实现抢答过程中的抢答功能,并能对超前抢答进行警告,还能记录无论是正常抢答还是朝前抢答者的台号,并且能实现当有一路抢答按键按下时,该路抢答信号将其余的抢答信号封锁的功能。

其中有四个抢答信号s0、s1、s2、s3;抢答状态显示信号states;抢答与警报时钟信号clk2;系统复位信号rst;警报信号warm。

3、抢答器计数模块:

在这个模块中主要实现抢答过程中的计时功能,在有抢答开始后进行20秒的倒计时,并且在20秒倒计时后无人抢答显示超时并报警。

其中有抢答时钟信号clk1;系统复位信号rst;抢答使能信号start;无人抢答警报信号warn;计时中止信号stop;计时十位和个位信号tb,ta。

4、报警模块:

在这个模块中主要实现抢答过程中的报警功能,当主持人按下控制键,有限时间内人抢答或是计数到时蜂鸣器开始报警,计数停止信号stop;状态输出信号alm;计数脉冲clk。

5、译码模块:

在这个模块中主要实现抢答过程中将BCD码转换成7段的功能。

6、分频模块:

在这个模块中主要实现抢答过程中所需的时钟信号。

7、顶层文件:

在这个模块中是对前五个模块的综合编写的顶层文件。

 

三、单元电路设计

(一)抢答鉴别模块

1.VHDL源程序

libraryieee;

 

entityxuanshouis

port(rst,clk2:

instd_logic;

s0,s1,s2,s3:

instd_logic;

states:

bufferstd_logic_vector(3downto0);

light:

bufferstd_logic_vector(3downto0);

warm:

outstd_logic);

endxuanshou;

architectureoneofxuanshouis

signalst:

std_logic_vector(3downto0);

begin

p1:

process(s0,rst,s1,s2,s3,clk2)

begin

ifrst='0'then

warm<='0';st<="0000";

elsifclk2'eventandclk2='1'then

if(s0='1'orst(0)='1')andnot(st

(1)='1'orst

(2)='1'orst(3)='1')

thenst(0)<='1';

endif;

if(s1='1'orst

(1)='1')andnot(st(0)='1'orst

(2)='1'orst(3)='1')

thenst

(1)<='1';

endif;

if(s2='1'orst

(2)='1')andnot(st(0)='1'orst

(1)='1'orst(3)='1')

thenst

(2)<='1';

endif;

if(s3='1'orst(3)='1')andnot(st(0)='1'orst

(1)='1'orst

(2)='1')

thenst(3)<='1';

endif;

warm<=st(0)orst

(1)orst

(2)orst(3);

endif;

endprocessp1;

p2:

process(states(0),states

(1),states

(2),states(3),light)

begin

if(st="0000")thenstates<="0000";

elsif(st<="0001")thenstates<="0001";

elsif(st<="0010")thenstates<="0010";

elsif(st<="0100")thenstates<="0011";

elsif(st<="1000")thenstates<="0100";

endif;

light<=st;

endprocessp2;

endone;

2.抢答鉴别仿真图

3.抢答鉴别元件图

(二)计数模块

1.VHDL源程序

libraryieee;

 

entityJSis

port(clk1,rst,start,stop:

instd_logic;

ta,tb:

bufferstd_logic_vector(3downto0));

endJS;

architectureoneofJSis

signalco:

std_logic;

begin

p1:

process(clk1,rst,start,stop,ta)

begin

ifrst='0'orstop='1'then

ta<="0000";

elsifclk1'eventandclk1='1'then

co<='0';

ifstart='1'then

ifta="0000"then

ta<="1001";co<='1';

elseta<=ta-1;

endif;

endif;

endif;

endprocessp1;

p2:

process(co,rst,start,stop,tb)

begin

ifrst='0'orstop='1'then

tb<="0010";

elsifco'eventandco='1'then

ifstart='1'then

iftb="0000"thentb<="0011";

elsetb<=tb-1;

endif;

endif;

endif;

endprocessp2;

endone;

2.计数仿真图

3.计数元件图

(三)报警模块

1.VHDL源程序

libraryieee;

entityshengyinis

port(rst:

instd_logic;

warn:

instd_logic;

clk:

instd_logic;

ta,tb:

inintegerrange0to9;

stop:

instd_logic;

alm:

outstd_logic);

end;

architecturebhvofshengyinis

begin

process(warn,ta,tb,stop,clk)

begin

ifrst='0'then

alm<='0';

elsifstop='1'then

alm<='0';

elsifta=0andtb=0then

alm<=clk;

elsifwarn='1'then

alm<=clk;

elsealm<='0';

endif;

endprocess;

end;

2.报警仿真图

3.报警元件图

(四)七段译码器模块

1.VHDL源程序

LIBRARYIEEE;

ENTITYYMQIS

PORT(bcd:

INSTD_LOGIC_VECTOR(3DOWNTO0);

dout:

OUTSTD_LOGIC_VECTOR(6DOWNTO0));

ENDYMQ;

ARCHITECTURErtlOFYMQIS

BEGIN

PROCESS(bcd)

BEGIN

CASEbcdIS

WHEN"0000"=>dout<="1000000";

WHEN"0001"=>dout<="1111001";

WHEN"0010"=>dout<="0100100";

WHEN"0011"=>dout<="0110000";

WHEN"0100"=>dout<="0011001";

WHEN"0101"=>dout<="0010010";

WHEN"0110"=>dout<="0000010";

WHEN"0111"=>dout<="1111000";

WHEN"1000"=>dout<="0000000";

WHEN"1001"=>dout<="0010000";

WHENOTHERS=>dout<="1111111";

ENDCASE;

ENDPROCESS;

ENDrtl;

 

2.译码元件图

(五)分频模块(用500HZ的时钟和1HZ的计数时钟)

1.Div100

libraryieee;

entitydiv100is

port(

clk:

instd_logic;

clk100:

outstd_logic

);

enddiv100;

architectureartofdiv100is

signalnum:

integerrange0to99;

signaltemp:

std_logic;

begin

process(clk)

begin

ifclk'eventandclk='1'then

ifnum=99then

num<=0;temp<=nottemp;

elsenum<=num+1;

endif;

clk100<=temp;

endif;

endprocess;

endart;

仿真图:

Div100元件图:

2.DIV50M:

这是一个50M分频,将50MHZ的信号分为1HZ。

LIBRARYIEEE;

 

ENTITYfenpinIS

PORT(clk:

INSTD_LOGIC;

clk50:

OUTSTD_LOGIC);

ENDfenpin;

ARCHITECTURErtlOFfenpinIS

SIGNALcount:

STD_LOGIC_VECTOR(25DOWNTO0);

BEGIN

PROCESS(clk)

BEGIN

IF(clk'eventANDclk='1')THEN

Count<="00000000000000000000000000";

ELSE

Count<=count+1;

ENDIF;

ENDIF;

ENDPROCESS;

PROCESS(clk)

BEGIN

IF(clk'eventANDclk='1')THEN

clk50<='1';

ELSE

clk50<='0';

ENDIF;

ENDIF;

ENDPROCESS;

END;

fenpin元件图

(六)顶层文件

1.仿真图:

 

2.QDQ_1主电路图连线

 

四锁定引脚及下载

1.选择锁定引脚,再重新编译一次。

在编程窗的Mode中选择ActiveSerialprogramming编程模式,打开编程文件,选中QDQ.pof,并选中打钩前3个编程项目,在ED2板上选择PROG模式,然后下载。

2.锁定引脚:

时钟信号clkN2

发光二极管LEDRO

数码管num0-num6

ta

tb0-tb6()

开关rstAF14

SOUNDAA14

STARTAD13

STOPAC13

 

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 商务科技

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2