Files
lt16lab/soc/peripheral/hex2physical.vhd

43 lines
1.5 KiB
VHDL

-- 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 <= "10000001"; -- "0"
when "10001" => cathodes <= "11110011"; -- "1"
when "10010" => cathodes <= "01001001"; -- "2"
when "10011" => cathodes <= "01100001"; -- "3"
when "10100" => cathodes <= "00110011"; -- "4"
when "10101" => cathodes <= "00100101"; -- "5"
when "10110" => cathodes <= "00000101"; -- "6"
when "10111" => cathodes <= "11110001"; -- "7"
when "11000" => cathodes <= "00000001"; -- "8"
when "11001" => cathodes <= "00100001"; -- "9"
when "11010" => cathodes <= "00010001"; -- "A"
when "11011" => cathodes <= "00000111"; -- "B"
when "11100" => cathodes <= "10001101"; -- "C"
when "11101" => cathodes <= "01000011"; -- "D"
when "11110" => cathodes <= "00001101"; -- "E"
when "11111" => cathodes <= "00011101"; -- "F"
when others => cathodes <= "11111111"; -- "Off"
end case;
end process;
end Behavioral;