利用VHDL语言设计的数字钟.doc

利用vhdl语言设计的数字钟

收藏

压缩包内文档预览:
预览图 预览图 预览图 预览图 预览图 预览图 预览图 预览图 预览图 预览图
编号:516979    类型:共享资源    大小:143.36KB    格式:RAR    上传时间:2015-11-12 上传人:QQ28****1120 IP属地:辽宁
3.6
积分
关 键 词:
毕业设计论文
资源描述:
利用vhdl语言设计的数字钟,毕业设计论文
内容简介:
SIPIVT PLD 技术课程设计 第 1 页 (共 10 页 ) 一、题目 :数字钟 二、设计目的 掌握各类计数器和分频器以及它们相连的设计方法;掌握多个数码管的原理与方法;掌握 CPLD 技术的层次化设计的方法;掌握使用 VHDL 语言的设计思想;对整个系统的设计有一个了解。 三、设计系统环境 ( 1)一台 PC 机; ( 2)一套 GW48 型 EDA 实验开发系统硬件; ( 3) X+PLUS 集成化的开发系统硬件。 四、设计要求 ( 1) 能进行正常的时、分、秒计时功能,分别由 6 个数码管显示 24h、 60min、60s。 ( 2) 按下 sa 键时,计时器迅速递增,并按 24h 循环,计时满 23h 后回 00。 ( 3) 按 下 sb 键时,计时器迅速递增,并按 60min 循环,计时满 59min 后回 00。 ( 4)输入的时钟信号为 3MHz。 五、总体框图 ntsSIPIVT PLD 技术课程设计 第 2 页 (共 10 页 ) 六、模块及模块功能 (1) 模块 CNT60_2 该模块为 60 进制计数器,计时输出为秒的数值,在计时到 59 时送出进位信号 CO,因为硬件有延时,所以模块 CNT60_2 在此模块变为 00 时加 1,符合实际。 A、模块 B、程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt60_2 is port(clk:in std_logic; s1,s0:out std_logic_vector(3 downto 0); co:out std_logic); end cnt60_2; architecture behav of cnt60_2 is begin process(clk) variable cnt1,cnt0:std_logic_vector(3 downto 0); begin if clkevent and clk=1 then if cnt1=0101 and cnt0=1000 then co=1; cnt0:=1001; elsif cnt01001 then cnt0:=cnt0+1; else cnt0:=0000; if cnt10101 then cnt1:=cnt1+1; else cnt1:=0000; co=0; end if; end if; end if; s1=cnt1; s0=cnt0; end process; end behav; ntsSIPIVT PLD 技术课程设计 第 3 页 (共 10 页 ) C、流程图 D、波形仿真 ( 2)模块 CNT60_1 该模块为 60 进制计数器,计时输出为分的数值,在 EN 信号有效且时钟到来时,计数器加 1。在 sb 按下时, EN 信号有效,计数值以秒的速度增加,从ntsSIPIVT PLD 技术课程设计 第 4 页 (共 10 页 ) 而实现对分钟的设置。 A、 模块 B、程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt60_1 is port(en,clk:in std_logic; min1,min0:out std_logic_vector(3 downto 0); co:out std_logic); end cnt60_1; architecture behav of cnt60_1 is begin process(clk) variable cnt1,cnt0:std_logic_vector(3 downto 0); begin if clkevent and clk=1 then if en=1 then if cnt1=0101 and cnt0=1000 then co=1; cnt0:=1001; elsif cnt01001 then cnt0:=cnt0+1; else cnt0:=0000; if cnt10101 then cnt1:=cnt1+1; else cnt1:=0000; co=0; end if; end if; end if; end if; min1=cnt1; min0=cnt0; end process; end behav; C、流程图 ntsSIPIVT PLD 技术课程设计 第 5 页 (共 10 页 ) D、波形仿真 ntsSIPIVT PLD 技术课程设计 第 6 页 (共 10 页 ) (2) 模块 CNT24 该模块为 24 进制计数器,计时输出为小时的数值,在 EN 信号有效且时钟到来时,计数器加 1。在 sa 按下时, EN 信号有效,计数值以秒的速度增加,从而实现对时钟的设置。 A、模块 B、程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity cnt24 is port(en,clk:in std_logic; h1,h0:out std_logic_vector(3 downto 0); end cnt24; architecture behav of cnt24 is begin process(clk) variable cnt1,cnt0:std_logic_vector(3 downto 0); begin if clkevent and clk=1 then if en=1 then if cnt1=0010 and cnt0=0011 then cnt0:=0000; cnt1:=0000; elsif cnt01001 then cnt0:=cnt0+1; else cnt0:=0000; cnt1:=cnt1+1; end if; end if; end if; h1=cnt1; h0=cnt0; end process; end behav; C、流程图 ntsSIPIVT PLD 技术课程设计 第 7 页 (共 10 页 ) D、波形仿真 ntsSIPIVT PLD 技术课程设计 第 8 页 (共 10 页 ) (3) 模块 FPQ 该模块的输入为 3MHz 方波,输出为 1kHz 的方波。 A、模块 B、程序 library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_unsigned.all; entity fpq is port(clk:in std_logic; q:out std_logic); end fpq; architecture behav of fpq is signal x:std_logic; begin process(clk) variable cnt:integer range 0 to 1499999; begin if clkevent and clk=1 then if cnt1499999 then cnt:=cnt+1; else cnt:=0; x=not x; end if; end if; q=x; end process; end behav; B、 流程图 ntsSIPIVT PLD 技术课程设计 第 9 页 (共 10 页 ) 七、管脚分配(选择模式 7) 输入: clk 84 输出: s00 27 sa 16 s01 28 sb 9 s02 29 s03 30 s10 35 s11 36 s12 37 s13 38 min00 39 min01 47 min02 48 min03 49 min10 50 min11 51 min12 52 min13 53 h00 54 h01 58 ntsSIPIVT PLD 技术课程设计 第 10 页 (共 10 页 ) h02 59 h03 60 h10 61 h11 62 h12 64 h13 65 八、调试使用说明 ( 1) 输入 60 进制计数器(秒)、 60 进制计数器(分)、 24 进制计数器、3MHz1kHz 分频器四个程序,并编译、波形仿;然后生成器件。 ( 2) 画原理图:找到第一步生成的器件,并将它们调入原理图编辑窗中,然后完成数字钟的原理图设计。
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
提示  人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。
关于本文
本文标题:利用vhdl语言设计的数字钟
链接地址:https://www.renrendoc.com/p-516979.html

官方联系方式

2:不支持迅雷下载,请使用浏览器下载   
3:不支持QQ浏览器下载,请用其他浏览器   
4:下载后的文档和图纸-无水印   
5:文档经过压缩,下载后原文更清晰   
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

网站客服QQ:2881952447     

copyright@ 2020-2025  renrendoc.com 人人文库版权所有   联系电话:400-852-1180

备案号:蜀ICP备2022000484号-2       经营许可证: 川B2-20220663       公网安备川公网安备: 51019002004831号

本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知人人文库网,我们立即给予删除!