📄 cnt6.vhd
字号:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
entity cnt6 is
port (
Q: OUT std_logic_VECTOR(2 downto 0);
CLK: IN std_logic;
ACLR: IN std_logic);
end cnt6;
architecture Behavioral of cnt6 is
signal count : std_logic_vector(2 downto 0):="000"; --count
signal reset : std_logic;
signal clk_in: std_logic;
BEGIN
Q<=count;
reset<=ACLR;
clk_in<=CLK;
process (clk_in, reset,count) begin if reset='1' then count <= (others => '0'); elsif clk_in='1' and clk_in'event then
if count="101" then count<="000";
else count <= count + 1;
end if; end if;end process;
end Behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -