简易数字钟设计实验
一.实验目的:
1)学习掌握数字系统综合设计方法。
2)学习掌握层次设计方法。
3)学习掌握设计下载方法。
4)学习掌握实验系统使用方法。
二.实验内容
1)复习二进制加法器的功能。
2)学习VHDL 语言源程序输入方法。
3) 学习VHDL 语言源程序检查和修改。
4)学习仿真,引脚锁定。
5)下载验证。
三.实验设备
1)清华同方P Ⅳ 2.4G\256M60G
2)ISE 6.2i—Windows 软件系统
3)多功能EDA 实验系统
四.实验步骤
1)编写、调试实验程序和实验结果。
2)仿真并下载验证。
3)经老师验收后结束本次实验离开。
五.实验程序
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity jinzhi24 is
port(en,clk:in std_logic;
temp:in std_logic;
q_h,q_l:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end jinzhi24;
architecture Behavioral of jinzhi24 is
signal temp_h:std_logic_vector(3 downto 0):="0010";
signal temp_l:std_logic_vector(3 downto 0):="0010";
begin
process(en,clk)
begin
if clk='1' and clk'event then
if en='1' and temp='1'then
if temp_l="0011" and temp_h="0010" then
temp_l
temp_h
else
if temp_l="1001" then
temp_l
temp_h
else
temp_l
end if;
end if;
end if;
end if;
end process;
q_h
q_l
qcc
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity jinzhi60 is
port(clk,en,clr:in std_logic;
qh,ql:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end jinzhi60;
architecture Behavioral of jinzhi60 is
signal qccl:std_logic;
signal qtempl,qtemph:std_logic_vector(3 downto 0);
begin
ql
qccl
qcc
p1:process(clk,en,clr) --个位计数器
begin
if clr='1' then --异步清零功能
qtempl
else
if clk='1' and clk'event then
if en='1' then
if qtempl="1001" then
qtempl
else
qtempl
end if;
end if;
end if;
end if;
end process p1;
p2:process(clk,clr) --十位计数器
begin
if clr='1' then --异步清零功能
qtemph
else
if clk='1' and clk'event then
if qccl='1' and en='1'then
if qtemph="0101" then
qtemph
else
qtemph
end if;
end if;
end if;
end if;
end process p2;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity synthesis_clock is
Port ( clr:in std_logic;
enble:in std_logic;
clk: in std_logic;
output1 : out std_logic_vector(3 downto 0);
output2 : out std_logic_vector(3 downto 0);
output3 : out std_logic_vector(3 downto 0);
output4 : out std_logic_vector(3 downto 0);
output5 : out std_logic_vector(3 downto 0);
output6 : out std_logic_vector(3 downto 0);
qcc:out std_logic);
end synthesis_clock;
architecture Behavioral of synthesis_clock is
component jinzhi60 is
port(clk,en,clr:in std_logic;
qh,ql:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end component;
component jinzhi24 is
port(en,clk:in std_logic;
temp:in std_logic;
q_h,q_l:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end component;
signal qcc1,qcc2,qcc3:std_logic;
signal temp1,temp2,temp3,temp4,temp5,temp6:std_logic_vector(3 downto 0); begin
u1: jinzhi60 port map(clk,enble,clr,temp2,temp1,qcc1);
u2: jinzhi60 port map(clk,qcc1,clr,temp4,temp3,qcc2);
u3: jinzhi24 port map(qcc2,clk,qcc1,temp6,temp5,qcc3);
output1
output2
output3
output4
output5
output6
qcc
end Behavioral;
六.仿真结果
1.60,24进制计数器
简易数字钟设计实验
一.实验目的:
1)学习掌握数字系统综合设计方法。
2)学习掌握层次设计方法。
3)学习掌握设计下载方法。
4)学习掌握实验系统使用方法。
二.实验内容
1)复习二进制加法器的功能。
2)学习VHDL 语言源程序输入方法。
3) 学习VHDL 语言源程序检查和修改。
4)学习仿真,引脚锁定。
5)下载验证。
三.实验设备
1)清华同方P Ⅳ 2.4G\256M60G
2)ISE 6.2i—Windows 软件系统
3)多功能EDA 实验系统
四.实验步骤
1)编写、调试实验程序和实验结果。
2)仿真并下载验证。
3)经老师验收后结束本次实验离开。
五.实验程序
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity jinzhi24 is
port(en,clk:in std_logic;
temp:in std_logic;
q_h,q_l:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end jinzhi24;
architecture Behavioral of jinzhi24 is
signal temp_h:std_logic_vector(3 downto 0):="0010";
signal temp_l:std_logic_vector(3 downto 0):="0010";
begin
process(en,clk)
begin
if clk='1' and clk'event then
if en='1' and temp='1'then
if temp_l="0011" and temp_h="0010" then
temp_l
temp_h
else
if temp_l="1001" then
temp_l
temp_h
else
temp_l
end if;
end if;
end if;
end if;
end process;
q_h
q_l
qcc
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity jinzhi60 is
port(clk,en,clr:in std_logic;
qh,ql:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end jinzhi60;
architecture Behavioral of jinzhi60 is
signal qccl:std_logic;
signal qtempl,qtemph:std_logic_vector(3 downto 0);
begin
ql
qccl
qcc
p1:process(clk,en,clr) --个位计数器
begin
if clr='1' then --异步清零功能
qtempl
else
if clk='1' and clk'event then
if en='1' then
if qtempl="1001" then
qtempl
else
qtempl
end if;
end if;
end if;
end if;
end process p1;
p2:process(clk,clr) --十位计数器
begin
if clr='1' then --异步清零功能
qtemph
else
if clk='1' and clk'event then
if qccl='1' and en='1'then
if qtemph="0101" then
qtemph
else
qtemph
end if;
end if;
end if;
end if;
end process p2;
end Behavioral;
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity synthesis_clock is
Port ( clr:in std_logic;
enble:in std_logic;
clk: in std_logic;
output1 : out std_logic_vector(3 downto 0);
output2 : out std_logic_vector(3 downto 0);
output3 : out std_logic_vector(3 downto 0);
output4 : out std_logic_vector(3 downto 0);
output5 : out std_logic_vector(3 downto 0);
output6 : out std_logic_vector(3 downto 0);
qcc:out std_logic);
end synthesis_clock;
architecture Behavioral of synthesis_clock is
component jinzhi60 is
port(clk,en,clr:in std_logic;
qh,ql:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end component;
component jinzhi24 is
port(en,clk:in std_logic;
temp:in std_logic;
q_h,q_l:out std_logic_vector(3 downto 0);
qcc:out std_logic);
end component;
signal qcc1,qcc2,qcc3:std_logic;
signal temp1,temp2,temp3,temp4,temp5,temp6:std_logic_vector(3 downto 0); begin
u1: jinzhi60 port map(clk,enble,clr,temp2,temp1,qcc1);
u2: jinzhi60 port map(clk,qcc1,clr,temp4,temp3,qcc2);
u3: jinzhi24 port map(qcc2,clk,qcc1,temp6,temp5,qcc3);
output1
output2
output3
output4
output5
output6
qcc
end Behavioral;
六.仿真结果
1.60,24进制计数器