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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

基于VHDL万年历的设计.docx

1、基于VHDL万年历的设计数字万年历与数字钟的设计一、设计要求数字万年历要求可以任意设定 年份月份和日期;当当日时钟走过24时(即0点)后,日期能够自动改变。同样,当每月的最后一天走完后,月份也能够自动显示为下一个月。年份的变化也是如此。时钟计时按照一天24小时计。时钟也可以按照由人工设定当前时间,或者修改当前时间,修改完成后,计时即有当前时间开始。显示方式:日期为2001-11-08,时钟为hh-mm-ss;日期和时钟轮流显示。二、设计原理本设计先用VHDL语言写出需要的各个小模块,并将这些模块进行编译并打包成图形文件,最后将这些图形文件在顶层文件里进行连线,实现具体要求与功能。实验源程序:L

2、IBRARY IEEE;USE IEEE.std_logic_1164.ALL;USE IEEE.STD_LOGIC_ARITH.ALL;USE IEEE.std_logic_unsigned.ALL;ENTITY onesecond IS PORT ( RESET: IN STD_LOGIC; GCLKP1: IN STD_LOGIC; clkout: out std_logic );END onesecond ;ARCHITECTURE Frequency_arch OF onesecond IS SIGNAL Period1S: STD_LOGIC;BEGIN PROCESS( RESE

3、T, GCLKP1) VARIABLE Count1 : STD_LOGIC_VECTOR(25 DOWNTO 0); BEGIN IF( GCLKP1EVENT AND GCLKP1=1 ) THEN IF( Count110111110101111000010000000 ) THEN Count1 := 00000000000000000000000000; ELSE Count1 := Count1 + 1; END IF; Period1S = Count1(25); - 1MHz END IF; clkout = Period1S; end process;END Frequenc

4、y_arch;60进制library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt60 is port( clk: in std_logic; ld: in std_logic; da,db:in std_logic_vector(3 downto 0); outa:out std_logic_vector(3 downto 0); outb:out std_logic_vector(3 downto 0); c0: out std_logic );end cnt60;architectu

5、re one of cnt60 issignal ma,mb:std_logic_vector(3 downto 0);begin c0=1 WHEN( ma=5 and mb=9 ) else 0 ;process(clk,ld)begin if clkevent and clk=1 then if ld=1 then ma=da; mb=db; elsif ma=5 and mb=9 then mb=0000; ma=0000; elsif mb=9 then mb=0000; ma=ma+1; else mb=mb+1; end if; end if; end process; outa

6、=ma; outb=mb; end one;24进制程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity cnt24 is port(clk: in std_logic; ld: in std_logic; da,db:in std_logic_vector(3 downto 0); outa:out std_logic_vector(3 downto 0); outb:out std_logic_vector(3 downto 0); c0: out std_logic );end

7、cnt24;architecture one of cnt24 issignal ma,mb:std_logic_vector(3 downto 0);begin c0=1 WHEN( ma=2 and mb=3 ) else 0 ;process(clk,ld)begin if clkevent and clk=1 then if ld=1 then ma=da;mb=db; elsif ma=2 and mb=3 then mb=0000; ma=0000; elsif mb=9 then mb=0000; ma=ma+1; else mb=mb+1; end if; end if;end

8、 process; outa=ma; outb=mb; end one;天library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity day is port( clk:in std_logic; ld: in std_logic; maxday: in std_logic_vector(1 downto 0); da:in std_logic_vector(3 downto 0); db:in std_logic_vector(3 downto 0); outa:out std_logic_ve

9、ctor(3 downto 0); outb:out std_logic_vector(3 downto 0); c0: out std_logic );end day;architecture one of day issignal ma: std_logic_vector(3 downto 0);signal mb: std_logic_vector(3 downto 0);begin process(clk,ld)begin if clkevent and clk=1 then if ld=1 then ma=da;mb -28 if (ma=2 and mb=8)then ma=000

10、0;mb=0001;c0=1; else if mb=9 then mb=0000;ma=ma+1;c0=0; else mb=mb+1;c0 - 29 if (ma=2 and mb=9)then ma=0000;mb=0001;c0=1; else if mb=9 then mb=0000;ma=ma+1;c0=0; else mb=mb+1;c0 - 30 if (ma=3 and mb=0)then ma=0000;mb=0001;c0=1; else if mb=9 then mb=0000;ma=ma+1;c0=0; else mb=mb+1;c0 -31 if (ma=3 and

11、 mb=1)then ma=0000;mb=0001;c0=1; else if mb=9 then mb=0000;ma=ma+1;c0=0; else mb=mb+1;c0=0; end if; end if; end case; end if; end if;end process;outa=ma;outb=mb;end one; 月library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yue is port( clk,ld:in std_logic; da: in std_logi

12、c_vector(3 downto 0); db: in std_logic_vector(3 downto 0); runnian:in std_logic; outa: out std_logic_vector(3 downto 0); outb: out std_logic_vector(3 downto 0); c0:out std_logic; maxday:out std_logic_vector(1 downto 0) );end yue;architecture one of yue issignal mb:std_logic_vector(3 downto 0);signal

13、 ma:std_logic_vector(3 downto 0);beginprocess(clk,ld)begin if (clkevent and clk=1) then if ld=1 then ma=da;mb=db; if(ma=1 and mb=2)then ma=0000; mb=0001; elsif mb=9 then mb=0000; ma=ma+1; else mb=mb+1; end if; end if; end if; end process; outa=ma; outb=mb; c0=1 WHEN( ma=1 and mb=2 ) else 0 ;maxday =

14、00 when ma=0 and mb=2 and runnian=0 else 01 when ma=0 and mb=2 and runnian=1 else 10 when (ma=0 and mb=4)or(ma=0 and mb=6)or(ma=0 and mb=9)or(ma=1 and mb=1) else 11;end one; 年library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity nian is port( ld1,ld2,clk:in std_logic; dy1,d

15、y2:in std_logic_vector(3 downto 0); y1,y2,y3,y4:out std_logic_vector(3 downto 0); run,cout:out std_logic);end nian;architecture one of nian issignal q1,q2,q3,q4:std_logic_vector(3 downto 0);signal sum,sum1,sum2:std_logic_vector(1 downto 0);begin process(clk,ld1,ld2) begin if clkevent and clk=1 then

16、if ld1=1 then q1=dy1; q2=dy2; elsif ld2=1 then q3=dy1; q4=dy2; else q1=q1+1; if q1=9 then q10); q2=q2+1; end if; if q1=9 and q2=9 then q10); q20); q3=q3+1; end if; if q1=9 and q2=9 and q3=9 then q10); q20); q30); q4=q4+1; end if; if q2=9 and q1=9 and q3=9 and q4=9 then q4=0000; q3=0000; q2=0000; q1=

17、0000; cout=1; else cout=0; end if; end if; end if; end process ;with conv_integer(q4) select sum1=10 when 1|3|5|7|9, 00 when others; with conv_integer(q2) select sum2=10 when 1|3|5|7|9, 00 when others; process(q1,q2,q3,q4,sum1,sum2) begin if(q1=0000and q2=0000)then sum=sum1+q3(1 downto 0); else sum=

18、sum2+q1(1 downto 0); end if;end process ; run= 1 when sum=00 else 0; y1=q1; y2=q2; y3=q3; y4=q4;end one;置数选择程序library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yima1 is port( x:in std_logic_vector(2 downto 0); y0,y1,y2,y3,y4,y5,y6,y7:out std_logic);end yima1;architectur

19、e a of yima1 issignal da:std_logic_vector(7 downto 0);begin with x select da=00000001when000, 00000010when001, 00000100when010, 00001000when011, 00010000when100, 00100000when101, 01000000when110, 10000000when111, 00000000when others; y0=da(0); y1=da(1); y2=da(2); y3=da(3); y4=da(4); y5=da(5); y6=da(

20、6); y7 w w null; end case; end if;end process;process (clk,w,ya,yb,yc,yd,ma,mb,da,db,ha,hb,fa,fb,oa,ob)begin if clkevent and clk=1 then case w is when 0 = s0=hb;s1=ha;s2=1111;s3=fa;s4=fb;s5=1111;s6=oa;s7 s0=ya;s1=yb;s2=yc;s3=yd;s4=ma;s5=mb;s6=da;s7=db; end case; end if;end process; with s0 select d0

21、= 0110000 when 0001, 1101101 when 0010, 1111001 when 0011, 0110011 when 0100, 1011011 when 0101, 1011111 when 0110, 1110000 when 0111, 1111111 when 1000, 1111011 when 1001, 1111110 when others; with s1 select d1= 0110000 when 0001, 1101101 when 0010, 1111001 when 0011, 0110011 when 0100, 1011011 whe

22、n 0101, 1011111 when 0110, 1110000 when 0111, 1111111 when 1000, 1111011 when 1001, 1111110 when others; with s2 select d2= 0110000 when 0001, 1101101 when 0010, 1111001 when 0011, 0110011 when 0100, 1011011 when 0101, 1011111 when 0110, 1110000 when 0111, 1111111 when 1000, 1111011 when 1001, 00000

23、01 when 1111, 1111110 when others; with s3 select d3= 0110000 when 0001, 1101101 when 0010, 1111001 when 0011, 0110011 when 0100, 1011011 when 0101, 1011111 when 0110, 1110000 when 0111, 1111111 when 1000, 1111011 when 1001, 1111110 when others; with s4 select d4= 0110000 when 0001, 1101101 when 001

24、0, 1111001 when 0011, 0110011 when 0100, 1011011 when 0101, 1011111 when 0110, 1110000 when 0111, 1111111 when 1000, 1111011 when 1001, 1111110 when others; with s5 select d5= 0110000 when 0001, 1101101 when 0010, 1111001 when 0011, 0110011 when 0100, 1011011 when 0101, 1011111 when 0110, 1110000 when 0111,

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

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