基于VHDL的数字钟设计

1、设计一个能显示1/10秒、秒、分、时的12小时数字钟。
2、熟练掌握各种计数器的使用。
3、能用计数器构成十进制、六十进制、十二进制等所需进制的计数器。
4、能用低位的进位输出构成高位的计数脉冲。
设计提示:
1、时钟源使用频率为0.1Hz的连续脉冲。
2、设置两个按钮,一个供“开始”及“停止”用,一个供系统“复位”用。
3、时钟显示使用数码管显示。
4、“时显示”部分应注意12点后显示1点。
5、注意各部分的关系,由低位到高位逐级设计、调试。
Q Q:355554746

-------------------------------------------时间设置小时部分

sethour1:process(clk,seth2)

begin

if clk'event and clk='1' then

if seth1="0010"and seth2="0011" then

seth1<="0000";

elsif seth2="1001" then

seth1<=seth1+1;

end if;

end if;

end process sethour1;

-------------------------------------------

sethour2:process(clk,md1,md2,seth1)

begin

if clk'event and clk='1' then

if (seth1="0010"and seth2="0011")or seth2="1001"then

seth2<="0000";

elsif md1='1' and md2="00" then

seth2<=seth2+1;

end if;

end if;

end process sethour2;

-------------------------------------------时间设置分钟部分

setmin1:process(clk,setm2)

begin

if clk'event and clk='1' then

if setm1="0101"and setm2="1001"then

setm1<="0000";

elsif setm2="1001"then

setm1<=setm1+1;

end if;

end if;

end process setmin1;

----------------------------------------------

setmin2:process(clk,md1,md2)

begin

if clk'event and clk='1'then

if setm2="1001"then

setm2<="0000";

elsif md1='1' and md2="01"then

setm2<=setm2+1;

end if;

end if;

end process setmin2;

--------------------------------------------

--------------------------------------------闹铃

speaker:process(clk1,hou1,hou2,min1,min2)

begin

if clk1'event and clk1='1'then

if seth1=hou1 and seth2=hou2 and setm1=min1 and setm2=min2 then

speak<=clk1;

else speak<='0';

end if;

end if;

end process speaker;

代码太长没发完
温馨提示:答案为网友推荐,仅供参考
相似回答