📄 sanjiao.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity sanjiao is
port( en,clk:in std_logic;
co:out std_logic_vector(9 downto 0));
end sanjiao;
architecture behav of sanjiao is
signal b:std_logic;
signal c:std_logic_vector(9 downto 0):="0000000000";
begin
process(clk)
begin
if en='1' then
if (clk'event and clk='1') then
if(b='0') then
if(c=1023) then
b<='1';
c<="1111111110";
else
c<=c+'1';
end if;
elsif(b='1') then
if(c=1) then
b<='0';
c<="0000000000";
else
c<=c-'1';
end if;
end if;
co<=c;
end if;
end if;
end process;
end architecture;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -