基于vhdl时钟设计说明书.doc_第1页
基于vhdl时钟设计说明书.doc_第2页
基于vhdl时钟设计说明书.doc_第3页
基于vhdl时钟设计说明书.doc_第4页
基于vhdl时钟设计说明书.doc_第5页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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 to 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_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)=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; elseif coevent and co=1 thenif(ri=qm) thenri=00000001;if xingqi1=0111thenxingqi1=0001;else xingqi1=xingqi1+1;end if;if(yue=00001100)then yue=00000001;nian=nian+1;else yue=yue+1;end if;elsif(riqm) thenri=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显示library 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 255;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;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 key=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:out 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、分频模块library 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 cnt1000: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 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;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 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_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; end 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 behav 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=0010; 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; else 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=0000; 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; nnull; end case; end process; bcd10=b10; bcd1=b1; end behav;8、数码管动态扫描显示library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity yourname_disp isport (din0:in std_logic_vector(3 downto 0); din1:in std_logic_vector(3 downto 0); din2:in std_logic_vector(3 downto 0); din3:in std_logic_vector(3 downto 0); din4:in std_logic_vector(3 downto 0); din5:in std_logic_vector(3 downto 0); clk:in std_logic; led_sa:out std_logic; led_sb:out std_logic; led_sc:out std_logic; led_a:out std_logic; led_b:out std_logic; led_c:out std_logic; led_d:out std_logic; led_e:out std_logic; led_f:out std_logic; led_g:out std_logic; led_dp:out std_logic);end yourname_disp ;architecture behav of yourname_disp is signal seg:std_logic_vector(6 downto 0); signal sel:std_logic_vector(2 downto 0); signal num:std_logic_vector(3 downto 0); signal s:std_logic_vector(2 downto 0); begin led_sa=sel(0); led_sb=sel(1); led_sc=sel(2); led_a=seg(0); led_b=seg(1); led_c=seg(2); led_d=seg(3); led_e=seg(4); led_f=seg(5); led_g=seg(6); process(clk) begin if clkevent and clk=1then if s=101then s=000; else s=s+1; end if; end if; end process; process(s,din0,din1,din2,din3,din4,din5) begin if s=000then sel=000; num=din0; led_dp=0; elsif s=001then sel=001; num=din1; led_dp=0; elsif s=010then sel=010; num=din2; led_dp=0; elsif s=011then sel=011; num=din3; led_dp=0; elsif s=100then sel=100; num=din4; led_dp=0; elsif s=101then sel=101; num=din5; led_dp=0; else sel=XXX; num=XXXX; led_dp=0; end if; end process; seg=0111111when num=0 else 0000110when num=1 else 1011011when num=2 else 1001111when num=3 else 1100110when num=4 else 1101101when num=5 else 1111101when num=6 else 0000111when num=7 else 1111111when num=8 else 1101111when num=9 else 1110111when num=10 else 1111100when num=11 else 0111001when num=12 else 1011110when num=13 else 1111001when num=14 else 1110001when num=15 else 0000000; end behav; 39大学本科生毕业设计(论文)撰写规范本科生毕业设计(论文)是学生在毕业前提交的一份具有一定研究价值和实用价值的学术资料。它既是本科学生开始从事工程设计、科学实验和科学研究的初步尝试,也是学生在教师的指导下,对所进行研究的适当表述,还是学生毕业及学位资格认定的重要依据。毕业论文撰写是本科生培养过程中的基本训练环节之一,应符合国家及各专业部门制定的有关标准,符合汉语语法规范。指导教师应加强指导,严格把关。1、论文结构及要求论文包括题目、中文摘要、外文摘要、目录、正文、参考文献、致谢和附录等几部分。1.1 题目论文题目应恰当、准确地反映论文的主要研究内容。不应超过25字,原则上不得使用标点符号,不设副标题。1.2 摘要与关键词1.2.1 摘要本科生毕业设计(论文)的摘要均要求用中、英两种文字给出,中文在前。摘要应扼要叙述论文的研究目的、研究方法、研究内容和主要结果或结论,文字要精炼,具有一定的独立性和完整性,摘要一般应在300字左右。摘要中不宜使用公式、图表,不标注引用文献编号,避免将摘要写成目录式的内容介绍。1.2.2 关键词关键词是供检索用的主题词条,应采用能覆盖论文主要内容的通用技术词条(参照相应的技术术语标准),一般列35个,按词条的外延层次从大到小排列,应在摘要中出现。1.3 目录目录应独立成页,包括论文中全部章、节的标题及页码。1.4 论文正文论文正文包括绪论、论文主体及结论等部分。1.4.1 绪论绪论一般作为论文的首篇。绪论应说明选题的背景、目的和意义,国内外文献综述以及论文所要研究的主要内容。文管类论文的绪论是毕业论文的开头部分,一般包括说明论文写作的目的与意义,对所研究问题的认识以及提出问题。绪论只是文章的开头,不必写章号。毕业设计(论文)绪论部分字数不多于全部论文字数的1/4。1.4.2 论文主体论文主体是论文的主要部分,要求结构合理,层次清楚,重点突出,文字简练、通顺。论文主体的内容要求参照大学本科生毕业设计(论文)的规定第五章。论文主体各章后应有一节“本章小结”。1.4.3 结论结论作为单独一章排列,但不加章号。结论是对整个论文主要成果的归纳,要突出设计(论文)的创新点,以简练的文字对论文的主要工作进行评价,一般为4001 000字。1.5 参考文献参考文献是论文不可缺少的组成部分,它反映了论文的取材来源和广博程度。论文中要注重引用近期发表的与论文工作直接有关的学术期刊类文献。对理工类论文,参考文献数量一般应在15篇以上,其中学术期刊类文献不少于8篇,外文文献不少于3篇;对文科类、管理类论文,参考文献数量一般为1020篇,其中学术期刊类文献不少于8篇,外文文献不少于3篇。在论文正文中必须有参考文献的编号,参考文献的序号应按在正文中出现的顺序排列。产品说明书、各类标准、各种报纸上刊登的文章及未公开发表的研究报告(著名的内部报告如PB、AD报告及著名大公司的企业技术报告等除外)不宜做为参考文献引用。但对于工程设计类论文,各种标准、规范和手册可作为参考文献。引用网上参考文献时,应注明该文献的准确网页地址,网上参考文献不包含在上述规定的文献数量之内。1.6 致谢对导师和给予指导或协助完成论文工作的组织和个人表示感谢。内容应简洁明了、实事求是,避免俗套。1.7 附录如开题报告、文献综述、外文译文及外文文献复印件、公式的推导、程序流程图、图纸、数据表格等有些不宜放在正文中,但有参考价值的内容可编入论文的附录中。2、论文书写规定2.1 论文正文字数理工类 论文正文字数不少于20 000字。文管类 论文正文字数12 00020 000字。其中汉语言文学专业不少于7 000字。外语类 论文正文字数8 00010 000个外文单词。艺术类 论文正文字数3 0005 000字。2.2 论文书写本科生毕业论文用B5纸计算机排版、编辑与双面打印输出。论文版面设置为:毕业论文B5纸、纵向、为横排、不分栏,上下页边距分别为2.5cm和2cm,左右页边距分别为2.4cm和2cm,对称页边距、左侧装订并装订线为0cm、奇偶页不同、无网格。论文正文满页为29行,每行33个字,字号为小四号宋体,每页版面字数为957个,行间距为固定值20磅。页眉。页眉应居中置于页面上部。单数页眉的文字为“章及标题”;双数页眉的文字为“大学本科生毕业设计(论文)”。页眉的文字用五号宋体,页眉文字下面为2条横线(两条横线的长度与版芯尺寸相同,线粗0.5磅)。页眉、页脚边距分别为1.8cm和1.7cm。页码。页码用小五号字,居中标于页面底部。摘要、目录等文前部分的页码用罗马数字单独编排,正文

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论