---------------------------------------------------------- -- keySense -- Author : Gautam Karnik -- Date : March 30, 2001 -- Filename : keySense.vhd -- Architecture : Behavioral -- Description : This entity takes the input lines from -- the keypad and determines when there is -- activity by simply "ANDing" all of the -- input lines together. ---------------------------------------------------------- library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; library work; use work.CDMA_pkg.all; entity keySense is generic ( datawidth : positive := 4 ); port ( clock, resetn : in std_logic; row : in std_logic_vector ( datawidth-1 downto 0 ); sense : out std_logic ); end entity keySense; architecture behavioral of keySense is begin synchronize_sensor : process (clock) is begin wait until clock'event and clock = '1'; if resetn = '0' then sense <= '1'; else sense <= (row(0) and row(1)) and (row(2) and row(3)); end if; end process synchronize_sensor; end behavioral;