人人范文网 范文大全

数字逻辑课题报告—电子钟

发布时间:2020-03-02 00:16:13 来源:范文大全 收藏本文 下载本文 手机版

电子钟设计报告

班级:

姓名:学号:

指导老师:

验收时间:201 年

一﹑设计目的及要求

设计并实现多功能数字钟,达到要求如下:

1. 能进行正常的记时、记分、记秒, 2.实现校时、校分以及秒清0的功能,

3.实现整点报时的功能, 4.实现定闹铃及闹铃的响,

完成全部电路设计后在实验板上下载,验证设计课题的正 确性。

二、系统设计方案论述:

根据对电子钟控制电路的要求,分析如下:

首先根据老师对实验的要求,编写电子钟控制电路的vhdl程序,程序分为正常显示时间、调整和闹铃时间调整、报时等进程;运用了3-8译码器、八选

一、二选一数据选择器、模8计数器、七段译码、24进制计数器、60进制计数器、比较器等构成其动态显示电路,使电子钟正常显示。

开始确定了两个方案,但考虑到方案的可行性,选择了第一种,也就是这一种方案。

三、环境说明:

主要是使用了MAXPLUSⅡ软件,经过系统的学习及了解,以及请教老师和同学,虚心请教,终于在不懈努力下完成了老师的任务。

四、具体设计:

顶层结构功能图:

根据总体设计框图,可以将整个系统分为6个模块来实现,分别是计时模块、校时模块、整点报时模块、闹钟模块、动态显示模块及正常显示时间与闹钟时间的切换模块。

1、计时模块:

能进行正常的时、分、秒计时,用动态扫描的方式,需用8个数码管。

用24进制计数器进行小时的显示,

用60进制计数器进行分的显示,

用60进制计数器进行秒的显示

2、校时模块:

利用按键实现“校时”、“校分”和“时、分、秒的清0”功能。 先令k5=1,切换到正常时钟的显示上。

(1)k1:校时键。当k1=0键时,计时器迅速递增,按24小时循环,并且计满23时回到00,k1=1时停止循环。

(2)k2:校分键。当k2=0键时,计时器迅速递增,按60小时循环,并且计满59时回到00,但不向时进位,k2=1时停止循环。

(3)k8:秒清零。当k8=0时,时、分、秒清零。

3、整点报时模块:

能进行整点报时,即当分秒都为0时整点报时。

4 、闹钟模块:

和以上计时模块一个原理,但也可以进行闹钟的设置

先令k5=0,切换到闹钟的显示上。

(1)k3:校时键。当k1=1键时,计时器迅速递增,按24小时循环,并且计满23时回到00,k3=0时停止循环。

(2)k4:校分键。当k2=1键时,计时器迅速递增,按60小时循环,并且计满59时回到00,但不向时进位,k4=1时停止循环。

(3)k6:k6=0时清零,k6=时正常运行。

(4)k7:k7=0分清零,k7=1时正常运行。

5、动态显示模块:

时间的显示需要用到8个数码管,其中小时与分钟及分钟与秒之间用数码管的一个g段,在动态显示方式下,所有的数码管对应同一组七段码,可用VHDL语言实现

6、正常显示时间与闹钟时间的切换模块: k5=1,切换到正常时钟的显示上 k5=0,切换到闹钟的显示上

五、各功能模块说明及源代码: 数码管显示电路源程序: 1.七段译码显示:

library ieee;

use ieee.std_logic_1164.all;

entity bin7 is port(date_in:in std_logic_vector (3 downto 0);

en:in std_logic;

date_out:out std_logic_vector(6 downto 0)); end entity;

architecture duan of bin7 is begin proce(date_in,en)

begin

if en=\'1\' then case date_in is when \"0000\"=>date_out

when \"0001\"=>date_outdate_outdate_outdate_outdate_outdate_outdate_outdate_outdate_outdate_out

end proce;

end duan;

2.八选一数据选择器: library ieee; use ieee.std_logic_1164.all; entity mux8 is port(d0,d1,d2,d3,d4,d5,d6,d7:in std_logic_vector(3 downto 0);

sel:in std_logic_vector(2 downto 0);

y:out std_logic_vector(3 downto 0)); end mux8; architecture arch of mux8 is begin proce(d0,d1,d2,d3,d4,d5,d6,d7,sel) begin

case sel is

when \"000\"=>y

when \"001\"=>y

when \"010\"=>y

when \"011\"=>y

when \"100\"=>y

when \"101\"=>y

when \"110\"=>y

when \"111\"=>y

when others=>y

end case; end proce; end arch;

3.二选一选择器(二位) library ieee; use ieee.std_logic_1164.all;

entity mux_2 is port(

d1 :in std_logic;

d2 :in std_logic;

sel

:in std_logic;

y

:out std_logic); end mux_2; architecture rtl of mux_2 is begin proce(sel,d1,d2) begin if(sel=\'1\')then y

end proce; end rtl;

4.二选一选择器(四位) library ieee; use ieee.std_logic_1164.all;

entity mux_24 is port(

d1 :in std_logic_vector(3 downto 0);

d2 :in std_logic_vector(3 downto 0);

sel

:in std_logic;

y

:out std_logic_vector(3 downto 0)); end mux_24; architecture rtl of mux_24 is begin proce(sel,d1,d2) begin if(sel=\'1\')then y

end proce; end rtl;

5. 3_8译码器: library ieee; use ieee.std_logic_1164.all;

entity decode3_8 is port(a,b,c

:in std_logic;

s1,s2,s3 :in std_logic;

y

:out std_logic_vector(7 downto 0));

end decode3_8;

architecture rtl of decode3_8 is

signal ind:std_logic_vector(2 downto 0);

begin

ind

proce(ind,s1,s2,s3)

begin

if(s1=\'1\'and s2=\'0\' and s3=\'0\') then

case ind is

when \"000\"=>y

when \"001\"=>y

when \"010\"=>y

when \"011\"=>y

when \"100\"=>y

when \"101\"=>y

when \"110\"=>y

when \"111\"=>y

when others=>y

end case;

else y

6.报时器 library ieee; use ieee.std_logic_1164.all;

entity baoshi is port(

a1,a2,a3,a4 :in std_logic_vector(3 downto 0);

y

:out std_logic);

end baoshi; architecture rtl of baoshi is begin proce(a1,a2) begin if (a1=\"0000\" and a2=\"0000\" and a3=\"0000\" and a4

7.比较器 library ieee; use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all; entity bijiao is port(

a1,a2 :in std_logic_vector(3 downto 0);

b1,b2 :in std_logic_vector(3 downto 0);

y

:out std_logic); end bijiao; architecture rtl of bijiao is begin proce(a1,a2,b1,b2) begin if(a1=b1 and a2=b2)then y

8.模60 library ieee; use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all; entity mod_60 is port ( clk:in std_logic;

clr :in std_logic;

yh :out std_logic_vector(3 downto 0);

yl :out std_logic_vector(3 downto 0);

co :out std_logic);

end mod_60; architecture six of mod_60 is signal

hh:std_logic_vector(3 downto 0); signal

hl:std_logic_vector(3 downto 0); begin

proce(clk)

begin

if clr=\'0\'

then hh

elsif (clk\'event and clk=\'1\') then

if(hh=\"0101\" and hl=\"1001\")then

hh

elsif(hl=\"1001\")then

hh

hl

else

hl

hh

end if;

end if;

end proce;

yh

end six;

9.模24 library ieee; use ieee.std_logic_1164.all;

use ieee.std_logic_unsigned.all; entity mod_24 is port ( clk:in std_logic;

clr :in std_logic;

yh :out std_logic_vector(3 downto 0);

yl :out std_logic_vector(3 downto 0);

co :out std_logic);

end mod_24; architecture two of mod_24 is signal

hh:std_logic_vector(3 downto 0); signal

hl:std_logic_vector(3 downto 0);

begin

proce(clk)

begin

if clr=\'0\'

then hh

elsif (clk\'event and clk=\'1\') then

if(hh=\"0010\" and hl=\"0011\")then

hh

elsif(hl=\"1001\")then

hh

hl

else

hl

hh

end if;

end if;

end proce;

yh

end two;

六、遇到的问题:

当调动开关时,容易出现数字的变动,经过上网的搜索可知,这是抖动效应,是物理效应,现学知识还解决不了。所以在实验中我们就小心翼翼的把弄开关,结果也没出现什么错误。但是我们知道这不是做科学应有的严谨态度,但以后我们会努力的。

七、实验结果及心得体会:

实验结果:程序实现了现实情况下正常时间的显示,时间的调整,闹钟的设置,还有闹钟的响铃以及整点的报时。 实验心得:

1. 通过本次实验工作,学会了很多vhdl的编程思想,并进一步掌握了其基本语法,可以熟练地编写程序啦!

2. 在实验过程中,提高了分析问题、解决问题的能力,明白了用vhdl语言设计的基本过程及步骤,为以后的实验提供了宝贵的经验。 3 .在编写程序的过程中遇到了很多问题,一开始一点头绪也没有,通过查找资料有了初步的认识,在实际过程中也遇到了很多问题,通过和同学及老师的交流,一些问题逐步迎刃而解。

八、感谢

感谢王老师的辛勤教导,感谢学院给提供了进行实践的机会,让我们在实践中学会了很多,提高了我们的自我学习能力,是我们得到了很好的进步。在此还要感谢学校给我们提供了实验器材。

数字电子钟逻辑电路设计总结报告

数字电子钟课程设计

数字电子钟实验报告

数字电子钟课程设计

课程设计_数字电子钟设计报告

数电课程设计报告数字电子钟

数电课程设计数字电子钟报告

电子装配实习报告 数字电子钟

数字逻辑

数电课程设计报告数字电子钟 东北大学

数字逻辑课题报告—电子钟
《数字逻辑课题报告—电子钟.doc》
将本文的Word文档下载到电脑,方便编辑。
推荐度:
点击下载文档
点击下载本文文档