📄 cnt60.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity cnt60 is
port (clk:in std_logic;
en,rst:in std_logic;
tset,set:in std_logic;----
ql:buffer std_logic_vector(3 downto 0);
qh:buffer std_logic_vector(3 downto 0));
end entity;
architecture one of cnt60 is
begin
p1: process (clk,en,rst,set,tset)
-- variable templ,temph:std_logic_vector(3 downto 0);
begin
if rst='1' then ql<=(others=>'0');qh<=(others=>'0');
elsif clk'event and clk='1' then
if en='1' then
if ql="1001" then ql<="0000";
if qh="0101" then qh<="0000";
else qh<=qh+1;
end if;
else ql<=ql+1;
end if;
else if set='1' then
if ql="1001" then ql<="0000";
else ql<=ql+1 ;
end if;
end if;
if tset='1' then
if qh="0101" then qh<="0000";
else qh<=qh+1 ;
end if;
end if;
end if;
end if;
end process p1;
end one;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -