多功能数字钟课程设计报告_第1页
多功能数字钟课程设计报告_第2页
多功能数字钟课程设计报告_第3页
多功能数字钟课程设计报告_第4页
多功能数字钟课程设计报告_第5页
已阅读5页,还剩14页未读 继续免费阅读

下载本文档

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

文档简介

1、多功能数字钟课程设计报告班级:计算机1002姓名:庄忠明学号:3100602044指导老师:丁伟完成日期:2012年1月10日1、 设计任务及要求(1) 拥有正常的是、分、秒计时功能;(2) 能利用实验板上的案件实现校时、较分及秒清零功能;(3) 能利用实验板上的扬声器做整点报时;(4) 闹钟功能;(5) 在maxplus 中采用层次化方法进行设计;(6) 完成全部电路设计后在实验板上下载,验证设计课题的正确性。2、 设计方案(1) 计时模块该模块的设计相对简单,使用一个二十四进制和两个六十进制计数器级联,构成数字钟的基本框架。二十四进制计数器用于计时,六十进制计数器用于计分和计秒。只要给秒计

2、数器一个1hz的时钟脉冲,则可以进行正常计时。分计数器以秒计数器的进位作为计数脉冲,小时计数器以分计数器的进位作为技术脉冲。(2) 校时模块校时模块设计要求实现校时、较分及秒清零的功能。1. 打开校时键,小时计数器迅速递增以调至所需要的小时位;2. 打开较分键,分计数器迅速递增至所需要的分位;3. 打开清零键,将秒计数器清零。为此,可以用vhdl语言设计一个器件,该器件的功能是用3个波动开关控制校时功能:清零键打开时,秒计数器的清零端为0;较分键打开时分计数器的使能端为1,进位端输出为零,同时给予它一个4hz的时钟信号;校时键打开小时计数器使能端为1,时钟信号为4hz。(3) 整点报时功能该模

3、块的功能是:计时到59分50秒时,每两秒一次低音报时,整点时进行高音报时。方法是用vhdl语言设计一个器件,其输入端与计时器分、秒的输出端相接。当时间为59分50秒、52秒、54秒、56秒、58秒时编号为hz500的输出端为1,否则为0。当00分00秒时编号为hz1k的输出端为1,否则为0。 hz500的输出端与500hz的连线同接在与门上, hz1k的输出端与1khz的连线同接在与门上,2个与门输出端接在一个或门上,输出端连在扬声器上。(4) 分频模块在本系统中需要用到多种不同频率的脉冲信号,所有这些脉冲信号均可以通过一个基准频率器生成。基准频率器就是一个进制很大的计数器,利用计数器的分频功

4、能,从不同的输出位得到所需要的脉冲信号。(5) 动态显示用vhdl语言设计2个器件。第1个器件的功能是接入计数器的各个输出端,再把所接入的各位数上的数据按所在位置分别输出,同时控制相应的数码管亮起。而第2个器件接受第一个器件的数据,将其编译成七段led显示器所需的7个信号。(6) 闹钟模块闹钟模块要求数字钟计时到所设定的任意时间均能驱动扬声报时。编写一个新器件,在调用一个二十四进制计数器,一个六十进制计数器和一个校时模块。用校时模块调整两个计时器的时间至所需时间,将其接入到新器件中。该器件同时接入计时器信号,当两个时间相同时,控制扬声器响起。另再编写一个新器件,该器件可以控制闹钟的开关,同时可

5、以切换闹钟的设定时间与计时器的时间显示。 3、 程序清单:顶层图六十进制计数器二十四进制计数器校时:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity jiaoshi_44 isport(clk,s,m,h:in std_logic;a,b,c,sclr,men,hen1,hen2:out std_logic);end jiaoshi_44 ;architecture hz of jiaoshi_44 issignal count:std_logic_vector(2 downto 0)

6、;signal hz4,hz1:std_logic;beginprocess(clk) beginif (clk'event and clk='1') then if (count="111") then count<="000" elsecount<= count+1;end if;end if;hz4<=count(0);hz1<=count(2);if(s='0') thena<=hz1;sclr<='1'elsesclr<='0'en

7、d if;if(m='0') thenb<=hz1;men<='0'hen1<='1'elseb<=hz4;men<='1'hen1<='0'end if;if(h='0') thenc<=hz1;hen2<='0'elsec<=hz4;hen2<='1'end if;end process; end hz;整点报时:library ieee; use ieee.std_logic_1164.all;use

8、ieee.std_logic_unsigned.all;entity zheng_44 isport(min1,min0,sec1,sec0:in std_logic_vector(3 downto 0); hz500,hz1k:out std_logic);end zheng_44;architecture behave of zheng_44 isbeginprocess(min0) beginhz500<='0'hz1k<='0'if min1="0101" and min0="1001" then if

9、 sec1="0101"and (sec0="0000" or sec0="0010" or sec0="0100" or sec0="0110" or sec0="1000") then hz500<='1' else hz500<='0'end if;end if; if min1="0000" and min0="0000"and sec1="0000" and se

10、c0="0000" thenhz1k<='1'elsehz1k<='0'end if;end process;end behave;分频功能:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity fenpin11_44 isport(clk:in std_logic;hz512,hz256,hz128,hz64,hz32,hz16,hz8,hz4,hz2,hz1,hz05:out std_logic);end fenpin11

11、_44 ;architecture hz of fenpin11_44 issignal count:std_logic_vector(10 downto 0);beginprocess(clk) beginif (clk'event and clk='1') then if (count="11111111111") then count<="00000000000" elsecount<= count+1;end if;end if;end process; hz512 <= count(0); hz256

12、<= count(1);hz128<=count(2);hz64 <= count(3);hz32<=count(4);hz16<=count(5);hz8<=count(6);hz4<=count(7);hz2<=count(8);hz1<=count(9);hz05<=count(10);end hz;动态显示模块:library ieee;use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;use ieee.std_logic_arith.all;entity

13、select61_44 is port( clk:in std_logic; sec1,sec0,min1,min0,h1,h0:in std_logic_vector(3 downto 0); selout:out std_logic_vector(3 downto 0); sel:out std_logic_vector(5 downto 0);end select61_44;architecture fun of select61_44 is signal count:std_logic_vector(2 downto 0);begin process(clk) begin if(clk

14、'event and clk='1') then if(count>="101") then count<="000" else count<=count+1; end if; end if; case count is when"000"=>selout<= sec0; when"001"=>selout<= sec1; when"010"=>selout<= min0; when"011"=&g

15、t;selout<= min1; when"100"=>selout<=h0; when others =>selout<=h1; end case; case count is when"000"=>sel<="000001" when"001"=>sel<="000010" when"010"=>sel<="000100" when"011"=>sel<=

16、"001000" when"100"=>sel<="010000" when others =>sel<="100000" end case; end process;end fun;library ieee;use ieee.std_logic_1164.all;entity decoder47_44 isport(a:in std_logic_vector(3 downto 0); b:out std_logic_vector(6 downto 0);end decoder47_44;a

17、rchitecture behavior of decoder47_44 isbegin with a select b<="1111110"when"0000", "0110000"when"0001", "1101101"when"0010", "1111001"when"0011", "0110011"when"0100", "1011011"when"0

18、101", "1011111"when"0110", "1110000"when"0111", "1111111"when"1000", "1111011"when"1001", "xxxxxxx"when others;end behavior;闹钟:library ieee; use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;enti

19、ty naozhong_44 isport(min1,min0,h1,h0,fen1,fen0,shi1,shi0:in std_logic_vector(3 downto 0); hz1k:out std_logic);end naozhong_44;architecture behave of naozhong_44 isbegin process(min0) begin hz1k<='0'if min1<=fen1 and min0<=fen0 and h1<=shi1 and h0<=shi0 then hz1k<='1

20、9; else hz1k<='0'end if; end process;end behave;library ieee; use ieee.std_logic_1164.all;use ieee.std_logic_unsigned.all;entity nao_switch_44 isport(key,show:in std_logic; sec1,sec0,min1,min0,h1,h0,fen1,fen0,shi1,shi0:in std_logic_vector(3 downto 0); secout1,secout0,minout1,minout0,hout1,hout0:out std_logic_vector(3 downto 0); hz1k:out std_logic)

温馨提示

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

评论

0/150

提交评论