-
Notifications
You must be signed in to change notification settings - Fork 0
/
num_rom.vhd
138 lines (111 loc) · 2.03 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
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use IEEE.NUMERIC_STD.all;
library work;
use work.defines.all;
entity num_rom is
port(
x : in integer range 0 to 8-1;
y : in integer range 0 to 8-1;
texture_id : in integer range 0 to 10-1;
ARGB : out VGA_ARGB_t
);
end num_rom;
architecture RTL of num_rom is
signal s_dataout : integer range 0 to 1;
subtype t is integer range 0 to 1;
type st is array (0 to (10*8*8)-1) of t;
constant c_memory : st :=
(
0,1,1,1,1,1,1,0,
0,1,1,1,1,1,1,0,
0,1,0,0,1,1,1,0,
0,1,0,0,1,0,1,0,
0,1,0,1,1,0,1,0,
0,1,1,1,0,0,1,0,
0,1,1,0,0,0,1,0,
0,1,1,1,1,1,1,0,
0,0,0,0,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,1,1,1,0,0,0,
0,1,1,1,1,0,0,0,
1,1,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
0,0,1,1,1,1,0,0,
0,1,1,1,1,1,1,0,
0,1,0,0,0,0,1,0,
0,1,0,0,0,0,1,0,
0,0,0,1,1,1,1,0,
0,1,1,1,1,1,0,0,
0,1,0,0,0,0,0,0,
0,1,1,1,1,1,1,1,
0,1,1,1,1,1,1,0,
0,0,0,0,0,0,0,1,
0,0,0,0,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