-- EE 552 - Project -- Dustin Demontigny -- February 11, 2003 -- debouncer3.vhd -- Debounce mechanism for push buttons -- uses D-flip flop with enable configuration library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; use work.smart_eq_pack.all; entity debouncer3 is port( signal pb_input : in std_logic_vector(pb_number-1 downto 0); signal clock : in std_logic; signal db_output: out std_logic_vector(pb_number-1 downto 0)); end debouncer3; architecture DFF of debouncer3 is begin process (clock) variable count : integer := 0; begin if clock'event and clock = '1' then count := count + 1; -- counts the number of clock cycles if count = debounce_delay then -- when desired delay is reached db_output <= pb_input;-- inputs are mapped to outputs count := 0; -- and counting begins from zero end if; end if; end process; end DFF;