📄 antishakeswitchprocedure.txt
字号:
开关防抖程序
library ieee;
use ieee.std_logic_1164.all;
entity dou is
port(din,clk: in std_logic;
dout: out std_logic);
end dou;
architecture beha of dou is
signal x,y:std_logic;
begin
process(clk)
begin
if clk'event and clk='1' then
x<=din;
y<=x;
end if;
dout<=x and (not y);
end process;
end beha;
_____________________________________________
此程序,针对1位dout,对于多位dout可采用STD_LOGIC_VECTOR(n to 0)来定义(高位到低位)
dout为Low有效,假设x输出为Low,当存在开关抖动的时候,x瞬时为High,y则为not(y=x) Low;而dout为Low.消除了抖动产生的影响.
可以作为消除glitch的电路
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -