forked from AndrewMcClelland/RISC_Computer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSeven_Seg_Display_Out.vhd
More file actions
54 lines (51 loc) · 1.16 KB
/
Copy pathSeven_Seg_Display_Out.vhd
File metadata and controls
54 lines (51 loc) · 1.16 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
LIBRARY ieee;
USE ieee.std_logic_1164.all;
ENTITY Seven_Seg_Display_Out IS
PORT (clk: IN STD_LOGIC;
data: IN STD_LOGIC_VECTOR(3 DOWNTO 0);
output: OUT STD_LOGIC_VECTOR(7 DOWNTO 0));
END Seven_Seg_Display_Out;
ARCHITECTURE Behavior of Seven_Seg_Display_Out IS
BEGIN
PROCESS (clk)
BEGIN
IF (clk'EVENT AND clk = '0') THEN
CASE data(3 DOWNTO 0) IS
WHEN "0000" =>
output <= "11000000";
WHEN "0001" =>
output <= "11111001";
WHEN "0010" =>
output <= "10100100";
WHEN "0011" =>
output <= "10110000";
WHEN "0100" =>
output <= "10011001";
WHEN "0101" =>
output <= "10010010";
WHEN "0110" =>
output <= "10000010";
WHEN "0111" =>
output <= "11111000";
WHEN "1000" =>
output <= "10000000";
WHEN "1001" =>
output <= "10010000";
WHEN "1010" =>
output <= "10001000";
WHEN "1011" =>
output <= "10000011";
WHEN "1100" =>
output <= "11000110";
WHEN "1101" =>
output <= "10100001";
WHEN "1110" =>
output <= "10000110";
WHEN "1111" =>
output <= "10001110";
WHEN others =>
output <= "11111111";
END CASE;
END IF;
END PROCESS;
END ARCHITECTURE Behavior;