电子信息工程基于VHDL的100进制计数器报告.docx

上传人:b****6 文档编号:6095591 上传时间:2023-01-03 格式:DOCX 页数:6 大小:23.98KB
下载 相关 举报
电子信息工程基于VHDL的100进制计数器报告.docx_第1页
第1页 / 共6页
电子信息工程基于VHDL的100进制计数器报告.docx_第2页
第2页 / 共6页
电子信息工程基于VHDL的100进制计数器报告.docx_第3页
第3页 / 共6页
电子信息工程基于VHDL的100进制计数器报告.docx_第4页
第4页 / 共6页
电子信息工程基于VHDL的100进制计数器报告.docx_第5页
第5页 / 共6页
点击查看更多>>
下载资源
资源描述

电子信息工程基于VHDL的100进制计数器报告.docx

《电子信息工程基于VHDL的100进制计数器报告.docx》由会员分享,可在线阅读,更多相关《电子信息工程基于VHDL的100进制计数器报告.docx(6页珍藏版)》请在冰豆网上搜索。

电子信息工程基于VHDL的100进制计数器报告.docx

电子信息工程基于VHDL的100进制计数器报告

可编程逻辑器件应用

项目名称:

100进制计数器

指导老师:

龚兰芳

名:

李诗华

号:

080212215

级:

08电子2班

广东水利电力职业技术学院

一、设计要求

二、设计目的

二、设计方案

四、设计原理

五、硬件要求

六、调试与问题疑点

七、设计步骤八、体会、对设计工作的总结与展望

、设计要求

(1)设计带计数允许和复位输入的100进制计数器,要求完成顶层电路图和底层VHDL文件;

(2)进行功能仿真;

(3)下载并验证计数器功能;

(4)按上述步骤设计100进制计数器;

(5)为上述设计建立元件符号。

、设计目的

(1)设计一个带计数允许和复位端的100进制计数器。

(2)熟练掌握各种计数器类型模块的描述方法。

(3)能用计数器构成十进制、六十进制、十二进制等所需进制的计数器。

(4)体会EDA技术的优点。

设计两个按键,一个有停止、开始的功能,另一个有复位清零的功能,具体的看表1-1。

表1-1

按键

状态

功能

En

En=1

f开始计时

En=0

停止计时

Rst

Rst=0

复位清零

通过分频分出1KHZ对数码管的位地址进行扫描,而100KHZ利用if-else设计计数程序,并输出显示信号。

利用多个进程来完成以上的设计方案。

四、设计原理

libraryieee;

use

ieee.std_logic_1164.all;

use

ieee.std_logic_unsigned.all;

use

ieee.std_logic_arith.all;

entitybcd_100dis

port(en,rst,clk:

instd_logic;

duan:

outstd_logic_vector(5downto0);cout:

outstd_logic_vector(6downto0));

end;

architectureoneofbcd_100dis

signalclk_1k:

std_logic;

signalclk_100h:

std_logic;

signalcnt6:

integerrange0to3;

signaldata:

std_logic_vector(3downto0);

signaldata1:

std_logic_vector(3downto0);

signaldout:

std_logic_vector(5downto0);

signals:

std_logic_vector(6downto0);

signalled1,led2,led3,led4:

std_logic_vector(3downto0);

begin

process(clk)

variablecnt1:

integerrange0to250;

variablecnt2:

integerrange0to100;

begin

ifclk'eventandclk='1'then

ifcnt1=250thencnt1:

=0;

ifcnt2=100thencnt2:

=0;

clk_1k<=notclk_1k;

else

cnt2:

=cnt2+1;

endif;

else

cnt1:

=cnt1+1;

endif;

endif;

endprocess;

process(clk)

variablecnt1:

integerrange0to4000;

variablecnt2:

integerrange0to4000;

begin

ifclk'eventandclk='1'thenifcnt1=4000then

cnt1:

=0;

ifcnt2=4000then

cnt2:

=0;clk_100h<=notclk_100h;

else

cnt2:

=cnt2+1;

endif;

else

cnt1:

=cnt1+1;

endif;

endif;

endprocess;

process(clk_1k)

begin

ifclk_1k'eventandclk_1k='1'thenifcnt6=3then

cnt6<=0;

else

cnt6<=cnt6+1;

endif;

endif;

endprocess;

process(cnt6)

begin

casecnt6is

when0=>dout<="111110";

when1=>dout<="111101";

whenothers=>null;

endcase;

endprocess;

process(dout)

begin

casedoutis

when"111110"=>data<=led1;

when"111101"=>data<=led2;whenothers=>null;

endcase;

endprocess;

process(clk_100h)begin

ifrst='0'then

led2<="0000";led1<="0000";

elsifclk_100h'eventandclk_100h='1'then

ifen='1'then

caseled1is

when"1001"=>led1<="0000";

caseled2is

when"1001"=>

led2<="0000";

led1<="0000";

whenothers=>

led2<=led2+1;

endcase;

whenothers=>

led1<=led1+1;

endcase;

endif;

endif;

endprocess;

process(data)

begin

casedatais

when"0000"=>s<="0111111";--0

when"0001"=>s<="0000110";--1

when"0010"=>s<="1011011";--2

when"0011"=>s<="1001111";--3

when"0100"=>s<="1100110";--4

when"0101"=>s<="1101101";--5

when"0110"=>s<="1111101";--6

when"0111"=>s<="0000111";--7

when"1000"=>s<="1111111";--8

when"1001"=>s<="1101111";--9whenothers=>null;

endcase;

endprocess;

duan<=dout;

cout<=s;

end;

五、硬件要求

表2-1

六、调试与问题疑点问题疑点:

1.怎样实现两数码管同时显示.

2.怎样实现数字的循环.

调试:

1.编译无误,然后就对照自己所设计的功能按键状态(表1-1),看是否符合

设计结果要求•

2.检查无误,然后对自己规定的设计方案分配引脚(表2-1),进行编译无误,就下载到实验板上来验证设计效果•如果与自己的想法有出入,就要进行修改最后要达到自己的结果.

3.验证的结果与是否符合自己所规定的设计方案.

七、设计步骤八、体会、对设计工作的总结与展望

在这次设计实验中,我深刻地体会到思路清晰是十分行重要的,

从分频开始,到数码管显示,再到实现计数。

每一步都是非常重要的,

刚开始时我就遇到了:

怎样实现两数码管同时显示,怎样实现数字

的循环这两个问题思路也很模糊,但参考了大量的资料后,我的思路也就渐渐地清晰了,问题也解决了。

这使我明白了参考资料能使我们学到很多课堂上无法学到和知识。

我相信在以后的设计中,只要肯思考就一定会有突破。

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

当前位置:首页 > 自然科学

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

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