首页 EDA数字时钟设计

EDA数字时钟设计

举报
开通vip

EDA数字时钟设计《EDA》课 程 设 计 设计题目:数字时钟设计  系部:物理与电子工程学院 年级: 09 级              班级:09通信工程        姓名:  张继龙          学号:2009080212              日期:2011年12月01日 目录 1.设计实验目的……………… 2.设计实验说明……………… 3.设计实验要求……………… 4.功能设计…………………… 1时钟计数………… 2.时间设置………… 3.清零功能………… 4.整点报时功能………… 5.数字时钟计数...

EDA数字时钟设计
《EDA》课 程 设 计 设计 领导形象设计圆作业设计ao工艺污水处理厂设计附属工程施工组织设计清扫机器人结构设计 题目:数字时钟设计  系部:物理与电子 工程 路基工程安全技术交底工程项目施工成本控制工程量增项单年度零星工程技术标正投影法基本原理 学院 年级: 09 级              班级:09通信工程        姓名:  张继龙          学号:2009080212              日期:2011年12月01日 目录 1.设计实验目的……………… 2.设计实验说明……………… 3.设计实验要求……………… 4.功能设计…………………… 1时钟计数………… 2.时间设置………… 3.清零功能………… 4.整点报时功能………… 5.数字时钟计数报时 VHDL 程序设计仿真与 分析 定性数据统计分析pdf销售业绩分析模板建筑结构震害分析销售进度分析表京东商城竞争战略分析 ……   1.秒计数器(miao)VHDL 程序描述、仿真波形图及其分析……   2.分计数器(fen)VHDL 程序描述、仿真波形图及其分析…… 3.时计数器(shi)VHDL 程序描述、仿真波形图及其分析…… 4. 整点报时器(baoshi) VHDL 程序描述、仿真波形图及其分析 5.分频器(fenpin)设计、仿真波形图及其分析…… 6.扫描显示译码器(saomiao))VHDL 程序描述、仿真波形图及其分析…… 7.数字时钟整体设计原理图及其分析…… 6.设计总结……………… 7.参考文献……………… 1设计实验目的: 熟练运用 VHDL 语言,完成数字时钟设计的软件 编程、编译、综合、仿真,使用 EDA 实验箱,实现数字时钟的硬件功能。 2设计实验说明: 1.数字时钟主要由:分频器、扫描显示译码器、六十进制计数器(或十进 制计数器与 6 进制计数器组成)、六十进制计数器(或十进制计数器与 6 进制计 数器组成)、十二进制计数器(或二十四进制计数器)电路组成。在整个时钟中 最关键的是如何获得一个精确的 1HZ 计时脉冲。 2.数字时钟显示由时(12 或 24 进制任选)、分(60 进制)、秒(60 进制) 组成,利用扫描显示译码电路在六个数码管显示。 3.数字时钟组成及功能: 数字时钟组成及功能: 1.分频率器:用来产生 1HZ 计时脉冲; 2.十二或二十四进制计数器:对时进行计数 3.六十进制计数器:对分和秒进行计数; 4.六进制计数器:分别对秒十位和分十位进行计数; 5.十进制计数器:分别对秒个位和分个位进行计数; 6.扫描显示译码器:完成对 7.字段数码管显示的控制; 3.设计实验要求: 1.精确显示时、分、秒。 2.数字时钟要求:具有对时、分、秒置数功能。 3.能够完成整点报时功能。 4.功能设计: 1.时钟计数:完成时、分、秒的正确计时并且显示所计的数字;对秒、分 60 进制计数,即从 0 到 59 循环计数, 对时 24 进制计数, 即从 0 到 23 循环计数。 2.时间设置:手动调节分钟(setfen)、小时(setshi),高定平时有效, 可以对分、时进行进位调节,低电平时正常计数。这样可以对所设计的时钟的时 间任意调。 3.清零功能:reset 为复位端,低电平时实现清零功能,高电平时正常计 数。这样可以对所设计的时钟的时间进行清零处理。 4.整点报时功能:当分由 59 进位时,会在整点报时输出端输出高电平,此 信号可以通过 LED 点亮检验。 5.数字时钟计数报时 VHDL 程序设计仿真与分析 1. (1)秒计数器(miao)VHDL 程序描述 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity miao is port( clk,reset,setfen:in std_logic; enfen:out std_logic; countmiao:out std_logic_vector(7 downto 0) ); end miao; architecture fun of miao is signal count:std_logic_vector(7 downto 0); signal enfen_1,enfen_2:std_logic; begin countmiao<=count; enfen_2<=(setfen and clk); enfen<=(enfen_1 or enfen_2); process(clk,reset,setfen) begin if(reset='0') then count<="00000000"; enfen_1<='0'; elsif(clk'event and clk='1') then if(count(3 downto 0)="1001") then if(count<16#60#) then if(count="01011001") then count<="00000000"; enfen_1<='1'; else count<=count+7; end if; else count<="00000000"; enfen_1<='0'; end if; elsif(count<16#60#) then count<=count+1; enfen_1<='0'; else count<="00000000"; enfen_1<='1'; end if; end if; end process; end fun; (2)秒计数器(miao)仿真波形图 (3)秒计数器(miao)仿真分析 随着 clk 脉冲信号的不断到来,countmiao 记录出 clk 的脉冲个数,计数 到 59 时,在下一个 clk 脉冲信号到来时,输出端 enfen 输出高定平,即向分进 位,同时 countmiao 清零。 2、 reset 为清零端, reset 低电平时, 当 countmiao 计数从零重新开始计数。 3、setfen 为分的手动进位端,当 setfen 高定平时且 clk 脉冲到来时,输出 enfen 高电平,向分进位。 2.  (1)分计数器(fen)VHDL 程序描述 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fen is port( imiao,clk,reset,setshi:in std_logic; enshi:out std_logic; countfen:out std_logic_vector(7 downto 0) ); end fen; architecture fun of fen is signal enshi_1,enshi_2:std_logic; signal count:std_logic_vector(7 downto 0); begin countfen<=count; enshi_2<=(setshi and clk); enshi<=(enshi_1 or enshi_2); process(imiao,reset,setshi) begin if(reset='0') then count<="00000000"; elsif(imiao'event and imiao='1') then if(count(3 downto 0)="1001") then if(count<16#60#) then if(count="01011001") then count<="00000000"; enshi_1<='1'; else count<=count+7; end if; else count<="00000000"; end if; elsif(count<16#60#) then count<=count+1; enshi_1<='0'; else count<="00000000"; end if; end if; end process; end fun; (2)分计数器(fen)仿真波形图 (3)分计数器(fen)仿真分析 imiao 为秒计数器的 enfen 进位输出端,当 enfen(imiao)高电平到来 时, clk 高电平时, 且 countfen 开始计数。 countfen 计数到 59 时, 下一个 enfen (imiao)、clk 到来时,enshi 高电平,即向时进位,同时 countfen 清零。 2、reset 为清零端,当 reset 低电平时,countfen 计数从零重新开始计数。 3、setshi 为时的手动进位端,当 setshi 高定平时且 clk 脉冲到来时,输出 en 时高电平,向时进位。 3.(1)时计数器(shi)VHDL 程序描述 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity shi is port( ifen,reset:in std_logic; countshi:out std_logic_vector(7 downto 0) ); end shi; architecture fun of shi is signal count:std_logic_vector(7 downto 0); begin countshi<=count; process(ifen,reset) begin if(reset='0') then count<="00000000"; elsif(ifen'event and ifen='1') then if(count(3 downto 0)="1001") then if(count<16#23#) then count<=count+7; else count<="00000000"; end if; elsif(count<16#23#) then count<=count+1; else count<="00000000"; end if; end if; end process; end fun; (2)时计数器(shi)仿真扫描显示译码器(saomiao)仿真 (3)时计数器(shi)仿真分析 ifen 为分计数器的 enshi 进位输出端,当 enshi(ifen)为高电平时, countshi 计数。countshi 计数到 23 时,当下一个 enshi(ifen)、clk 到来时, countshi 会自动清零。 2、reset 为清零端,当 reset 低电平时,countfen 计数从零重新开始计数。 4.整点报时 (1)整点报时器(baoshi)VHDL 程序描述 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entitybaoshi is port( clk:in std_logic; inputmiao,inputfen:in std_logic_vector(6 downto 0); output:out std_logic_vector(1 downto 0) ); end baoshi; architecture fun of baoshi is signal temp:std_logic_vector(1 downto 0); signal nummiao,numfen:std_logic_vector(7 downto 0); begin nummiao<=inputmiao; numfen<=inputfen; output<=temp; process(clk,temp) begin if(clk'event and clk='1') then if(numfen="01011001") then case nummiao is when"01011000"=>temp<="01"; when"01011001"=>temp<="10"; when others=>temp<="00"; end case; end if; if(numfen="00000000") then case nummiao is when"00000000"=>temp<="11"; when others=>temp<="00"; end case; end if; end if; end process; end fun; 11 (2)整点报时器(baoshi)仿真波形图 (3)整点报时器(baoshi)仿真分析 input 为分计数器的输出端,当输出 58、59 和 00(十六进制)时,整点报 时器(baoshi)的输出端 output 为高电平,点亮 LED 灯。当 intput 为 58、59 时,点亮一个 LED 灯,当 input 为 00 时,点亮两个 LED 灯。其他情况时,LED 灯均不发光。 4. (1)分频器(fenpin)设计       library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fenpin is port( clk_5M:in std_logic; clk:out std_logic ); end fenpin; architecture fun of fenpin is signal count:std_logic_vector(22 downto 0); begin process(clk_5M) begin if (clk_5M'event and clk_5M='1') then if(count="10011000100101100111111") then count<="00000000000000000000000"; clk<='1'; else count<= count+1; clk<='0'; end if; end if; end process; end fun; 5. (1)扫描显示译码器(saomiao))VHDL 程序描述 扫描显示译码器是用来显示时钟数值的装置,将数字时钟的高低电平信号用 数码管的数值显示出来。八个数码管中,用六个数码管显示时、分和秒,另外两 个可做为时和分、分和秒之间的间隔,始终不显示。 首先对八个数码管进行扫描,每一时刻都只有一个数码管处于扫描状态,并 将此时的数字时钟的高低电平通过十六进制的 BCD 码转换为数码管显示数值。 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity saomiao is port( clk_smxs:in std_logic; shi:in std_logic_vector(7 downto 0); fen:in std_logic_vector(7 downto 0); miao:in std_logic_vector(7 downto 0); selout:out std_logic_vector(7 downto 0); segout:out std_logic_vector(6 downto 0) ); end saomiao; architecture fun of saomiao is signal temp:std_logic_vector(2 downto 0); signal seg:std_logic_vector(6 downto 0); signal sel:std_logic_vector(7 downto 0); begin selout<=sel; segout<=seg; process(clk_smxs) variable num:std_logic_vector(3 downto 0); begin if (clk_smxs'event and clk_smxs='1' ) then if temp>="111" then temp<="000"; else temp<=temp+1; end if; case temp is when "111" =>num:=shi(7 downto 4); sel<="00000111"; when "110" =>num:=shi(3 downto 0); sel<="00000110"; when "100" =>num:=fen(7 downto 4); sel<="00000100"; when "011" =>num:=fen(3 downto 0); sel<="00000011"; when "001" =>num:=miao(7 downto 4); sel<="00000001"; when "000" =>num:=miao(3 downto 0); sel<="00000000"; when others=>sel<="00000010"; end case; case num is when"0000"=>seg<="0111111"; when"0001"=>seg<="0000110"; when"0010"=>seg<="1011011"; when"0011"=>seg<="1001111"; when"0100"=>seg<="1100110"; when"0101"=>seg<="1101101"; when"0110"=>seg<="1111101"; when"0111"=>seg<="0000111"; when"1000"=>seg<="1111111"; when"1001"=>seg<="1101111"; when others=>seg<="0000000"; end case; end if; end process; end fun; (2)扫描显示译码器(saomiao)仿真波形图 6.数字时钟整体设计 、数字时钟整体设计: (1)数字时钟的电路原理图: (3)数字时钟整体设计: 时钟脉冲源为 EDA 实验箱中的 5MHz 的脉冲信号,用于分频器的输入信号和 扫描显示译码器的扫描。分频器的功能是将 5MHz 的脉冲信号转换为 1Hz 的时钟 信号,用于秒的计数。 秒为 60 进制计数器,当 1Hz 的脉冲信号来临时,开始计数。计数到 59 时, 会输出 enfen 高电平,用于分的计数。setfen 为手动进位端,置入高电平时也 会使 enfen 产生高电平。分计数器为 60 进制计数器,当 enfen 高电平来临时, 分计数器会开始计数,计数到 59 时,会产生 enshi 的高电平。setshi 为手动置 数端,当 setshi 高定平时,也会使 enshi 为高电平。enshi 为时计数器的计数 脉冲输入,enshi 高电平时,时计数器开始计数。时计数器为 24 进制计数器, 计数到 24 时会自动清零。reset 为异步清零端,高定平时,所有时钟显示数码 管均为 0。 selout 为数码管扫描地址,接入数码管地址的低三位。segout 为数码管的 输入端,分别接入数码管的 a,b,c,d,e,f,g 端口。 output 为整点报时输出端。 当分为 59, 秒为 58 时, output1 点亮第一个 LED 灯,当分为 59,秒为 59 时,output2 点亮地二个 LED 灯,当分为 00,秒为 00 时,output1、output2 同时点亮两个 LED。其他情况时,LED 均处于灭等状态。 这样完成报时功能。 6.数字时钟设计总结 、数字时钟设计总结 本次实习最主要的收获是:使我们对 EDA 设计有一定的感性和理性 认识;培养和锻炼我们的实际动手能力。使我们的理论知识与实践充分地结合, 作到不仅具有专业知识,而且还具有较强的实践动手能力,能分析问题和解决问 题的高素质人才,为以后的顺利就业作好准备。 本次实习的对我们很重要,是我们通信工程学生实践中的重要环节。在以 前我们学的都是一些理论知识。这一次的实习正如老师所讲,没有多少东西要我 们去想,更多的是要我们去做,好多东西看起来十分简单,看着电路图都懂,但 没有亲自去操作,就不会懂得理论与实践是有很大区别的。看一个东西简单,但 在实际操作中就是有许多要注意的地方,有些东西也与你的想象不一样,我们这 次的实验就是要我们跨过这道实际和理论之间的鸿沟。不过,我坚信自己的是有 一定能力的。以前我们光只注意一些理论知识,并没有专门的练习我们的实际动 手能力。 这次的实习使我意识到我的操作能力的不足, 在理论上也有很多的缺陷。 所以,在以后的学习生活中,我需要更努力地读书和实践。 7 参考文献 1.辛春燕.VHDL 程序描述语言.北京:国防工业出版社,2002  2.包明, 赵明富, 陈泽光.EDA 技术汲取应用.北京: 北京航空航天大学出版社, 2004 3.马淑华,高原.电子设计自动化.北京:北京邮电大学出版社,2006 4.周立功.EDA 实验与实践. 北京:北京航空航天大学出版社,2009 5.罗中华,杨戈. EDA 与可编程实验教程.重庆:重庆大学出版社,2007 文档已经阅读完毕,请返回上一页!
本文档为【EDA数字时钟设计】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
该文档来自用户分享,如有侵权行为请发邮件ishare@vip.sina.com联系网站客服,我们会及时删除。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。
本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。
网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。
下载需要: 免费 已有0 人下载
最新资料
资料动态
专题动态
is_569018
暂无简介~
格式:doc
大小:158KB
软件:Word
页数:11
分类:生活休闲
上传时间:2017-09-19
浏览量:69