---------------------------------------------------------- -- keyDecode -- Author : Gautam Karnik -- Date : March 30, 2001 -- Filename : keyDecode.vhd -- Architecture : Behavioral -- Description : This entity is the decodes the row that -- has been pressed based on the input -- lines from the keypad when the input -- lines have been driven low. ---------------------------------------------------------- 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 keyDecode is generic ( datawidth : positive := 4 ); port ( resetn : in std_logic; clock : in std_logic; clear : in std_logic; rowIn : in std_logic_vector ( datawidth-1 downto 0 ); sense : in std_logic; rowOut : out std_logic_vector ( datawidth-1 downto 0 ) ); end entity keyDecode; architecture behavioral of keyDecode is begin decode : process (clock, resetn ) is begin wait until rising_edge ( clock ); if (resetn = '0') then rowOut <= (others => '1'); -- active low else if sense = '0' then rowOut <= rowIn; elsif clear = '1' then rowOut <= (others => '1'); end if; end if; end process decode; end behavioral;