-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdisplay7.vhdl
36 lines (34 loc) · 996 Bytes
/
display7.vhdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_unsigned.all;
entity display7 is
port(
data : in std_logic_vector(3 downto 0);
segments : out std_logic_vector(6 downto 0)
);
end display7;
architecture rtl of display7 is
begin
process(data)
begin
case conv_integer(data) is
when 0 => segments <= "0000001";
when 1 => segments <= "1001111";
when 2 => segments <= "0010010";
when 3 => segments <= "0000110";
when 4 => segments <= "1001100";
when 5 => segments <= "0100100";
when 6 => segments <= "0100000";
when 7 => segments <= "0001111";
when 8 => segments <= "0000000";
when 9 => segments <= "0000100";
when 10 => segments <= "0001000";
when 11 => segments <= "1100000";
when 12 => segments <= "0110001";
when 13 => segments <= "1000010";
when 14 => segments <= "0110000";
when 15 => segments <= "0111000";
when others => segments <= "0110000";
end case;
end process;
end rtl;