EDA课程设计四路抢答器Word格式文档下载.docx
- 文档编号:7817564
- 上传时间:2023-05-09
- 格式:DOCX
- 页数:11
- 大小:213.40KB
EDA课程设计四路抢答器Word格式文档下载.docx
《EDA课程设计四路抢答器Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《EDA课程设计四路抢答器Word格式文档下载.docx(11页珍藏版)》请在冰点文库上搜索。
关键词:
抢答鉴别译码计数
Abstract
Responderistheanswerforthequizparticipantstoanswerinthedesignwhenaprioritydecisioncircuit,andtheracecanbedividedintoseveralgroups,answerineachgrouponthehostissuesraisedintheshortestpossibletimetomakejudgments,andpresstheanswerinanswerkey.Afterpressingthebuttonwhenthefirstperson,thenthedisplayshowsthenumberofthegroup,thecorrespondinglights,whileothergroupswillbekeycircuitblock,itdoesnotwork.Iftheanswerintime,noanswerin,thealarmlights.Answeringquestions,allthekeysfromthehosttorestoreandre-startthenextroundoftheResponder.Sotocompletetheansweringdevicelogicfunctions,thecircuitshouldincludeResponderidentificationmodule,Respondercountingmodule,alarmmodule,decodingmodule,frequencymodule.
KEY:
ResponderIdentificationCount
一、设计要求
1.抢答器同时供4名选手或4个代表队比赛,分别用4个按钮p0~p3表示。
2.设置一个系统使能开关kaishi,该开关由主持人控制。
3.抢答器具有锁存与显示功能。
即选手按动按钮,锁存相应的编号,并在LED和数码管上显示,同时提示灯亮。
选手抢答实行优先锁存,优先抢答选手的编号一直保持到主持人将系统清除为止。
二、方案设计与论证
1、概述
将该任务分成三个模块进行设计,分别为:
抢答器鉴别模块、计数模块、译码模块。
2、抢答器鉴别模块:
在这个模块中主要实现抢答过程中的抢答功能,并能对超前抢答进行警告,还能记录无论是正常抢答还是朝前抢答者的台号,并且能实现当有一路抢答按键按下时,该路抢答信号将其余的抢答信号封锁的功能。
其中有四个抢答信号s0、s1、s2、s3;
抢答状态显示信号states;
抢答与警报时钟信号clk2;
系统复位信号rst;
警报信号warm。
3、抢答器计数模块:
在这个模块中主要实现抢答过程中的计时功能,在有抢答开始后进行20秒的倒计时,并且在20秒倒计时后无人抢答显示超时并报警。
其中有抢答时钟信号clk1;
抢答使能信号start;
无人抢答警报信号warn;
计时中止信号stop;
计时十位和个位信号tb,ta。
4、译码模块:
在这个模块中主要实现抢答过程中将BCD码转换成7段的功能。
5、顶层文件:
在这个模块中是对前五个模块的综合编写的顶层文件。
三、单元电路设计
(一)抢答鉴别模块
1.VHDL源程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityqiangdais
port(p:
instd_logic_vector(3downto0);
en:
instd_logic;
clk:
y:
outstd_logic_vector(3downto0));
endqiangda;
architectureaofqiangdais
signalb:
std_logic_vector;
begin
process(p,en,clk)
begin
if(clk'
eventand(clk='
1'
))then
if(en='
)then
casepis
when"
0001"
=>
y<
="
;
0010"
0100"
1000"
whenothers=>
y<
0000"
endcase;
else
y<
endif;
endif;
endprocess;
enda;
2.抢答鉴别仿真图
3.抢答鉴别元件图
(二)计数模块
1.VHDL源程序
entitytenis
port(clk:
set:
data:
inintegerrange0to9;
count:
outintegerrange0to9;
carry:
outstd_logic);
endten;
architectureddoftenis
signaltmp:
integerrange0to9;
process(clk,set,data)
begin
if(set='
)then
tmp<
=data;
elsif(clk'
eventandclk='
if(tmp<
9)then
=tmp+1;
carry<
='
0'
elsif(tmp=9)then
=0;
endprocess;
count<
=tmp;
enddd;
2.计数仿真图
3.计数元件图
(四)七段译码器模块
LIBRARYieee;
USEieee.std_logic_1164.ALL;
ENTITYdecoder3_8IS
PORT(
A,B,C,D:
INSTD_LOGIC;
--KEY1键和KEY2键和KEY3键作为AbC信号的输入
CON:
INSTD_LOGIC;
Y:
OUTSTD_LOGIC_VECTOR(7DOWNTO0));
--LED灯作为输出显示状态
ENDdecoder3_8;
ARCHITECTUREfunOFdecoder3_8IS
SIGNALindata:
STD_LOGIC_VECTOR(3DOWNTO0);
BEGIN
indata<
=D&
C&
B&
A;
encoder:
PROCESS(indata)
BEGIN
IF(CON='
)THEN
CASEindataIS
WHEN"
Y<
11111110"
11111101"
11111011"
0011"
11110111"
11101111"
0101"
11011111"
0110"
10111111"
0111"
01111111"
1001"
WHENOTHERS=>
XXXXXXXX"
ENDCASE;
ENDIF;
ENDPROCESSencoder;
ENDfun;
2.译码元件仿真
3.译码元件图
(六)顶层文件
1.仿真图:
2.QDQ_1主电路图连线
四锁定引脚及下载
1.选择锁定引脚,再重新编译一次。
在编程窗的Mode中选择ActiveSerialprogramming编程模式,打开编程文件,选中QDQ.pof,并选中打钩前3个编程项目,在ED2板上选择PROG模式,然后下载。
2.锁定引脚:
时钟信号clkN2
发光二极管LEDRO-LEDR3(AE23.AF23.AB21.AC22)
数码管num0-num6(AB12.AC12.AD11.AE11.V14.V13)
ta0-ta6(AB23.V22.AC25.AC26.AB26.AB25.Y24)
tb0-tb6(Y23.AA25.AA26.Y26.Y25.U22.W24)
开关kaishi
AF14
SW0-SW3(N25.N26.P25.AE14)
SOUNDAA14
STARTAD13
STOPAC13
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA 课程设计 四路 抢答