-- See the file "LICENSE" for the full license governing this code. --

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.lt16x32_global.all;
use work.config.all;

entity hex2physical is
	port(
		hex : in std_logic_vector(4 downto 0);
        cathodes : out std_logic_vector(7 downto 0)
	);
end hex2physical;

architecture Behavioral of hex2physical is
begin

    process(hex)
    begin
        case hex is
            when "10000" => cathodes <= not "11111100"; -- "0"
            when "10001" => cathodes <= not "01100000"; -- "1"
            when "10010" => cathodes <= not "11011010"; -- "2"
            when "10011" => cathodes <= not "11110010"; -- "3" 
            when "10100" => cathodes <= not "01100110"; -- "4"
            when "10101" => cathodes <= not "10110110"; -- "5" 
            when "10110" => cathodes <= not "10111110"; -- "6" 
            when "10111" => cathodes <= not "11100000"; -- "7" 
            when "11000" => cathodes <= not "11111110"; -- "8"     
            when "11001" => cathodes <= not "11110110"; -- "9"
            when "11010" => cathodes <= not "11101110"; -- "A"
            when "11011" => cathodes <= not "00111110"; -- "B"
            when "11100" => cathodes <= not "10011100"; -- "C"
            when "11101" => cathodes <= not "01111010"; -- "D"
            when "11110" => cathodes <= not "10011110"; -- "E"
            when "11111" => cathodes <= not "10001110"; -- "F"
            when others => cathodes <= not "00000000"; -- "Off"
        end case;
    end process;

end Behavioral;
