📄 xhour.vhd
字号:
library IEEE;
use IEEE.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
use ieee.std_logic_arith.all;
entity xhour is
port (
clkhour: in STD_LOGIC;
reset: in STD_LOGIC;
hourout: out STD_LOGIC_VECTOR (5 downto 0)
);
end xhour;
architecture xhour_arch of xhour is
signal hour : std_logic_vector(5 downto 0);
begin
-- <<enter your statements here>>
process(reset,clkhour,hour)
alias lcount : std_logic_vector(3 downto 0) is hour(3 downto 0);
alias hcount : std_logic_vector(1 downto 0) is hour(5 downto 4);
begin
if reset='0' then
hourout<="000000";
hour<="000000";
else
if (clkhour='1' and clkhour'event) then
if lcount=9 then
lcount<="0000";
hcount<=hcount+1;
else
if hour="100011" then
hour<="000000";
else
lcount<=lcount+1;
end if;
end if;
end if;
hourout<=hour;
end if;
end process;
end xhour_arch;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -