📄 counter2plus.vhd.bak
字号:
library ieee;
use ieee.std_logic_1164.all; --引用库
entity counter2 is
port(clk:in std_logic; --输入:原始频率
reset:in std_logic; --复位
RS: :out std_logic; --RS
Gout:out std_logic); --输出:分频后输出
signal tempGout : std_logic;--保存上次状态
signal tempRS: std_gogic;--保存上次状态
end;
architecture behavioral of counter2 is
signal countc: integer range 0 to 3;
begin
process(clk)
begin
if reset='1' then --复位
countc<=0;
tempGout<='0';
tempRS<='0';
elsif clk'event and clk='1' then --clk上升沿引发输出跳变
countc<=countc+1;
if countc>3 then
countc<=0;
end if;
if countc=0 then
tempGout<=not tempGout; --输出跳变
end if;
end if;
Gout<=tempGout; --输出
RS<=tempRS; --输出
end process;
end behavioral;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -