-
Notifications
You must be signed in to change notification settings - Fork 6
/
num_rom.vhd
141 lines (123 loc) · 4.87 KB
/
num_rom.vhd
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
-- Alessandro Montanari 880606-Y555
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity Num_Rom is
port(
en : in STD_LOGIC;
address : in STD_LOGIC_VECTOR(6 downto 0);
rd : in STD_LOGIC;
data_out : out STD_LOGIC_VECTOR(0 to 7)
);
end Num_Rom;
architecture Behavioral of Num_Rom is
begin
process(en,rd,address)
begin
if(en = '1' and rd = '1') then
case address is
-- 0
when "0000000" => data_out <= "00111110";
when "0000001" => data_out <= "01100011";
when "0000010" => data_out <= "01100011";
when "0000011" => data_out <= "01101011";
when "0000100" => data_out <= "01101011";
when "0000101" => data_out <= "01100011";
when "0000110" => data_out <= "01100011";
when "0000111" => data_out <= "00111110";
-- 1
when "0001000" => data_out <= "00001100";
when "0001001" => data_out <= "00111100";
when "0001010" => data_out <= "00001100";
when "0001011" => data_out <= "00001100";
when "0001100" => data_out <= "00001100";
when "0001101" => data_out <= "00001100";
when "0001110" => data_out <= "00001100";
when "0001111" => data_out <= "00111111";
-- 2
when "0010000" => data_out <= "00111110";
when "0010001" => data_out <= "01100011";
when "0010010" => data_out <= "01100011";
when "0010011" => data_out <= "00000110";
when "0010100" => data_out <= "00001100";
when "0010101" => data_out <= "00011000";
when "0010110" => data_out <= "00110011";
when "0010111" => data_out <= "01111111";
-- 3
when "0011000" => data_out <= "00111110";
when "0011001" => data_out <= "01100011";
when "0011010" => data_out <= "00000011";
when "0011011" => data_out <= "00001110";
when "0011100" => data_out <= "00001110";
when "0011101" => data_out <= "00000011";
when "0011110" => data_out <= "01100011";
when "0011111" => data_out <= "00111110";
-- 4
when "0100000" => data_out <= "00000110";
when "0100001" => data_out <= "00001110";
when "0100010" => data_out <= "00011110";
when "0100011" => data_out <= "00110110";
when "0100100" => data_out <= "01100110";
when "0100101" => data_out <= "01111111";
when "0100110" => data_out <= "00000110";
when "0100111" => data_out <= "00000110";
-- 5
when "0101000" => data_out <= "01111111";
when "0101001" => data_out <= "01100000";
when "0101010" => data_out <= "01100000";
when "0101011" => data_out <= "01111110";
when "0101100" => data_out <= "00000011";
when "0101101" => data_out <= "00000011";
when "0101110" => data_out <= "01100011";
when "0101111" => data_out <= "00111110";
-- 6
when "0110000" => data_out <= "00111110";
when "0110001" => data_out <= "01100011";
when "0110010" => data_out <= "01100000";
when "0110011" => data_out <= "01111110";
when "0110100" => data_out <= "01100011";
when "0110101" => data_out <= "01100011";
when "0110110" => data_out <= "01100011";
when "0110111" => data_out <= "00111110";
-- 7
when "0111000" => data_out <= "01111111";
when "0111001" => data_out <= "01100011";
when "0111010" => data_out <= "00000110";
when "0111011" => data_out <= "00001100";
when "0111100" => data_out <= "00011000";
when "0111101" => data_out <= "00011000";
when "0111110" => data_out <= "00011000";
when "0111111" => data_out <= "00011000";
-- 8
when "1000000" => data_out <= "00111110";
when "1000001" => data_out <= "01100011";
when "1000010" => data_out <= "01100011";
when "1000011" => data_out <= "01100011";
when "1000100" => data_out <= "00111110";
when "1000101" => data_out <= "01100011";
when "1000110" => data_out <= "01100011";
when "1000111" => data_out <= "00111110";
-- 9
when "1001000" => data_out <= "00111110";
when "1001001" => data_out <= "01100011";
when "1001010" => data_out <= "01100011";
when "1001011" => data_out <= "01100011";
when "1001100" => data_out <= "00111111";
when "1001101" => data_out <= "00000011";
when "1001110" => data_out <= "01100011";
when "1001111" => data_out <= "00111110";
-- .
when "1111000" => data_out <= "00000000";
when "1111001" => data_out <= "00000000";
when "1111010" => data_out <= "00000000";
when "1111011" => data_out <= "00000000";
when "1111100" => data_out <= "00000000";
when "1111101" => data_out <= "00000000";
when "1111110" => data_out <= "00011000";
when "1111111" => data_out <= "00011000";
when others => data_out <= "00000000";
end case;
else
data_out <= (others => 'Z');
end if;
end process;
end Behavioral;