📄 counter60.vhd
字号:
LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;
USE IEEE.STD_LOGIC_UNSIGNED.ALL;
ENTITY counter60 IS
PORT(
clk,clr : IN STD_LOGIC;
y0,y1 : buffer STD_LOGIC_VECTOR(3 downto 0);
oc : OUT STD_LOGIC);
END counter60;
ARCHITECTURE a OF counter60 IS
signal q:std_logic;
BEGIN
p1: Process(clk)
Begin
if(rising_edge(clk)) then
if (clr='1') then
y0<=(others=>'0');q<='0';
else
y0<=y0+1;q<='1';
if y0=9 then
y0<=(others=>'0');q<='0';
end if;
end if;
end if;
end process p1;
p2: Process(q)
Begin
if(rising_edge(q)) then
if(clr='1') then
y1<=(others=>'0');
else
y1<=y1+1;
if y1=5 then
y1<=(others=>'0');
end if;
end if;
end if;
end process p2;
oc<='1'when y0="1001" and y1="0101"
else '0';
END a;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -