一天24小时倒计时闹钟Word格式文档下载.docx

上传人:b****3 文档编号:18257029 上传时间:2022-12-14 格式:DOCX 页数:8 大小:46.58KB
下载 相关 举报
一天24小时倒计时闹钟Word格式文档下载.docx_第1页
第1页 / 共8页
一天24小时倒计时闹钟Word格式文档下载.docx_第2页
第2页 / 共8页
一天24小时倒计时闹钟Word格式文档下载.docx_第3页
第3页 / 共8页
一天24小时倒计时闹钟Word格式文档下载.docx_第4页
第4页 / 共8页
一天24小时倒计时闹钟Word格式文档下载.docx_第5页
第5页 / 共8页
点击查看更多>>
下载资源
资源描述

一天24小时倒计时闹钟Word格式文档下载.docx

《一天24小时倒计时闹钟Word格式文档下载.docx》由会员分享,可在线阅读,更多相关《一天24小时倒计时闹钟Word格式文档下载.docx(8页珍藏版)》请在冰豆网上搜索。

一天24小时倒计时闹钟Word格式文档下载.docx

useieee.std_logic_1164.all;

useieee.std_logic_unsigned.all;

useieee.std_logic_arith.all;

-----实体---------

entitymiaobiaois

port(en,rst,clk:

instd_logic;

----------------暂停,复位,频率------

dian,bell:

outstd_logic;

---------------数码管点和蜂鸣器-----------

duan:

outstd_logic_vector(5downto0);

------数码管的段显示---

cout:

outstd_logic_vector(6downto0));

------数码管的位选-------

end;

--------------结构体-----------

architectureoneofmiaobiaois

signalclk_1k:

std_logic;

signalclk_1h:

signalcnt6:

integerrange0to5;

signaldata:

std_logic_vector(5downto0);

signaldout:

signals:

std_logic_vector(6downto0);

signalled1,led2,led3,led4,led5,led6:

begin

-------------1k分频--------

process(clk)

variablecnt1:

integerrange0to250;

variablecnt2:

integerrange0to100;

begin

ifclk'

eventandclk='

1'

then

ifcnt1=250then

cnt1:

=0;

ifcnt2=100then

cnt2:

clk_1k<

=notclk_1k;

else

=cnt2+1;

endif;

=cnt1+1;

endprocess;

---------------1h分频-----------

integerrange0to4999;

ifcnt1=4999then

ifcnt2=4999then

clk_1h<

=notclk_1h;

-------------数码管---------

process(clk_1k)

ifclk_1k'

eventandclk_1k='

then

ifcnt6=5then

cnt6<

else

cnt6<

=cnt6+1;

endif;

endprocess;

process(cnt6)

casecnt6is

when0=>

dout<

="

111110"

;

when1=>

111101"

when2=>

111011"

when3=>

110111"

when4=>

101111"

when5=>

011111"

whenothers=>

=null;

endcase;

process(dout)

begin

casedoutis------数码管位地址相对应的输出段码信号--------

when"

=>

data<

=led1;

dian<

='

=led2;

0'

=led3;

=led4;

=led5;

=led6;

=null;

------------段显示地址--------

process(clk_1h)

ifrst='

led6<

000010"

led5<

000011"

led4<

000101"

led3<

001001"

led2<

led1<

elsifclk_1h'

eventandclk_1h='

ifen='

caseled1is

000000"

caseled2is

caseled3is

caseled4is

caseled5is

caseled6is

led5<

led4<

led3<

led2<

led1<

bell<

whenothers=>

=led6-1;

endcase;

=led5-1;

bell<

=led4-1;

=led3-1;

=led2-1;

=led1-1;

---------------七段译码-----------

process(data)

casedatais

s<

0111111"

000001"

0000110"

1011011"

1001111"

000100"

1100110"

1101101"

000110"

1111101"

000111"

0000111"

001000"

1111111"

1101111"

duan<

=dout;

cout<

=s;

四、管脚分配

体会与收获

通过这个项目给我最大的体会就是不用害怕大项目,其实我们可以通过一个一个小项目完成好后在添加一些新的功能上去,不断的修改,整个项目完成我也是通过一个又一个简单小项目调试先,如先弄好寄存,再弄显示….一步一步加上一些功能上去,如果遇到不懂的和其他同学互相交流,有时候人家就那么几句话就可以让你灵感出现。

要注重团队合作,一个人的力量毕竟是小的,互相学习借鉴人家,从中选择对自己有益的一面。

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

当前位置:首页 > 农林牧渔 > 畜牧兽医

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

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