基于cpld的数字时钟设计内容摘要:

钟和秒; 具有时、分、秒、计数显示功能,以 24 小时循环计时; 具有清零,调节小时、分钟功能 ; 当时钟到了整点的时候,蜂鸣器发出声音,时间长度自行设定。 目的 熟练操作 MAX+plus II 软件; ; ,二十四进制计数器的设计方法 ; ; ; .熟练操作 EDA 实验 箱。 二 程序设计及模块说明与仿真 二十四进制 程序 library IEEE。 use。 use。 湖北轻工职业技术学院 6 use。 entity shi24 is port( clk:in std_logic。 clr : in std_logic_vector(1 downto 0)。 din:in std_logic_vector(3 downto 0)。 co :out std_logic。 ten1 ,one2 : out std_logic_vector(3 downto 0))。 end。 architecture one of shi24 is signal ten_temp1,one_temp2:std_logic_vector(3 downto 0)。 begin process(clk) begin if clr=00then ten_temp1=0000。 one_temp2=0000。 elsif clr=01 then one_temp2=din。 elsif clr=10 then ten_temp1=din。 elsif clk39。 event and clk=39。 139。 then if ten_temp1=2 and one_temp2=3 then ten_temp1=0000。 one_temp2=0000。 elsif one_temp2=9 then one_temp2=0000。 ten_temp1=ten_temp1+1。 else one_temp2=one_temp2+1。 end if。 end if。 end process。 ten1=ten_temp1。 one2=one_temp2。 co=39。 139。 when ten_temp1=2 and one_temp2=3 湖北轻工职业技术学院 7 else 39。 039。 end。 端口说明 CLK 为输入时序脉冲。 CLR 为 输入控制端,接拨码开关:当 CLR=“ 00”时,数码管显示“ 00” ;当 CLR=“ 01”时,调整数码管的个位;当 CLR=“ 10”时,调整数码管的十位;当 CLR=“ 11”时,运行二十四进制。 DIN 为置数端:设置给定的数。 CO 为进位端:当计满到 24 个脉冲时, CO 增加一位。 TEN1 和 ONE2分别显示二十四进制的十位和个位。 元件符号电路 仿真图 六十进制 程序 湖北轻工职业技术学院 8 六十进制和二十四进制设计相同,只须修改输出控制 library IEEE。 use。 use。 use。 entity fen60 is port( clk:in std_logic。 clr : in std_logic_vector(1 downto 0)。 din :in std_logic_vector(3 downto 0)。 co :out std_logic。 ten3 ,one4 : out std_logic_vector(3 downto 0))。 end。 architecture one of fen60 is signal ten_temp3,one_temp4:std_logic_vector(3 downto 0)。 begin process(clk,clr) begin if clr=00th。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。