Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
546 Views

how to interface keypad with FPGA

Im doing a project that need an input from user so Im using 4x4 keypad 4x4 keypad-1-750x750.jpg

and this is my VHDL code , I dont know what is the problem . when the reset button is 1 there is no output but when it is low all the leds are 1

 

part of the code

 

 

 entity keypad is

 Port ( 

 

 

reset : IN STD_LOGIC;

row : IN STD_LOGIC_VECTOR( 4 DOWNTO 1); 

col : IN STD_LOGIC_VECTOR( 4 DOWNTO 1); 

leds : OUT STD_LOGIC_VECTOR ( 9 DOWNTO 1)

 );

end keypad;

 

 

architecture Behavioral of keypad is

begin

 

PROCESS(reset)

BEGIN 

IF reset='1' THEN leds<="000000000";

ELSE

CASE row IS

WHEN "1000" => --ROW 1 

IF col="1000" THEN leds <="000000001";

ELSIF col="0100" THEN leds <="000000010";

ELSIF col="0010" THEN leds <="000000100";

ELSIF col="0001" THEN leds <="000000000";

END IF ; 

Tags (1)
0 Kudos
0 Replies