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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

VHDL数字钟设计报告001.docx

1、VHDL数字钟设计报告001VHDL数字钟设计报告一.数字钟总体设计方案:1.1设计目的正确显示时、分、秒;可手动校时,能分别进行时、分的校正; 整点报时功能;1.2设计思路数字钟的设计模块包括:分频器、去抖动电路、校时电路、“时、分、秒”计数器、校时闪烁电路、整点报时和译码显示电路。每一个功能模块作为一个实体单独进行设计,最后再用VHDL的例化语句将各个模块进行整合,生成顶层实体top。 该数字钟可以实现3个功能:计时功能、设置时间功能和报时功能。二数字钟模块细节 2.1 分频器(fenpin) 本系统共需3种频率时钟信号(1024Hz、512Hz、1Hz)。为减少输入引脚,本系统采用分频模

2、块,只需由外部提供1024Hz基准时钟信号,其余三种频率时钟信号由分频模块得到。 分频原理:为以1024Hz基准时钟经1024分频得到512Hz,1Hz频率时钟信号。 分频器管脚 代码:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all; use ieee.std_logic_arith.all;entity fenpin is port(clk1024:in std_logic; clk1,clk512:out std_logic );end fenpin ; architecture cml of

3、 fenpin is begin process (clk1024) variable count1: integer range 0 to 512; variable q1: std_logic; begin if clk1024 event and clk1024=1 then if count1=512 then q1:=not q1; count1:=0; else count1:=count1+1; end if; end if; clk1=q1; end process; process(clk1024) variable count512: integer range 0 to

4、1; variable q512: std_logic; begin if clk1024 event and clk1024=1 then if count512=1 then q512:=not q512; count512:=0; else count512:=count512+1; end if; end if; clk512=q512; end process;end cml; 22 校时电路(jiaoshi)本模块要实现的功能是:正常计时、校时、校分在每个状态下都会产生不同控制信号实现相应的功能。校时管脚图代码:library ieee;use ieee.std_logic_116

5、4.all;use ieee.std_logic_unsigned.all;entity jiaoshi is port(rst,rvs,select_rvs,mtime,mclkin,hclkin:in std_logic; hclkout,mclkout:out std_logic ); end jiaoshi; architecture cml of jiaoshi is signal h_m:std_logic; begin p1:process(rst,rvs,hclkin,mclkin,h_m,mtime) begin if rst=0 then null; elsif rvs=1

6、 then hclkout=hclkin; mclkout=mCLKin; elsif h_m=0 then hclkout=hclkin; mclkout=mtime; else hclkout=mtime;mclkout=mclkin; end if; end process;p2:process(select_rvs) begin if select_rvsevent and select_rvs=1 then h_m=not h_m; end if; end process ; end cml;管脚图仿真图2.3 时计数器(hour)分计数器(mine)秒计数器(second) 时计数

7、器管脚图 时代码: library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity hour isport(rst,hclk:in std_logic; hour0,hour1:buffer std_logic_vector(3 downto 0 ) );end hour;architecture cml of hour is beginprocess(rst,hclk,hour0,hour1) begin if rst=0 then hour0=0000; hour1=0000; elsif hc

8、lkevent and hclk=1 then if hour0=0011 and hour1=0010 then hour0=0000; hour1=0000; elsif hour0=1001 then hour0=0000; hour1=hour1+1; else hour0=hour0+1; end if; end if; end process ; end cml; 分计数器管脚图分代码:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity mine isport(rst,mcl

9、k:in std_logic; mco:out std_logic; min0,min1:buffer std_logic_vector(3 downto 0 ) );end mine;architecture cml of mine issignal min0_t,min1_t:std_logic_vector(3 downto 0 ); beginprocess(rst,mclk,min0,min1) begin if rst=0 then min0=0000; min1=0000; elsif mclkevent and mclk=1 then if min0=0101 and min1

10、=1001 then min0=0000; min1=0000; mco=1; elsif min0=0010 and min0=1001 then min1=0011; min0=0000; mco=0; elsif min0=1001 then min1=min1+1; min0=0000; else min0=min0+1; end if; end if; end process ; end cml; 秒计数器管脚图 秒代码:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity se

11、cond isport(rst,sclk:in std_logic; sco:out std_logic; sec0,sec1:buffer std_logic_vector(3 downto 0 ) );end second;architecture cml of second issignal sec0_t,sec1_t:std_logic_vector(3 downto 0 ); beginprocess(rst,sclk,sec0,sec1) begin if rst=0 then sec0=0000; sec1=0000; elsif sclkevent and sclk=1 the

12、n if sec0=0101 and sec1=1001 then sec0=0000; sec1=0000; sco=1; elsif sec0=0010 and sec0=1001 then sec1=0011; sec0=0000; sco=0; elsif sec0=1001 then sec1=sec1+1; sec0=0000; else sec0=sec0+1; end if; end if; end process ; end cml; 2.4 校时闪烁电路(flashnjiaoshi)如果正在进行校时,flashjiaoshi将实现使当前正在校时项(小时或分钟)以1Hz的频率

13、闪烁,以便于操知道正在被校正。 校时闪烁电路管脚图代码:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity flashjiaoshi isport(rst,sclk,rvs,select_rvs:in std_logic; hour0in,hour1in,min0in,min1in:in std_logic_vector(3 downto 0 ); hour0out,hour1out,min0out,min1out :out std_logic_vector(3 downto 0 ) )

14、;end flashjiaoshi;architecture cml of flashjiaoshi is signal h_m:std_logic; begin p1:process(rst,sclk,rvs,hour0in,hour1in,min0in,min1in,h_m) begin if rst=0 then null; elsif rvs=1 then hour0out=hour0in; hour1out=hour1in; min0out=min0in; min1out=min1in; elsif h_m=0 then hour0out=hour0in; hour1out=hour

15、1in; if sclk=1 then min0out=min0in; min1out=min1in; else min0out=1111; min1out=1111; end if; else min0out=min0in; min1out=min1in; IF sCLK=1 then hour0out=hour0in; hour1out=hour1in; else hour0out=1111; hour1out=1111; end if; end if;end process p1;p2:process(select_rvs) begin if select_rvsevent and se

16、lect_rvs=1 then h_m=not h_m;end if;end process p2;end cml; 2.5 整点报时电路 整点报时管脚图 代码:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity baoshi is port( clk1024,clk512 : in std_logic; min0,min1 , sec0,sec1 : in std_logic_vector (3 downto 0); speak : out std_logic); end baoshi

17、;architecture cml of baoshi is beginspeakdata=h1;select_sigdata=h0;select_sigdata=m1;select_sigdata=m0;select_sigdata=s1;select_sigdata=s0;select_sigdata=1000;select_sig=111111; end case; if order=101 then order=000; else orderseg7 seg7 seg7 seg7 seg7 seg7 seg7 seg7 seg7 seg7 seg7 clk1024,clk512=sca

18、nCLKSig,clk1=secCLKSig);U2: jiaoshi PORT MAP(rst=reset, rvs=key, select_rvs=keyin(0), mtime=keyin(1), hclkin=hCLKSig0,mclkin=mCLKSig0,hclkout=hCLKSig1,mclkout=mCLKSig1); U3:hour PORT MAP(rst=reset, hCLK=hCLKSig1, hour1=hour1Sig0, hour0=hour0Sig0); U4: minute PORT MAP(rst=reset, mclk=mCLKSig1, mco=hCLKSig0, min1=min1Sig0, min0=min0Sig0); U5: second PORT MAP(rst=reset, sCLK

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

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