EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx
- 文档编号:15339375
- 上传时间:2022-10-29
- 格式:DOCX
- 页数:15
- 大小:350.60KB
EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx
《EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx(15页珍藏版)》请在冰豆网上搜索。
CycloneFPGA内部包括可配置逻辑模块CLB(ConfigurableLogicBlock)、输出输入模块IOB(InputOutputBlock)和内部连线(Interconnect)三个部分。
FPGA的基本特点主要有:
1)采用FPGA设计ASIC电路,用户不需要投片生产,就能得到合用的芯片。
2)FPGA可做其它全定制或半定制ASIC电路的中试样片。
3)FPGA内部有丰富的触发器和I/O引脚。
4)FPGA是ASIC电路中设计周期最短、开发费用最低、风险最小的器件之一。
5)FPGA采用高速CHMOS工艺,功耗低,可以及CMOS、TTL电平兼容。
可以说,FPGA芯片是小批量系统提高系统集成度、可靠性的最佳选择之一。
四、功能模块
1:
libraryieee;
useieee.std_logic_1164.all;
entityfengis
port(cp,clr:
instd_logic;
q:
outstd_logic);
endfeng;
architecturefeng_arcoffengis
begin
process(cp,clr)
begin
ifclr='
0'
then
q<
='
;
elsifcp'
eventandcp='
then
1'
endif;
endprocess;
endfeng_arc;
此程序为抢答鉴别模块feng
该模块主要实现抢答和鉴别的功能。
在主持人发出抢答指令以后,若有参赛者按下抢答器的按钮,该模块将参赛者按下按键的信号输出高电平给锁存模块。
图2抢答鉴别模块的仿真波形
clr是低电平有效;
当cp来个下降沿时,输出q将一直为高电平符合模块要求。
2:
entityselis
port(clk:
a:
outintegerrange0to7);
endsel;
architectureoneofselis
process(clk)
variableaa:
integerrange0to7;
ifclk'
eventandclk='
aa:
=aa+1;
a<
=aa;
endprocess;
endone;
此程序为VHDL程序
该程序生成的符号及仿真波形如下:
图3片选信号模块仿真图
当来一个脉冲时,输出将增加1,符合模块要求。
3:
entitylockbis
port(d1,d2,d3,d4:
clk,clr:
q1,q2,q3,q4,alm:
endlockb;
architecturelock_arcoflockbis
q1<
q2<
q3<
q4<
alm<
elsifclk'
=d1;
=d2;
=d3;
=d4;
endlock_arc;
此程序为锁存器模块LOCKB
该模块主要对选手按下按键进行锁存,锁存的同时发出alm信号实现声音提示。
图4锁存模块仿真图
当来一个上升沿的时候,alm发挥作用,并且d1对应输出q1。
4:
useieee.std_logic_unsigned.all;
entitydecode3_8is
port(sel:
instd_logic_vector(2downto0);
L:
outstd_logic_vector(7downto0)
);
enddecode3_8;
architectureoneofdecode3_8is
begin
L<
="
11111110"
whensel=0else
"
11111101"
whensel=1else
11111011"
whensel=2else
11110111"
whensel=3else
11101111"
whensel=4else
"
11011111"
whensel=5else
10111111"
whensel=6else
01111111"
whensel=7else
11111111"
此程序为显示模块
显示模块是由七段LED数码管译码和动态扫描显示两部分组成。
采用的是共阴极七段数码管,根据十六进制数和七段显示段码表的对应关系,其中要求显示组别。
生成符号及仿真波形如下:
图5显示模块的仿真波形
5:
entitydeledis
port(d:
instd_logic_vector(3downto0);
q:
outstd_logic_vector(6downto0));
enddeled;
architectureoneofdeledis
process(d)
casedis
when"
0000"
=>
q<
0111111"
0001"
0000110"
0010"
1011011"
0011"
1001111"
0100"
1100110"
0101"
1101101"
0110"
1111101"
0111"
0100111"
1000"
1111111"
1001"
1101111"
whenothers=>
0000000"
endcase;
此程序为deled模块
该模块是七段译码器,对数据进行译码扫描:
图7deled模块
译码模块完成了对数据在数码管上正确地显示,符合模块要求。
6:
entitych41ais
port(d1,d2,d3,d4:
outstd_logic_vector(3downto0));
endch41a;
architecturech41_arcofch41ais
process(d1,d2,d3,d4)
variabletmp:
std_logic_vector(3downto0);
tmp:
=d1&
d2&
d3&
d4;
casetmpis
1011"
1101"
1110"
1111"
endch41_arc;
此程序为转换模块ch41a
该模块是将抢答结果转换为二进制数
图7转换模块ch41a仿真波形
将输入的抢答结果转换为二进制数,符合模块要求。
7:
entitych42ais
port(sel:
d1,d2,d3:
instd_logic_vector(3downto0);
outstd_logic_vector(3downto0));
endch42a;
architecturech42_arcofch42ais
process(sel,d1,d2,d3)
caseselis
000"
001"
111"
endch42_arc;
此程序为3选1模块ch42a
该模块是将对应数码管片选信号,送出需要的显示信号。
图83选1模块ch42a的仿真波形
当sel输入001时,输出为d2,符合要求。
8:
entitycountis
port(clk,en:
h,l:
outstd_logic_vector(3downto0);
sound:
endcount;
architecturecount_arcofcountis
process(clk,en)
variablehh,ll:
std_lo
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA 课程设计 智力 竞赛 计数 抢答