-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrom1b_green_imagenes8_16x16.vhd
183 lines (169 loc) · 4.93 KB
/
rom1b_green_imagenes8_16x16.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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
------- ROM creada automaticamente por ppm2rom -----------
------- Felipe Machado -----------------------------------
------- Area de Tecnologia Electronica -----------
------- Universidad Rey Juan Carlos ----------------------
------- https://github.com/felipe-m/img_vhdl--------------
----------------------------------------------------------
--------Datos de la imagen -------------------------------
--- Fichero original : imagenes8_16x16.ppm
--- Filas : 128
--- Columnas : 16
--- Color : Blanco y negro. 2 niveles (1 bit)
------ Puertos -------------------------------------------
-- Entradas ----------------------------------------------
-- clk : senal de reloj
-- addr : direccion de la memoria
-- Salidas ----------------------------------------------
-- dout : dato de 16 bits de la direccion addr (un ciclo despues)
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.ALL;
entity ROM1b_1f_green_imagenes8_16x16 is
port (
clk : in std_logic; -- reloj
addr : in std_logic_vector(7-1 downto 0);
dout : out std_logic_vector(16-1 downto 0)
);
end ROM1b_1f_green_imagenes8_16x16;
architecture BEHAVIORAL of ROM1b_1f_green_imagenes8_16x16 is
signal addr_int : natural range 0 to 2**7-1;
type memostruct is array (natural range<>) of std_logic_vector(16-1 downto 0);
constant filaimg : memostruct := (
"1111100000111111",
"1111000000000111",
"1111000110111111",
"1110101110111111",
"1110100111011111",
"1110011110000111",
"1111111111111111",
"1111000000111111",
"1110000000000111",
"1100000000000011",
"1111001001001111",
"1111100000011111",
"1111000000001111",
"1111000110001111",
"1111111111111111",
"1111111111111111",
"1111100000111111",
"1111000000000111",
"1111000110110001",
"1110101110111001",
"1110100111011101",
"1110011110000011",
"1111111111110011",
"1100000000000111",
"1100000000001111",
"1110000000010011",
"1111000010000011",
"1111100000000011",
"1111000000011111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111100000011111",
"1111100000011111",
"1000010110100001",
"1000110110110001",
"1100001111000011",
"1100000110000011",
"1100010000100011",
"1110011111100111",
"1110000000000111",
"1111000000001111",
"1100000000000011",
"1100001001000011",
"1100000000000011",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111110000111111",
"1111000000001111",
"1110000000000111",
"1101100001100011",
"1111110011110011",
"1100110000110011",
"1000110000110001",
"1001100001100001",
"1000000000000001",
"1000000000000001",
"1000000000000001",
"1000000000000001",
"1001000110001001",
"1011100110011101",
"1111111111111111",
"1111111111111111",
"1111110000111111",
"1111000000001111",
"1110000000000111",
"1100000000000011",
"1100000000000011",
"1100011001100011",
"1000011001100001",
"1000000000000001",
"1000000000000001",
"1001100110011001",
"1010011001100101",
"1000000000000001",
"1001000110001001",
"1011100110011101",
"1111111111111111",
"1111111111111111",
"1111111111111111",
"1111111110001111",
"1111111101101111",
"1111111011101111",
"1111110111011111",
"1110000111011111",
"1100000010000111",
"1000000100000011",
"1000001000000001",
"1001001000000001",
"1000101001000001",
"1100001000100001",
"1110000100000011",
"1111111110000111",
"1111111111111111",
"1111111101111111",
"1111111101111111",
"1110001111110011",
"1100000010001011",
"1000001000000001",
"1000100000010001",
"1000000000000001",
"1000010010010001",
"1100000000000011",
"1100010000000011",
"1110000001000111",
"1111000100000111",
"1111100000001111",
"1111110000011111",
"1111111000111111",
"1111111111111111"
);
begin
addr_int <= TO_INTEGER(unsigned(addr));
P_ROM: process (clk)
begin
if clk'event and clk='1' then
dout <= filaimg(addr_int);
end if;
end process;
end BEHAVIORAL;