EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx

上传人:b****1 文档编号:15339375 上传时间:2022-10-29 格式:DOCX 页数:15 大小:350.60KB
下载 相关 举报
EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx_第1页
第1页 / 共15页
EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx_第2页
第2页 / 共15页
EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx_第3页
第3页 / 共15页
EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx_第4页
第4页 / 共15页
EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx_第5页
第5页 / 共15页
点击查看更多>>
下载资源
资源描述

EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx

《EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx(15页珍藏版)》请在冰豆网上搜索。

EDA课程设计四人智力竞赛计数抢答器Word格式文档下载.docx

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

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

当前位置:首页 > 求职职场 > 面试

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1