EDA数字秒表设计Word文件下载.docx
- 文档编号:19452999
- 上传时间:2023-01-06
- 格式:DOCX
- 页数:9
- 大小:58.30KB
EDA数字秒表设计Word文件下载.docx
《EDA数字秒表设计Word文件下载.docx》由会员分享,可在线阅读,更多相关《EDA数字秒表设计Word文件下载.docx(9页珍藏版)》请在冰豆网上搜索。
2)选择模块:
按扫描信号的指定选择输出
3)3-8译码模块:
通过SEL给的信号来控制8位数码管位的亮灭
4)计时模块:
分别对毫秒,秒,分计时
5)显示模块:
通过CHOICE模块的输出信号来控制
三、单元模块设计
1、模块名:
sel模块设计
t-T-HHT—■---■SH—-■■■--eH—-!
!
---BS-■SBTTSS・*-■
selI
3
—elk□叫2期
irstS1
j■■■■==>
■■■■■■■■"
■■-is™"
■!
■■■r-—-r■-yd、
(1)模块功能:
CLK为扫描时钟脉冲,SELOUT端不停的发出扫描到的信号
(2)端口定义:
CLK为信号输入端
SELOUT[2..0]为选择到的信号输出
3)VHDL源程序
libraryieee;
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entityselisport(clk:
instd_logic;
selout:
outstd_logic_vector(2downto0));
endsel;
architectureoneofselis
signalcount:
std_logic_vector(2downto0);
begin
process(clk)
ifclk'
eventandclk='
1'
then
if(count="
101"
)thencount<
="
000"
;
else
count<
=count+1;
endif;
endprocess;
selout<
=count;
endone;
(4)仿真结果
■0]
data4[3.
0]0]
(2)端口定义:
a,b,c为控制信号;
data1[3..O],data2[3..O],data3[3..O],data4[3..O],
data5[3..O],data6[3..O]分别是毫秒的低位,毫秒的高位,秒的低位,秒的高位,分的低位,分的高位的数据值;
ch_out[3..0]为选择输出端。
(3)VHDL源程序
entitychoiceis
port
(a,b,c:
instd_logic;
data1,data2,data3,data4,data5,data6:
instd_logic_vector(3downto0);
ch_out:
outstd_logic_vector(3downto0)
);
endchoice;
architecturebehaveofchoiceis
signalch:
std_logic_vector(2downto0);
ch
(2)<
=c;
ch
(1)<
=b;
ch(0)<
=a;
process(ch)
casechis
when"
=>
ch_out<
=data1;
001"
=data2;
when"
010"
=data3;
011"
=data4;
100"
=data5;
=data6;
whenothers=>
null;
endcase;
endbehave;
(4)仿真结果
说明:
abc的值递增,ch_out选择输出data1,data2,data3,data4,data5,data6的
值,证明模块是正确的
3、模块名:
3-8译码模块设计
decode3_8
”
'
1
I
£
1SEL[2..O]Q[7..O]
\instG
*■■I■■i-r■i■■-it---i■-_r■■-k-_r--1--i
—:
通过SEL给的信号来控制8位数码管位的亮灭。
输入端SEL[2..0]值大小来选择输出Q的值
输出端Q[7..0]来控制灯哪位亮
LIBRARYieee;
ENTITYdecode3_8IS
PORT(SEL:
INstd_logic_vector(2downto0);
Q:
OUTstd_logic_vector(7downto0)
ENDdecode3_8;
ARCHITECTUREaOFdecode3_8IS
BEGIN
Q<
="
11111110"
whensel=
0else
"
11111101"
whensel
=1else
11111011"
2else
11110111"
3else
11101111"
4else
11011111"
5else
11111111"
ENDa;
4)仿真结果
I|riHIM91fell
91bbVMVf14«
C-UfaE甲MMW»
lflmIN
5
Hvs
no
3L
国0
BtldKll
nLtiaMJiLtulEC;
lili.il
n:
uLLOiaL3.]]LU:
11L
IMIjjL】LLillLLi1:
ilLCUlixJJciLiOi[JiliLLiri]
.TlejDjLc
抽】
I1
L
虹门
BL
to
■1.
旳
E1
■L
err]
f1
国厘1
EtQ曲
Hi1HL1on
mi一K曲;
■ajinimionirairai]
hl
如1
~LL
—
sum
・I
1.i
SELCti
E0
Sei的值递增,Q的相应位会亮,证明模块是正确的
4.1模块名:
毫秒计时模块设计
对毫秒位的计数
(2)端口定义:
clk为信号时钟输入端
reset为复位端
pause为暂停端
co为进位信号输出端
qh:
毫秒信号的高位输出端
ql:
毫秒信号的低位输出端
(3)VHDL源程序
useieee.std_logic_1164.all;
useieee.std_logic_unsigned.all;
entitym100is
(clk:
reset:
pause:
co:
outstd_logic;
bufferstd_logic_vector(3downto0);
ql:
bufferstd_logic_vector(3downto0)
endm100;
architecturebehaveofm100is
co<
='
when(qh="
1001"
andql="
)else'
0'
process(clk,reset,pause)
if(reset='
)then
qh<
0000"
ql<
elsif(pause='
)then
=qh;
=ql;
elsif(clk'
if(ql="
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- EDA 数字 秒表 设计
![提示](https://static.bdocx.com/images/bang_tan.gif)