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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

EDA基于VHDL的时钟设计报告.docx

1、EDA基于VHDL的时钟设计报告12/24小时数字钟设计顶层图12/24小时数字钟设计顶层图二、模块和程序1、计数器25000library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_cnt25000 is port(clk:in std_logic; clkout:out std_logic);end yourname_cnt25000;architecture bav of yourname_cnt25000 is signal cnt:integer range 0 t

2、o 24999; begin process(clk) begin if clkevent and clk=1 then if cnt=24999 then cnt=0; else cnt=cnt+1; end if; if cnt12500 then clkout=1; else clkout=0; end if; end if; end process;end bav;2、去抖模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_qudou isport(key_

3、in,clk_1kHz:in std_logic; key_out:out std_logic);end yourname_qudou;architecture behav of yourname_qudou is signal cnt20:integer range 0 to 19; begin process(clk_1kHz,key_in) begin if clk_1kHzevent and clk_1kHz=1 then if cnt20=19 then cnt20=0; key_out=key_in; else cnt20qm if (nian(0)=0) and (nian(1)

4、=0) then qm=29; else qmqmqmqmqmqmqmqmqmqmqmnull; end case ;end process;process(co,preset,xingqi1) begin if preset=0 then yue=00000001 ; nian=00001100; ri=00001100; xingqi1=0010; else if coevent and co=1 then if(ri=qm) then ri=00000001; if xingqi1=0111then xingqi1=0001; else xingqi1=xingqi1+1; end if

5、; if(yue=00001100)then yue=00000001;nian=nian+1; else yue=yue+1; end if; elsif(riqm) then ri=ri+1; if xingqi1=0111then xingqi1=0001; else xingqi1=xingqi1+1; end if; end if; end if; end if;end process; month=yue;year=nian; date=ri; xingqi=xingqi1;end bav;、初始设为2012年1月12日星期4、观察平年闰年 2月不同显示7位矢量转换成BCD显示li

6、brary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity yourname_zhuanhuan is port(input:in std_logic_vector(7 downto 0); output10,output1: out std_logic_vector(3 downto 0);end;architecture bav of yourname_zhuanhuan issignal q: integer range 0 to 25

7、5;signal b10,b1:std_logic_vector(3 downto 0);signal a,b:integer range 0 to 9;beginprocess(input)beginq=conv_integer(input);a=(q/10);b=(q mod 10);b10=conv_std_logic_vector(a,4);b1=conv_std_logic_vector(b,4);end process;output10=b10;output1=b1;end bav;按键切换模块 分别在en=00,01,10的情况下显示 时间,年月日,星期library ieee;

8、use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_keyqiehuan isport(key :in std_logic;en:out std_logic_vector(1 downto 0);end yourname_keyqiehuan ;architecture behav of yourname_keyqiehuan issignal en1:std_logic_vector(1 downto 0):=11;beginprocess(key)beginif keyevent and k

9、ey=1thenen1=en1+1;end if;end process;en=en1;end behav;切换选择输出模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_dispxianshi isport(en:in std_logic_vector(1 downto 0);xingqi,a0,a1,a2,a3,a4,a5,b0,b1,b2,b3,b4,b5:in std_logic_vector(3 downto 0);c0,c1,c2,c3,c4,c5:ou

10、t std_logic_vector(3 downto 0);end yourname_dispxianshi;architecture behav of yourname_dispxianshi isbegin process(en)beginif en=00then c0=a0; c1=a1; c2=a2; c3=a3; c4=a4; c5=a5; elsif en=01then c0=b0; c1=b1; c2=b2; c3=b3; c4=b4; c5=b5; elsif en=11 then c0=xingqi; end if;end process;end behav;4、分频模块l

11、ibrary ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_div is port(clk_2KHz:in std_logic; clk_1KHz,clk_5HZ,clk_1Hz:out std_logic);end yourname_div;architecture bav of yourname_div issignal clk1K,clk5,clk1: std_logic;signal cnt200: integer range 0 to 199;signal cnt100

12、0:integer range 0 to 999;begin process(clk_2KHz) begin if clk_2KHzevent and clk_2KHz=1 then clk1K=not(clk1K); end if; end process; process(clk1K) begin if clk1Kevent and clk1K=1 then if cnt200=199 then cnt200=0; else cnt200=cnt200+1; end if; if cnt200100 then clk5=1; else clk5=0; end if; end if; end

13、 process; process(clk1K) begin if clk1Kevent and clk1K=1 then if cnt1000=999 then cnt1000=0; else cnt1000=cnt1000+1; end if; if cnt1000500 then clk1=1; else clk1=0; end if; end if; end process; clk_1KHz=clk1K; clk_5Hz=clk5; clk_1Hz=clk1;end bav;5、两位BCD码六十进制计数器library ieee;use ieee.std_logic_1164.all

14、;use ieee.std_logic_unsigned.all;entity yourname_cnt60 is port(clk,preset:in std_logic; bcd10,bcd1:buffer std_logic_vector(3 downto 0); co:out std_logic);end yourname_cnt60;architecture bav of yourname_cnt60 issignal co_1: std_logic;begin process(clk,preset) begin if preset=0 then bcd1=0000; else if

15、 clkevent and clk=1 then if bcd1=1001 then bcd1=0000; else bcd1=bcd1+1; end if; end if; end if; end process; process(clk,preset,bcd1) begin if preset=0 then bcd10=0000; co_1=0; else if clkevent and clk=1 then if bcd1=1000and bcd10=0101 then co_1=1; elsif bcd1=1001 and bcd10=0101 then bcd10=0000; co_

16、1=0; elsif bcd1=1001 then bcd10=bcd10+1; co_1=0; end if; end if; end if; end process; co4) and (bcd1S=9) then if clk1Hz=1 then clkout_1=clk_1KHz; else clkout_1=Z; end if; elsif (bcd10M=0000 and bcd1M=0000) and (bcd10S=0000) and (bcd1S=0000) then if clk1Hz=1 then clkout_1=clk_2KHz; else clkout_1=Z; e

17、nd if; else clkout_1=Z; end if; clkout=clkout_1; end process;end bav; 7、12/24小时切换控制模块library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_cnt12_24 is port(clk,contr12_24:in std_logic; bcd10,bcd1:out std_logic_vector(3 downto 0);end yourname_cnt12_24;architecture b

18、ehav of yourname_cnt12_24 is type ly is(s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12,s13,s14,s15,s16,s17,s18,s19,s20,s21,s22,s23); signal p,n:ly; signal b10,b1:std_logic_vector(3 downto 0); begin process(clk) begin if clkevent and clk=1 then p if contr12_24=0 then b10=0000; b1=0000; else b10=0001; b1=0

19、010; end if; n b10=0000; b1=0001; n b10=0000; b1=0010; n b10=0000; b1=0011; nb10=0000; b1=0100; nb10=0000; b1=0101; nb10=0000; b1=0110; nb10=0000; b1=0111; nb10=0000; b1=1000; nb10=0000; b1=0101; nb10=0001; b1=0000; nb10=0001; b1=0001; nb10=0001; b1=0010; nif contr12_24=0 then b10=0001; b1=0011; els

20、e b10=0000; b1=0001; end if; nif contr12_24=0 then b10=0001; b1=0100; else b10=0000; b1=0010; end if; nif contr12_24=0 then b10=0001; b1=0101; else b10=0000; b1=0011; end if; nif contr12_24=0 then b10=0001; b1=0110; else b10=0000; b1=0100; end if; nif contr12_24=0 then b10=0001; b1=0111; else b10=00

21、00; b1=0101; end if; nif contr12_24=0 then b10=0001; b1=1000; else b10=0000; b1=0110; end if; nif contr12_24=0 then b10=0001; b1=1001; else b10=0000; b1=0111; end if; nif contr12_24=0 then b10=0010; b1=0000; else b10=0000; b1=1000; end if; nif contr12_24=0 then b10=0010; b1=0001; else b10=0000; b1=1001; end if; nif contr12_24=0 then b10=0010; b1=0010; else b10=0001; b1=0000; end if; nif contr12_24=0 then b10=0010; b1=0011; else b10=0001; b1=0001; end if; n=s

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

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