📄 sec.vhd
字号:
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity sec is
port(clk,clr,set0,set1:in std_logic;
co:buffer std_logic;
ge,shi:buffer std_logic_vector(3 downto 0));
end;
architecture sec_1 of sec is
begin
process(clk,clr)
begin
if clr='0' then
ge<="0000";
shi<="0000";
elsif clk'event and clk='0' then
if set1='0' then
if shi="1001" then
shi<="0000";
else shi<=shi+'1';
end if;
elsif set0='0' then
if ge="1001" then
ge<="0000";
else ge<=ge+'1';
end if;
elsif ge="1001" and shi="0101" then
co<=not co;
ge<="0000";
shi<="0000";
elsif ge="1001" and shi="0010" then
co<=not co;
ge<="0000";
shi<=shi +'1';
elsif ge="1001" then
shi<=shi +'1';
ge<="0000";
else ge<=ge+'1';
end if;
end if;
end process;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -