
基于VHDL语言的简易电子钟课程设计.doc
26页设计题目:简易数字电子钟 专业班级: 电子信息工程二班学号:姓名:指导教师: 引言 目录第一章 数字电子钟计内容及要求 ·······································1.1 设计内容 ···························································· 1.2功能说明 ····························································第二章数字电子钟系统框图及工作原理································· 2.1 系统框图 ··················································· 2.2 电子钟总体工作原理与设计 ····································· 第三章 各功能模块的设计 3.1正常计时模块 3.2分频模块产生电路 3.3分时模块产生电路 3.4秒模块产生电路 3.5分模块产生电路 3.6时模块产生电路 3.7扫描模块产生电路第四章系统调试与分析·············································· 4.1 系统调试····················································· 4.1.1 调试方法················································· 4.1.2 调试故障及解决方法········································ 4.2 结果分析······················································ 第五章 课程设计感想············································· 引言数字时钟是一种用数字电路技术实现时、分、秒计时的装置,数字时钟走时精度高,稳定性好,使用方便,不需要经常调校,数字式时钟用秒脉冲发生器的精度稳定保证了数字钟的质量电子设计自动化(EDA)技术发展越来越迅速,利用计算机辅助设计已成为发展趋势。
VHDL语言具有强大的电路描述和建模能力,用VHDL开发的数字电路与开发平台以及硬件实现芯片无关,可移植性、可重用性好VHDL语言能够在系统级、行为级、寄存器传输级、门级等各个层次对数字电路进行描述,并可以在不同层次进行不同级别的仿真,能极大得保证设计的正确性和设计指标的实现Quartus Ⅱ设计软件提供了一个完整的、多平台的设计环境,它可以轻易满足特定设计项目的要求数字时钟是一种用数字电路技术实现时、分、秒计时的装置,数字时钟走时精度高,稳定性好,使用方便,不需要经常调校,数字式时钟用秒脉冲发生器的精度稳定保证了数字钟的质量第一章 数字电子钟计内容及要求1.1设计内容1.学习ALTERA公司的FPGA/CPLD的结构、特点和性能2.学习集成开发软件MAX+plus II/Quartus II的使用及设计过程3.熟悉EDA工具设计数字电路设计方法,掌握VHDL硬件描述语言设计方法4.根据给定题目设计数字电路,来加深对可编程逻辑器件的理解和掌握1.2功能要求说明1.在所选择器件内完成简易时钟的设计,要求设计完成后芯片具有时、分、秒的计时;译码;输出七段码;最大计时23时59分59秒;秒闪功能。
2.简易时钟要求具有对时功能,具体对时的实现方式自行决定,要求设计合理,以操作简单为原则(根具具体的工作进度,可以考虑增加整点报时等附加功能)3.在相应的器件平台上完成设计的输入、编译、综合或适配通过第二章 数字电子钟系统框图及工作原理2.1工作原理 系统主要由振荡器、分频器、计数器、译码显示电路和校时电路组成振荡器产生稳定的分频脉冲信号,作为数字钟的时间基准,然后经过分频器输出标准秒脉冲秒计数器满60分向分计数器进位,分计数器满60后向小时计数器进位,小时计数器按照二十四进制计数计数器的输出分别由译码器送显示器显示2.2设计内容 数字电子钟由振荡器、分频器、计数器、译码显示电路和校时电路组成振荡器产生稳定的高频脉冲信号,作为数字钟的时间基准,然后经过分频器输出标准秒脉冲秒计数器满60后向分计数器进位,分计数器满60后向小时计数器进位,小时计数器按照“24翻1”规律计数计数器的输出分别经译码器送显示器显示1)时钟产生电路将开发板上的时钟信号经过分频得到不同频率的时钟,分别作用于定时计数、LED扫描 2)控制逻辑电路完成电子钟的系统逻辑控制 3)计时电路主要按照时钟模式完成计时功能。
4)译码电路根据计时模块的状态输出值来确定对应位的数据,从而驱动显示电路 5)显示控制电路主要执行选择所对应位的数据功能,显示正确的时间第三章各功能模块的设计 顶层电路设计library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity zong isport( cp,rst:in std_logic; out1: out std_logic_vector(7 downto 0); out2: out std_logic_vector(7 downto 0)); end zong; architecture rtl of zong is component fenpin//调用分频电路port( clk1: in std_logic; clk:out std_logic );end component;component fenshi//调用分时电路port( clks,rst: in std_logic; sl,sh,ml,mh,hl,hh:in std_logic_vector(3 downto 0); num: out std_logic_vector(3 downto 0); outbit:out std_logic_vector(7 downto 0));end component;component second//调用秒电路port(clk,rst:in std_logic; enmin:out std_logic; sh:out std_logic_vector(3 downto 0); sl:out std_logic_vector(3 downto 0) );end component;component minute//调用分电路 port(clk1,rst:in std_logic; enhor:out std_logic; mh:out std_logic_vector(3 downto 0); ml:out std_logic_vector(3 downto 0) );end component;component hour//调用小时电路port(clk2,rst:in std_logic; hh:out std_logic_vector(3 downto 0); hl:out std_logic_vector(3 downto 0) ); end component; component clks//调用扫描脉冲电路port( clk1:in std_logic; clks:out std_logic); end component; component saomiao//调用扫描电路port( clk1: in std_logic; clks: out std_logic); end component; component saomiao2//调用翻译电路 port( clks:in std_logic; num:in std_logic_vector(3 downto 0); outled:out std_logic_vector(7 downto 0)); end component; signal clk,clk2,enmin,enhor:std_logic; signal s0,s1,m0,m1,h0,h1,num:std_logic_vector(3 downto 0 ); begin u0:fenpin port map(cp,clk); u1:fenshi port map(clk2,rst,s0,s1,m0,m1,h0,h1,num,out1); u2:second port map(clk,rst,enmin,s1,s0); u3:minute port map(enmin,rst,enhor,m1,m0); u4:hour port map(enhor,rst,m1,m0); u5:clks port map(cp,clk2); u6:saomiao port map(cp,clk2); u7:saomiao2port map(clk2,num,out2); end rtl;3.1 正常扫描(分时复用脉冲)模块产生电路 library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; entity clks is port( clk1: in std_logic; clks:out std_logic);end clks; Architecture a_counter of clks is signal hm: std_logic_vector(24 downto 0); signal fpb: std_logic; begin process(clk1) 。
