📄 second1.vhd
字号:
Library ieee;
Use ieee.std_logic_1164.all;
Use ieee.std_logic_arith.all;
Use ieee.std_logic_unsigned.all;
Entity second1 is
Port(clk,reset:in std_logic;
Sec:buffer std_logic_vector(7 downto 0); -- ――秒输出端
Ensec:out std_logic --――秒计时器的进位,用来驱动分计时器
);
End;
Architecture a of second1 is
Begin
Process(clk,reset)
Begin
If reset='0' then
sec<="00000000"; -- ――对秒计时器清0
Elsif clk'event and clk='1' then
if sec=59 then
sec<="00000000";ensec<='1'; --――重复计数并产生进位
else
sec<=sec+1;ensec<='0'; --以驱动下一级
end if;
end if;
End process;
End;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -