43 lines
1.5 KiB
VHDL
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 "00000" => cathodes <= "10000001"; -- "0"
|
|
when "00001" => cathodes <= "11110011"; -- "1"
|
|
when "00010" => cathodes <= "01001001"; -- "2"
|
|
when "00011" => cathodes <= "01100001"; -- "3"
|
|
when "00100" => cathodes <= "00110011"; -- "4"
|
|
when "00101" => cathodes <= "00100101"; -- "5"
|
|
when "00110" => cathodes <= "00000101"; -- "6"
|
|
when "00111" => cathodes <= "11110001"; -- "7"
|
|
when "01000" => cathodes <= "00000001"; -- "8"
|
|
when "01001" => cathodes <= "00100001"; -- "9"
|
|
when "01010" => cathodes <= "00010001"; -- "A"
|
|
when "01011" => cathodes <= "00000111"; -- "B"
|
|
when "01100" => cathodes <= "10001101"; -- "C"
|
|
when "01101" => cathodes <= "01000011"; -- "D"
|
|
when "01110" => cathodes <= "00001101"; -- "E"
|
|
when "01111" => cathodes <= "00011101"; -- "F"
|
|
when others => cathodes <= "11111111"; -- "Off"
|
|
end case;
|
|
end process;
|
|
|
|
end Behavioral;
|