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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

基于VHDL的数字钟设计及其仿真.docx

1、基于VHDL的数字钟设计及其仿真基于VHDL的数字钟设计及其仿真结构化设计元件例化配置原理图一 引言所谓数字钟是指利用电子电路构成的计时器, 相对机械钟而言,数字钟能达到准确计时,同时能对该种进行调整。当然,在此基础上还能够实现整点报时,定时报闹等功能。设计过程采用系统设计的方法, 先分析任务得到系统要求, 然后进行总体设计, 划分子系统,然后进行详细设计,决定各个功能子系统的 VHDL程序,最后进行调试仿真。通过此次设计,对基于 VHDL的结构化描述有深刻理解,为今后的集成电路设计打下 坚实的基础。二设计任务和要求对于时钟,最基本的要求应具有时分秒的计数功能。对于秒必须满足每满 60s,分要

2、记一个数,并且秒重新从零计起;对于分必须满足 60min,小时要记一个数,并且分重新从零计起,对于时满24后也应重新从零计起。此外当数字中走慢或走快时,还应能予以调整。 所以要求设计的数字中电路应具有以下功能:1.具有十分秒计数功能,并进行十进制数字显示。2.能分别进行时分的手动校正。三工作原理时钟信号的频率有振荡器产生,由于技术最小单位为 1s,所以时钟信号经分频器后输出频率为1Hz的秒脉冲elk ;而校准信号的频率应高于 1Hz,若取0.5,则时钟信号经另一 个分频器后输出频率为 2Hz的校准信号脉冲 clk1。当无校准信号作用,即校分信号 xf、校时信号xs为高电平,整个电路处于正常计数

3、的工作状态时分秒计数器采用同步计数方式其时钟脉冲端均接有分频器输出的时钟信号 elk.。en为使能端,高电平有效。三个计数器的复位端 elr置入数据控制端Id都接高电平,故其置 入端d70失效,且各计数器输出端分别接译码显示电路。当有校准信号时,不妨假设只有校分信号,即 xf=O、xf=1,则在二选一数据选择器的控制下,分计数器的 en端将始终接高电平,即分计数器将独立于秒计数器自行独立计数,但 其结果仍影响到时计数器,因为此时没有校时信号。同理,当只有校时信号或同时具有校时、 校分信号,情况同上述分析一样。四 各个模块的VHDL仿真图以及计数部分校正仿真图(图一、无时间调整下数字钟的仿真运行

4、图)(图二、利用xs信号校对时间的小时数的仿真结果图)六十进制计数电路模块对应的仿真波形如下图所示了, elk为时钟脉冲,clr为复位端,en为使能控制端,Id位并行置数输入端,ql、qh和co分别为六十进制计数器的个位十位和 进位输出,由仿真波形可以看出,个位 ql每从09计10个数,十位qh计一个数,当qh每计到5时,进位co输出一个脉冲,说明计数器没来 60个elk时钟脉冲,进位 co产生一个脉冲,实现六十进制计数。(图四、带有异步清零和置数功能的 60进制计数器元件仿真图)二分频电路所对应的仿真波形如下图所示, clr为复位端,elk为2Hz时钟脉冲,当clr为1时,二分频电路有效,c

5、nt=2clk,实现了分频作用。一VA M ISC ZMMB l Qht. MO Mt Ml Cr* 450*4 t(N Mt 血叶 MO Qh*cMir 、11jyyYyyyyqr jwmwir _rui(图五、对时钟的二倍分频元件仿真图)2选1数据选择器模块对应的仿真波形如下图所示,有仿真波形可以看出,当选择输入(图六、2选1数据选择元件仿真图)TSOOtti XH Om Oh* 1 1 * I 50 An tHGri ISO On 200 0mO_ d * 一 X MwuimuuuinnnnniuiiL(图七、D触发器元件仿真图)二十四进制计数电路模块对应的仿真波形如下图所示, 有仿真波

6、形可以看出, 计数器每来24个elk时钟脉冲,进位 co产生一个脉冲,实现了二十四进制计数。五整个过程各个模块VHDL源程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_ un sig ned.all;en tity coun ter isport(clk: in std_logic;xf: in std_logic;xs: in std_logic;co3:out std_logic;d1,d2,d3:in stdo gic_vector(7 dow nto 0); qh1,ql1,qh2,ql2,qh3,ql3:ou

7、t stdo gic_vector(3 dow nto 0);end coun ter;architecture rt1 of coun ter is comp onent cnt2port(clr:i n std_logic;clk:in std_logic; cn t:buffer std_logic);end comp onent;comp onent d_ffport(d:std_logic; clk:stdo gic;q:out stdo gic);end comp onent;comp onent mux21port(a,b,s:in std_logic;y:out std_log

8、ic);end comp onent;comp onent con 24vport(clk,e n,clr,ld:i n std_logic;d:i n std_logic_vector(7 dow nto 0);co:out std_logic;qh,ql :buffer std_logic_vector(3 dow nto 0);end comp onent;comp onent con 60vport(clk,e n,clr,ld:i n std_logic;d:i n std_logic_vector(7 dow nto 0);co:out std_logic;qh,ql:buffer

9、 std_logic_vector(3 dow nto 0);end comp onent;comp onent an d21port(a,b:in std_logic;y:out stdo gic);end comp onent;sig nal vcc,c nt,q1,q2:std_logic;sig nal y1_mux21,y_a nd,y2_mux21,co1,co2:std_logic;sig nal qh1_co n60v,ql1_co n60v,qh2_co n60v:stdo gic_vector(3 dow nto 0);sig nal ql2_co n60v,qh3_co

10、n24v,ql3_co n24v:stdo gic_vector(3 dow nto 0);beginvcc=1;comp1:c nt2 port map(vcc,clk,c nt);comp2:d_ff port map(xf,clk,q1);comp3:d_ff port map(xs,clk,q2);comp4:mux21 port map(vcc,co1,q1,y1_mux21);comp5:a nd21 port map(co1,co2,y_a nd);comp6:mux21 port map(vcc,y_a nd,q2,y2_mux21);comp7:c on 60v port m

11、ap(c nt,vcc,vcc,vcc,d1,co1,qh1_c on 60v,ql1_c on 60v); qh1=qh1_co n60v;ql1=ql1_co n60v;comp8:c on 60v port map(c nt,y1_mux21,vcc,vcc,d2,co2,qh2_c on 60v,ql2_c on 60v); qh2=qh2_con60v;ql2=ql2_co n60v;comp9:c on 24v port map(c nt,y2_mux21,vcc,vcc,d3,co3,qh3_c on 24v,ql3_c on 24v); qh3=qh3_con24v;ql3=q

12、l3_co n24v;end rt1; cnt21library ieee;use ieee.stdo gic_1164.all;en tity cnt2 isport(clr:i n std_logic;clk:in std_logic;cn t:buffer std_logic);end cn t2;architecture one of cnt2 isbeginprocess(clr,clk)beginif(clr=0) then cnt=1;elsif(clkeve nt and clk=0) the nif(cnt=1) the n cnt=0;else cn t=1;end if;

13、end if;end process;end one;con figurati on con_cnt2 of cnt2 isfor oneend for;end con_cn t2; cnt2 con24vlibrary ieee;use ieee.stdo gic_1164.all;use ieee.std_logic_ un sig ned.all;en tity con 24v isport(clk:in std_logic;en:in std_logic;clr:in std_logic;ld:in std_logic;d:i n std_logic_vector(7 dow nto

14、0);co:out std_logic;qh:buffer std_logic_vector(3 dow nto 0);ql:buffer std_logic_vector(3 dow nto 0);end con 24v;architecture bhv1 of con 24v isbeginco=1 whe n (qh=0010a nd ql=0011 and en=1) else O;process(clk,clr,ld)beginif(clr=O) thenqh=0000;ql=0000;elsif(clkeve nt and clk=1) the n if(ld=0) the nqh

15、=d(7 dow nto 4);ql=d(3 dow nto 0);elsif(e n=1) thenif(qh=0010 and ql=0011) then ql=0000;qh=OOOO;elseql=ql+1;if(ql9) thenql=ql+1;else ql=0000;if(qh2) then qh=qh+1;else qh=OOOO;end if;end if;end if;end if;end if;end process;end bhv1;con figurati on con_con 24v of con 24v isfor bhv1end for;end con_con2

16、4v; con24v con60vlibrary ieee;use ieee.stdo gic_1164.all;use ieee.std_logic_ un sig ned.all;en tity con 60v isport(clk:in std_logic;en:in std_logic;clr:in std_logic;ld:in std_logic;d:i n std_logic_vector(7 dow nto 0);co:out std_logic;qh:buffer std_logic_vector(3 dow nto 0);ql:buffer std_logic_vector

17、(3 dow nto 0);end con 60v;architecture bhv2 of con 60v isbeginco=1whe n(qh=0101a nd ql=1001a nd en=1)else 0; process(clk,clr,ld)beginif(clr=0) thenqh=0000;ql=0000;elsif(clkeve nt and clk=1) the nif(ld=0) the nqh=d(7 dow nto 0);ql=d(3 dow nto 0);elsif(e n=1) thenif(ql9)the n ql=ql+1;else ql=0000;if(q

18、h5) the n qh=qh+1;else qh=0000;end if;end if;end if;end if;end process;end bhv2;con figurati on con_con 60v of con 60v isfor bhv2end for;end con_con60v; con60v d_fflibrary ieee;use ieee.stdo gic_1164.all;en tity d_ff isport(d:in std_logic;clk:in std_logic;q: out std_logic);end d_ff;architecture bhv3

19、 of d_ff isbeginprocess(clk)beginif(clkeve nt and clk=1) the nq=d;end if;end process;end bhv3;con figurati on con_d_ff of d_ff isfor bhv3end for;end con _d_ff; d_ff mux21library ieee;use ieee.stdo gic_1164.all;en tity mux21 isport(a,b,s:in std_logic; y:out std_logic);end mux21;architecture bhv4 of m

20、ux21 isbeginy=a whe n s=0 else b;end bhv4;con figurati on con _mux21 of mux21 is for bhv4end for;end con _mux21; mux21 and21library ieee;use ieee.stdo gic_1164.all;en tity and21 isport(a,b:in std_logic;y:out stdo gic);end an d21;architecture an d21_arch of an d21 is beginy=a and b;end an d21_arch;con figurati on con_an d21 of an d21 is for an d21_archend for;end con_an d21; and21六总结本次通过数字钟实现的例子展现了 VHDL在灵活性,层次化设计方法的优点。程序中设计了五种元件,采用配置的方式分别将其实体和结构体相连结。再通过元件的例化,端口VHDL语言具有很强的电路描述和建模能力,能映射把实现数字钟的整个电路图。说明了 从多个层次对数字系统进行建模与描述。附:数字时钟的的具体电路图-闻 tt

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2