📄 prevent_flutter.vhd
字号:
--Prevent Flutter Module
--消抖模块
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity Prevent_Flutter is
port(
clk : in std_logic; --clock
in1: in std_logic_vector(3 downto 0); --input signal
out1 : out std_logic_vector(3 downto 0) --output signal
);
end Prevent_Flutter;
architecture code of Prevent_Flutter is
signal x,y:std_logic_vector(3 downto 0);
begin
process(clk,x,y)
begin
if clk'event and clk='1' then
for i in 0 to 3 loop
x(i)<=in1(i);
y(i)<=x(i);
end loop;
end if;
for j in 0 to 3 loop
out1(j)<=x(j) or (not y(j));
end loop;
end process;
end code;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -