OpenCores
URL https://opencores.org/ocsvn/z80soc/z80soc/trunk

Subversion Repositories z80soc

[/] [z80soc/] [branches/] [RonivonCosta/] [S3E/] [decoder_7seg.vhd] - Blame information for rev 31

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 11 rrred
LIBRARY IEEE;
2
USE  IEEE.STD_LOGIC_1164.all;
3
USE  IEEE.STD_LOGIC_UNSIGNED.all;
4
 
5
entity decoder_7seg is
6
        port
7
        (
8
                NUMBER          : in   std_logic_vector(3 downto 0);
9
                HEX_DISP        : out  std_logic_vector(6 downto 0)
10
        );
11
end decoder_7seg;
12
 
13
architecture rtl of decoder_7seg is
14
begin
15
process(NUMBER)
16
begin
17
        case NUMBER is
18
                --0 to 9
19
                when "0000" => HEX_DISP <= "1000000";
20
                when "0001" => HEX_DISP <= "1111001";
21
                when "0010" => HEX_DISP <= "0100100";
22
                when "0011" => HEX_DISP <= "0110000";
23
                when "0100" => HEX_DISP <= "0011001";
24
                when "0101" => HEX_DISP <= "0010010";
25
                when "0110" => HEX_DISP <= "0000011";
26
                when "0111" => HEX_DISP <= "1111000";
27
                when "1000" => HEX_DISP <= "0000000";
28
                when "1001" => HEX_DISP <= "0011000";
29
                -- A to F
30
                when "1010" => HEX_DISP <= "0001000";
31
                when "1011" => HEX_DISP <= "0000011";
32
                when "1100" => HEX_DISP <= "1000110";
33
                when "1101" => HEX_DISP <= "0100001";
34
                when "1110" => HEX_DISP <= "0000110";
35
                when "1111" => HEX_DISP <= "0001110";
36
                when others => HEX_DISP <= "1111111";
37
        end case;
38
end process;
39
end rtl;
40
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.