library IEEE; use IEEE.STD_LOGIC_1164.ALL; use IEEE.STD_LOGIC_ARITH.ALL; use IEEE.STD_LOGIC_UNSIGNED.ALL; entity SC_HEX is Port ( sc : in std_logic_vector(7 downto 0); prs : in std_logic; hex : out std_logic_vector(3 downto 0)); end SC_HEX; architecture behavioral of SC_HEX is begin process(prs, sc) begin if (prs'event and prs = '1') then case sc is when X"70" => hex <= "0000"; -- if keypad 0 is pressed (sc = KP 0) then -- ouptut hex receives 0000 -- You have to do the other cases for keys "KP 1" -- to "KP 9" and "A" to "F". when others => null; -- invalid key, ignore it end case; end if; end process; end behavioral;