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

Subversion Repositories potato

[/] [potato/] [trunk/] [soc/] [pp_seg7dec.vhd] - Blame information for rev 61

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 61 skordal
-- The Potato Processor - A simple processor for FPGAs
2
-- (c) Kristian Klomsten Skordal 2015 <kristian.skordal@wafflemail.net>
3
-- Report bugs and issues on <http://opencores.org/project,potato,bugtracker>
4
 
5
library ieee;
6
use ieee.std_logic_1164.all;
7
 
8
-- @brief 7-Segment Display Decoder
9
entity pp_seg7dec is
10
        port(
11
                input  : in  std_logic_vector(3 downto 0);
12
                output : out std_logic_vector(6 downto 0)
13
        );
14
end entity pp_seg7dec;
15
 
16
architecture behaviour of pp_seg7dec is
17
begin
18
 
19
        decoder: process(input)
20
        begin
21
                case input is
22
                        when x"0" =>
23
                                output <= b"1000000";
24
                        when x"1" =>
25
                                output <= b"1111001";
26
                        when x"2" =>
27
                                output <= b"0100100";
28
                        when x"3" =>
29
                                output <= b"0110000";
30
                        when x"4" =>
31
                                output <= b"0011001";
32
                        when x"5" =>
33
                                output <= b"0010010";
34
                        when x"6" =>
35
                                output <= b"0000010";
36
                        when x"7" =>
37
                                output <= b"1111000";
38
                        when x"8" =>
39
                                output <= b"1111111";
40
                        when x"9" =>
41
                                output <= b"0011000";
42
                        when x"a" =>
43
                                output <= b"0001000";
44
                        when x"b" =>
45
                                output <= b"0000011";
46
                        when x"c" =>
47
                                output <= b"1000110";
48
                        when x"d" =>
49
                                output <= b"0100001";
50
                        when x"e" =>
51
                                output <= b"0000110";
52
                        when x"f" =>
53
                                output <= b"0001110";
54
                end case;
55
        end process decoder;
56
 
57
end architecture behaviour;

powered by: WebSVN 2.1.0

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