欢迎来到冰点文库! | 帮助中心 分享价值,成长自我!
冰点文库
全部分类
  • 临时分类>
  • IT计算机>
  • 经管营销>
  • 医药卫生>
  • 自然科学>
  • 农林牧渔>
  • 人文社科>
  • 工程科技>
  • PPT模板>
  • 求职职场>
  • 解决方案>
  • 总结汇报>
  • ImageVerifierCode 换一换
    首页 冰点文库 > 资源分类 > DOCX文档下载
    分享到微信 分享到微博 分享到QQ空间

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

    • 资源ID:13925015       资源大小:630.12KB        全文页数:14页
    • 资源格式: DOCX        下载积分:5金币
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录
    二维码
    微信扫一扫登录
    下载资源需要5金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP,免费下载
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    基于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


    注意事项

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

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

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

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


    收起
    展开