基于VHDL的数字电子钟系统设计(6)

时间:2025-07-05

集大集成软件设计,电子钟设计

3、Hour计时模块:

begin

process(clk) begin

if(clk'event and clk='1') then if(q=23) then q<=0;clk1<='1';

elsif q<23 then q<=q+1; clk1<='0'; end if; end if;

end process;

当clk上升沿来临时,hour模块开始从0计数到23,并输出一个控制信号clk1控制day模块,此时clk1=1 ,并回到0然后循环计数,此时clk1=0。由于要求初始时间为14,我们可以利用“signal q:integer:=14;”赋初始值,这样计数器就会从14开始计数。

4、Day计时模块: if setd='1' then

if ds=0 then qd<=qd; else qd<=ds; end if;

elsif (clkd'event and clkd='1') then

if ( yearin rem 4 =0) then

if ((monthin=1) or (monthin=3) or (monthin=5) or (monthin=7) or (monthin=8) or (monthin=10) or (monthin=12)) then-------????

if(qd=31) then qd<=1; clk2<='1';

elsif qd<31 then qd<=qd+1; clk2<='0'; end if;

elsif (monthin=2) then if(qd=29) then qd<=1; clk2<='1';

elsif qd<29 then qd<=qd+1; clk2<='0'; end if;

elsif ((monthin=4) or (monthin=6) or (monthin=9) or (monthin=11)) then if(qd=30) then qd<=1; clk2<='1';

基于VHDL的数字电子钟系统设计(6).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219