library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; -- Translate a 4 Bit unsigned number to a 7-Segment Control -- ---0--- -- | | -- 5 1 -- | | -- ---6--- -- | | -- 4 2 -- | | -- ---3--- -- Display the correct number for 0 - 9 and E for all other -- numbers which can be coded with 4 Bits (10-15). entity bin2seg is port ( number_i: in unsigned(3 downto 0); seg_o: out std_ulogic_vector(6 downto 0) ); end; architecture rtl of bin2seg is begin trans_p: process(number_i) begin case number_i is when "0000" => seg_o <= "1000000"; when "0001" => seg_o <= "1111001"; -- continue here... when others => seg_o <= "0000110"; end case; end process; end; -- architecture