|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
library ieee;--消抖动 延迟10ms
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity dou is
port(s,clk1k:in std_logic;
so ut std_logic);
end;
architecture one of dou is
signal cout4 :std_logic_vector(3 downto 0);
signal f,en:std_logic;
begin
process(s)
begin
if s'event and s='1'then
f<='1';end if;
end process;
process(clk1k,f)
begin
if f='1' then
if clk1k'event and clk1k='1' then
if cout4=9 then cout4<=(others=>'0');en<='0';f<='0';
else cout4<=cout4+1;en<='1';end if;end if;
else cout4<=(others=>'0'); en<='0';
end if;
end process;
process(en)
constant a:std_logic:='0';
begin
if en='1' then
so<=a;else so<=s;
end if;
end process;
end; |
|