📄 hour.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity hour is
port(clk,clr,set1,set0:in std_logic;
co:buffer std_logic;
ge,shi:buffer std_logic_vector(3 downto 0));
end;
architecture hour_1 of hour is
begin
process(clk,clr)
begin
if clr='0' then
ge<="0000";
shi<="0000";
co<='0';
elsif clk'event and clk='0' then
if set1='0' then
if shi="1001" then
shi<="0000";
else shi<=shi+'1';
end if;
elsif set0='0' then
if ge="1001" then
ge<="0000";
else ge<=ge+'1';
end if;
elsif ge="0100" and shi="0010" then
co<='0';
ge<="0000";
shi<="0000";
elsif ge="0010" and shi="0001" then
co<='1';
ge<=ge+'1';
elsif ge="1001" then
shi<=shi +'1';
ge<="0000";
else ge<=ge+'1';
end if;
end if;
end process;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -