📄 53_counter.vhd
字号:
library IEEE;
use IEEE.std_logic_1164.all;
package mycntpkg is
component count port(clk,rst : in std_logic;
cnt : inout std_logic_vector(2 downto 0));
end component;
end mycntpkg;
library IEEE;
use IEEE.std_logic_1164.all;
entity count is port(clk,rst : in std_logic;
cnt : inout std_logic_vector(2 downto 0));
end count;
--use work.std_arith.all;
library IEEE;
use IEEE.std_logic_arith.all;
--use work.all;
architecture archcount of count is
begin
counter:process(clk,rst)
begin
if rst = '1' then
cnt <= (others =>'0');
elsif (clk'event and clk = '1') then
cnt <= cnt +1;
end if;
end process;
end archcount;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -