ImageVerifierCode 换一换
格式:DOCX , 页数:23 ,大小:219.28KB ,
资源ID:3287134      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/3287134.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(数字时钟显示实验报告.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

数字时钟显示实验报告.docx

1、数字时钟显示实验报告实验名称:数字时钟设计实验仪器及软件:计算机,QUARTAS。实验目的:1全面了解如何应用该硬件描述语言进行高速集成电路设计;2.通过对数字时钟软件设计环节与仿真环节熟悉Quartus II设计与仿真环境;3. 通过对数字时钟的设计,掌握硬件系统设计方法(自底向上或自顶向下),熟悉VHDL语言三种设计风格,熟悉其芯片硬件实现的过程。4 体会硬件设计语言在工程中的重要性。全面掌握设计方法和过程。实验要求:设计一个数字时钟,并输出到数码管显示时,分,秒。实验原理:A 整体系统实行自顶下的原则,通过顶层实体分别串接各个设计部件,各个部件接口通过端口映射的方式进行串接,从而达到设计

2、目的。B 整个程序中涉及的部件有:(1)分频器,对输入时钟40Mhz进行40000000分频,得到1Hz信号,作为计数器的计数时钟;对输入时钟40Mhz进行400000分频,得到100Hz信号,作为数码显示管位扫描信号(2)计数器,用24进制计数器作为小时位的计数,用60进制计数器作为分位,秒位的计数。(3)位选程序,实现六个数码显示管动态扫描显示,(4)LED显示程序:用于显示信号在数码管。(5)顶层模块实体部分,指明了输入输出端口,各部分的联系和链接,以及通过端口映射连接各部分,实现整个程序功能。C 关于动态显示,扫描频率设置为100HZ,这个频率大于要求的50HZ,利用人眼的视觉暂留效果

3、,则看不到闪烁现象,可以实现动态显示功能。D 在计数器的时钟选择上,选择的是1HZ频率,满足了每秒一次的要求。设计思路及VHDL代码E两个模60的计数器来代表时钟的秒针,分针,再用一个模23的计数器来代替时针。外部基础时钟信号作为秒针计数器的时钟信号,秒针计数器的近进位信号作为分针计数器的时钟信号,分针计数器的进位信号有作为时针计数器的时钟信号,最后在统一输出。需要注意的是到23时59分59秒后下次跳动清零,从头开始。基础时钟信号选择1HZ最为简单。我们做了以40MHZ为基础时钟信号的时钟,主要要点在将40MHZ分频到1HZ。下面通过原理结构图描述系统 一,顶层实体模块源代码数字钟的顶层模块程

4、序 clock.vhd library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity clock isport(clk :in std_logic; set :in std_logic; qin_s_1 : in std_logic_vector(3 downto 0); -秒钟的低位调整输入端 qin_s_2 : in std_logic_vector(3 downto 0); -秒钟的高位调整输入端 qin_m_1 : in std_l

5、ogic_vector(3 downto 0); -分钟的低位调整输入端 qin_m_2 : in std_logic_vector(3 downto 0); -分钟的高位调整输入端 qin_h_1 : in std_logic_vector(3 downto 0); -时钟的低位调整输入端 qin_h_2 : in std_logic_vector(3 downto 0); -时钟的高位调整输入端 qout : out std_logic_vector(6 downto 0); -7段码输出 sel : out std_logic_vector(5 downto 0) -位选输出端 );en

6、d clock;architecture behave of clock iscomponent cnt24 is port(clk : in std_logic; set : in std_logic; din1 : in std_logic_vector(3 downto 0); din2 : in std_logic_vector(3 downto 0); qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0);end component cnt24;component cnt6

7、0 is port(clk : in std_logic; set : in std_logic; din1 : in std_logic_vector(3 downto 0); din2 : in std_logic_vector(3 downto 0); qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0); carry : out std_logic);end component cnt60;component fen1 is port(clk:in std_logic; qo

8、ut:out std_logic);end component fen1;component fen100 is port(clk:in std_logic; qout:out std_logic);end component fen100;component weixuan is port(clk : in std_logic; qin1 : in std_logic_vector(3 downto 0); qin2 : in std_logic_vector(3 downto 0); qin3 : in std_logic_vector(3 downto 0); qin4 : in std

9、_logic_vector(3 downto 0); qin5 : in std_logic_vector(3 downto 0); qin6 : in std_logic_vector(3 downto 0); qout : out std_logic_vector(3 downto 0); sel : out std_logic_vector(5 downto 0); end component weixuan;component led_driv is port(qin : in std_logic_vector(3 downto 0); qout : out std_logic_vec

10、tor(6 downto 0);end component led_driv;signal carry1: std_logic;signal carry2: std_logic;signal qout1 : std_logic;signal qout100 : std_logic;signal qout_s_1:std_logic_vector(3 downto 0);signal qout_s_2:std_logic_vector(3 downto 0);signal qout_m_1:std_logic_vector(3 downto 0);signal qout_m_2:std_logi

11、c_vector(3 downto 0);signal qout_h_1:std_logic_vector(3 downto 0);signal qout_h_2:std_logic_vector(3 downto 0);signal qoutI:std_logic_vector(3 downto 0);beginU0:fen1 port map(clk=clk,qout=qout1);U1:fen100 port map(clk=clk,qout=qout100);U2:cnt60 port map(clk=qout1,set=set,din1=qin_s_1,din2=qin_s_2,qo

12、ut1=qout_s_1,qout2=qout_s_2,carry=carry1);U3:cnt60 port map(clk=carry1,set=set,din1=qin_m_1,din2=qin_m_2,qout1=qout_m_1,qout2=qout_m_2,carry=carry2);U4:cnt24 port map(clk=carry2,set=set,din1=qin_h_1,din2=qin_h_2,qout1=qout_h_1,qout2=qout_h_2);U5:weixuan port map(clk=qout100,qin1=qout_s_1,qin2=qout_s

13、_2,qin3=qout_m_1,qin4=qout_m_2,qin5=qout_h_1,qin6=qout_h_2,qout=qoutI,sel=sel);U6:led_driv port map(qin=qoutI,qout=qout);end behave;这部分实现的是顶层实体,它是程序的核心,通过端口映射把其他各部件程序端口连接为一个整体,指明系统的输入端口,输出端口,输入型号,输出信号。二,分频部分1,功 能:对输入时钟40Mhz进行40000000分频,得到1Hz信号接 口:clk -时钟输入 qout-秒输出信号library ieee;use ieee.std_logic_1

14、164.all;entity fen1 isport(clk:in std_logic; qout:out std_logic);end fen1;architecture behave of fen1 isconstant counter_len:integer:=10#39999999#;signal cnt:integer range 0 to counter_len;begin process(clk) begin if clkevent and clk=1 then case cnt is when 0 to counter_len/2=qoutqout=1; end case; i

15、f cnt=counter_len then cnt=0; else cntqoutqout=1; end case; if cnt=counter_len then cnt=0; else cntqout=qin1; selqout=qin2; selqout=qin3; selqout=qin4; selqout=qin5; selqout=qin6; selqout=0000; sel=111111; end case; if cnt=5 then cnt:=0; else cnt:=cnt+1; end if; end if; end process;end behave; 这部分程序

16、实现的是位选功能,用于动态显示,调整秒位,分位,时位。四,计数器的设计功 能:24进制计数器-接 口:clk -时钟输入- set -时间使能端- din1 -个位数据预置输入- din2 -十位数据预置输入- qout1-个位BCD输出- qout2-十位BCD输出library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity cnt24 is port(clk : in std_logic; set : in std_logic; din

17、1 : in std_logic_vector(3 downto 0); din2 : in std_logic_vector(3 downto 0); qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0);end cnt24;architecture behave of cnt24 issignal tem1:std_logic_vector(3 downto 0);signal tem2:std_logic_vector(3 downto 0);begin process(clk

18、,set,din1,din2) begin if set=1 then tem1=din1; tem2=din2; elsif clkevent and clk=1 then if (tem2=0010 and tem1=0011) then tem1=0000; tem2=0000; elsif(tem2/=0010 and tem1=1001) then tem2=tem2+1; tem1=0000; else tem2=tem2; tem1=tem1+1; end if; end if; end process; qout1=tem1; qout2=tem2;end behave;这部分

19、设计了一个24进制计数器,用于小时位的计数,解决了时钟位显示的问题。-功 能:24进制计数器-接 口:clk -时钟输入- set -时间使能端- din1 -个位数据预置输入- din2 -十位数据预置输入- qout1-个位BCD输出- qout2-十位BCD输出-library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity cnt24 is port(clk : in std_logic; set : in std_logic; di

20、n1 : in std_logic_vector(3 downto 0); din2 : in std_logic_vector(3 downto 0); qout1 : out std_logic_vector(3 downto 0); qout2 : out std_logic_vector(3 downto 0);end cnt24;architecture behave of cnt24 issignal tem1:std_logic_vector(3 downto 0);signal tem2:std_logic_vector(3 downto 0);begin process(cl

21、k,set,din1,din2) begin if set=1 then tem1=din1; tem2=din2; elsif clkevent and clk=1 then if (tem2=0010 and tem1=0011) then tem1=0000; tem2=0000; elsif(tem2/=0010 and tem1=1001) then tem2=tem2+1; tem1=0000; else tem2=tem2; tem1=tem1+1; end if; end if; end process; qout1=tem1; qout2qoutqoutqoutqoutqou

22、tqoutqoutqoutqoutqoutNULL; end case; end process;end behave; -这部分的设计用于数码管上的显示,动态扫描的频率用100HZ,这个频率是分频得到的。解决了数字显示的问题。实验结果和分析数字时钟显示仿真图整体输入输出数字时钟显示仿真如上图所示,clk1为外部输入时钟信号为,qout依次为时钟各位对应数码管的信号.图二所示数码管上显示。二十四进制计数器仿真图六十进制计数器仿真图100HZ分频器仿真图 位选部分仿真图LED显示仿真图故障排除及问题分析1, 开始时,分频器没有设计,直接将现有频率加入,没有显示出结果,后反复思考,加入了分频器部分,重新将端口调整,成功显示出了结果。2, 在老师的指导下,有加入了报时功能,事先选择的是将到12:00:00直接送一个信号给输出端,事先报时,设计程序如下library ieee;

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1