《EDA技术》课程实验
学生姓名:
文京洛
所在班级:
电信1202
指导教师:
张平华 老师
记分及评价:
报告满分
3分
得 分
一、 实验名称
实验7:LED动态扫描控制器的
二、 任务及要求
【基本部分】
1、新建原理图文件,调用以前的电子钟模块、LED显示译码器模块及其他计数器模块、译码器模块等,实现电子钟时、分、秒的结果在实验箱数码管上以动态扫描的方式显示出来。
2、设计完成后生成一个元件,以供更高层次的设计调用。
3、实验箱上进行验证。
三、 实验程序
3.1 实验部分程序
(minute/second程序60进制)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity second is
port(clk,en,rst:in std_logic;
sech,secl:out std_logic_vector(3 downto 0);
enmin:out std_logic);
end;
architecture one of second is
signal q:std_logic_vector(7 downto 0);
begin
process(clk,rst)
begin
if rst='0'then
q<="00000000";--q<=X"00"; q<=(others=>'0');
elsif(clk'event and clk='1')then
if(en='1')then
if(q=X"59") then
q<=X"00";
enmin<='1';
elsif q(3 downto 0)=9 then
q<=q+7;
enmin<='0';
else
q<=q+1;
enmin<='0';
end if;
end if;
end if;
end process;
sech<=q(7 downto 4);
secl<=q(3 downto 0);
end;
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity hour is
port(clk,en,rst:in std_logic;
hrh,hrl:out std_logic_vector(3 downto 0);
enday:out std_logic);
end;
architecture one of hour is
signal q:std_logic_vector(7 downto 0);
begin
process(clk,rst)
begin
if rst='0'then
q<="00000000";--q<=X"00"; q<=(others=>'0');
elsif(clk'event and clk='1')then
if(en='1')then
if(q=X"23") then
q<=X"00";
enday<='1';
elsif q(3 downto 0)=9 then
q<=q+7;
enday<='0';
else
q<=q+1;
enday<='0';
end if;
end if;
end if;
end process;
hrh<=q(7 downto 4);
hrl<=q(3 downto 0);
end;
(hour程序24进制)
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity hour is
port(clk,en,rst:in std_logic;
hrh,hrl:out std_logic_vector(3 downto 0);
enday:out std_logic);
end;
architecture one of hour is
signal q:std_logic_vector(7 downto 0);
begin
process(clk,rst)
begin
if rst='0'then
q<="00000000";--q<=X"00"; q<=(others=>'0');
elsif(clk'event and clk='1')then
if(en='1')then
if(q=X"23") then
q<=X"00";
enday<='1';
elsif q(3 downto 0)=9 then
q<=q+7;
enday<='0';
else
q<=q+1;
enday<='0';
end if;
end if;
end if;
end process;
hrh<=q(7 downto 4);
hrl<=q(3 downto 0);
end;
3.2 系统原理图
四、 仿真及结果分析
装好实验箱且准备工作都完成之后,接通电源,秒钟自动计数,并可以通过按键任意进位分,时,也可以通过按键清零。
五、 硬件验证
1、引脚锁定情况
:
六、
这次实验对我来说进行的并不算顺利,虽然也按时完成了实验,得到了应对的实验成果,其中却是充满的艰辛与苦涩。
通过这次实验我发现了自己许多的不足之处,包括对软件的使用,程序的编写,引脚的编辑等都不怎么熟悉,对于不懂的地方,我都会向老师或同学请教,实验其实都是印证课本知识,所以对书本知识也更加深刻。