📄 gaiiao1.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity gaiiao1 is
port(clk,reset:in std_logic;
q:out std_logic_vector(3 downto 0));
end gaiiao1;
architecture gaiiao1_arc of gaiiao1 is
begin
process(clk,reset)
variable tmp:std_logic_vector(3 downto 0);
variable a:std_logic;
begin
if reset='1' then
tmp:="0000";
elsif clk'event and clk='1' then
if a='0' then
tmp:=tmp+1;
if tmp="1111" then
a:='1';
end if;
end if;
if a='1' then
tmp:=tmp-1;
if tmp="0000" then
a:='0';
end if;
end if;
end if;
q<=tmp;
end process;
end gaiiao1_arc;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -