]> rtime.felk.cvut.cz Git - fpga/spartan2/qcounter.git/blob - hex2lcd.vhd
Component instances replaced by entity instances.
[fpga/spartan2/qcounter.git] / hex2lcd.vhd
1 library IEEE;
2 use IEEE.STD_LOGIC_1164.all;
3 use IEEE.STD_LOGIC_ARITH.all;
4 use IEEE.STD_LOGIC_UNSIGNED.all;
5
6 --------------------------------------------------------------------------------
7 -- This module implements combinatorial circuit converting a 4 digit binary
8 -- number into the format of display segments.
9 --------------------------------------------------------------------------------
10
11 entity hex2lcd is
12   port (
13     hex : in  std_logic_vector (3 downto 0);
14     lcd : out std_logic_vector (6 downto 0));
15 end hex2lcd;
16
17 --------------------------------------------------------------------------------
18
19 architecture behavioral of hex2lcd is
20 begin
21   
22   with hex select lcd <=
23     "0000110" when "0001",
24     "1011011" when "0010",
25     "1001111" when "0011",
26     "1100110" when "0100",
27     "1101101" when "0101",
28     "1111101" when "0110",
29     "0000111" when "0111",
30     "1111111" when "1000",
31     "1101111" when "1001",
32     "1110111" when "1010",
33     "1111100" when "1011",
34     "0111001" when "1100",
35     "1011110" when "1101",
36     "1111001" when "1110",
37     "1110001" when "1111",
38     "0111111" when others;
39   
40 end Behavioral;
41