




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、-. z 多功能数字钟设计说明:1系统顶层框图:各模块电路功能如下:1.秒计数器、分计数器、时计数器组成最根本的数字钟,其计数输出送7段译码电路由数码管显示。2.基准频率分频器可分频出标准的1HZ频率信号,用于秒计数的时钟信号;分频出4HZ频率信号,用于校时、校分的快速递增信号;分频出64HZ频率信号,用于对按动校时,校分按键的消除抖动。2.多功能数字钟构造框图:一、系统功能概述已完成功能完成时分秒的依次显示并正确计数,利用六位数码管显示;时分秒各段个位满10正确进位,秒分能做到满60向前进位,有系统时间清零功能;定时器:实现整点报时,通过扬声器发出上下报时声音;时间设置,也就是手动调时功能:
2、当认为时钟不准确时,可以分别对分时钟进展调整;闹钟:实现分/时闹钟设置,在时钟到达设定时间时通过扬声器响铃。有静音模式。 待改良功能:1. 系统没有万年历功能,正在思考设计方法。2. 应添加秒表功能。二、系统组成以及系统各局部的设计1.时计数模块时计数模块就是一个2位10进制计数器,记数到23清零。VHDL的RTL描述如下:-t_h.vhdlibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entityt_h is port(en,clk,clr:in std_logic; dout:out std_
3、logic_vector(7 downto 0); c:out std_logic);endt_h;architecture rtl oft_h issignal t:std_logic_vector(7 downto 0);begin process(en,clk,clr) variable t:std_logic_vector(7 downto 0); begin if en=1 then -异步使能 if clk event and clk=1 then t:=t+1; if t(3 downto 0)=*A then -个位等于10则十位加1 t(7 downto 4):=t(7 do
4、wnto 4)+1; t(3 downto 0):=*0; -个位清零 end if; if t*23 then -大于23清零 t:=*00; end if; end if; if clr=1 then -异步清零 t:=*00; end if; end if; dout=t; end process;end rtl;时计数器模块仿真波形如下从仿真波形可知,当计数到23时,下一个时钟上升沿到来时就清零了,符合设计要求。时计数模块框图如下分及秒计数模块分及秒计数模块也是一个2位10进制计数器,记数到59清零。VHDL的RTL描述如下:library ieee;use ieee.std_logi
5、c_1164.all;use ieee.std_logic_unsigned.all;entityt_s is port(en,clk,clr:in std_logic; dout:buffer std_logic_vector(7 downto 0); c:out std_logic);endt_s;architecture rtl oft_s isbegin process(en,clk,clr) begin if en=1 then if clr=1 then -异步清零 dout=*00; elsif clk event and clk=1 then if dout(3 downto
6、0)9 then dout(3 downto 0)=dout(3 downto 0)+1; c=0; elsif dout(7 downto 4)5 then dout(3 downto 0)=*0; dout(7 downto 4)=dout(7 downto 4)+1; else dout=*00; c=1; end if; end if; else dout10 then dout=1;t:=t-1; else dout=0; end if; end if; else dout=0;t:=0; end if; end process;end rtl;library ieee;use ie
7、ee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity ring is port( clk: in std_logic; clk500: in std_logic; clk1k:in std_logic; beep:out std_logic);end ring;architecture rtl of ring isbegin process(clk) variable t: std_logic; variable n: integer range 0 to 15:=0; begin if clk event and clk=1
8、 then t:=not t;n:=n+1; end if; if t=1 and n11 then beep=clk500; elsif n=11 then beep=clk1k; else beepsys_en,clk=clk_h,clr=sys_rst,dout=reg_h); m:t_s port map(en=sys_en,clk=clk_m,clr=sys_rst,dout=reg_m,c=c_m); s:t_s port map(en=sys_en,clk=sys_clk1,clr=SCc,dout=reg_s,c=c_s); -sled:segmain port map(clk
9、=clk1,reset_n=SCc,seg_data=seg_data,seg_=seg_,datain=dout(15 downto 0); -ring0:ring port map(en=en_r,clk=clk_ring,clk500=sys_clk500,clk1k=sys_clk1k,beep=beep); haoin1:haoin port map( SA,sys_clk64,SAc); haoin2:haoin port map( SB,sys_clk64,SBc); haoin3:haoin port map( SC,sys_clk64,SCc); haoin4:haoin p
10、ort map( SD,sys_clk64,SDc); NL:naoling port map(beep=NL_ring,h=reg_h,m=reg_m,clk4hzh=sys_clk4_NL_h,clk4hzm=sys_clk4_NL_m,sys_en=sys_en,sys_rst=sys_rst,h_o=NL_reg_h,m_o=NL_reg_m); beep=clk_ring and mh; -led=reg_s(3 downto 0); p_sys_clk:process(clk1) variable t1,t4,t64,t500,t1k:integer range 0 to 5000
11、0000; begin if clk1 event and clk1=1 then t1:=t1+1; t4:=t4+1; t64:=t64+1; t500:=t500+1; t1k:=t1k+1; if t1=clki/2 then t1:=0; sys_clk1=not sys_clk1; end if; if t4=clki/8 then t4:=0; sys_clk4=not sys_clk4; end if; if t64=clki/128 then t64:=0; sys_clk64=not sys_clk64; end if; if t500=clki/1000 then t50
12、0:=0; sys_clk500=not sys_clk500; end if; if t1k=clki/2000 then t1k:=0; sys_clk1k=not sys_clk1k; end if; end if; end process p_sys_clk; p_c:process(SAc,SBc,SCc,SDc) begin if SAc=1 and SDc=0 then clk_h=sys_clk4; else clk_h=c_m; end if; if SAc=1 and SDc=1 then sys_clk4_NL_h=sys_clk4; else sys_clk4_NL_h=0; end if; if SBc=1 and SDc=0then clk_m=sys_clk4; else clk_m=c_s; end if; if SBc=1 and SDc=1then sys_clk4_NL_m=sys_clk4; else sys_clk4_NL_m=0; end if; if SDc=0 then dout(7 downto 0)=reg_s
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 时局与发展(地产)
- 图木舒克职业技术学院《地理信息系统原理》2023-2024学年第二学期期末试卷
- 宁夏艺术职业学院《Java海量数据分布式开发》2023-2024学年第二学期期末试卷
- 武昌首义学院《快速成型技术》2023-2024学年第二学期期末试卷
- 2025届山西省乡宁县初三延长假期综合考试英语试题含答案
- 石首市2025年三下数学期末综合测试试题含解析
- 北海康养职业学院《药学学科概论》2023-2024学年第一学期期末试卷
- 福州黎明职业技术学院《乳品研究与开发》2023-2024学年第一学期期末试卷
- 安徽现代信息工程职业学院《行为矫正的原理与技术》2023-2024学年第二学期期末试卷
- 湖南省浏阳一中、株洲二中等湘东七校2024-2025学年高三第二次质检化学试题含解析
- 《客舱安全与应急处置》-课件:灭火设备:洗手间灭火系统及其他
- 银发经济市场分析报告
- 眼部护理中医知识培训课件
- 枕颈椎管椎间盘狭窄个案护理
- 快乐与人分享课件
- 养老托育服务发展分析报告
- 煤矿反三违培训课件
- 《家族职业树》课件
- (完整版)A4作文格纸可直接打印使用
- 井控设备课件
- 苏州英文介绍
评论
0/150
提交评论