Skip to content

Commit 3d48aa1

Browse files
Multimode Display Core
This core drives a 12-bit RGB display with three modes: 640x480 / 800x600 / 1024x768 / 1280x1024 all at 60 Hz
1 parent c2930b5 commit 3d48aa1

File tree

1 file changed

+19
-40
lines changed

1 file changed

+19
-40
lines changed

MMD.v

Lines changed: 19 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ module Display(
123123
reg[ 6:0] char;
124124
reg[11:0] color;
125125
reg[31:0] data;
126-
regflip;
126+
regflip;
127127
reg[ 7:0] locb;
128128
reg[11:0] off;
129129
reg[11:0] on;
@@ -139,29 +139,29 @@ module Display(
139139
wire[12:0]x;
140140
wire[10:0] y;
141141

142-
assign x = hCount-HVA+12'd8;
143-
assign y= vCount-VVA;
144-
assign col = x[2:0];
145-
assign row= y[2:0];
142+
assign x = hCount-HVA+12'd8;
143+
assign y= vCount-VVA;
144+
assign col = x[2:0];
145+
assign row= y[2:0];
146146
assign address= (y[9:3]<<8)+x[12:3]+13'd1;
147147
assign vgaRed= color[11:8];
148-
assign vgaGreen= color[7:4];
149-
assign vgaBlue = color[3:0];
148+
assign vgaGreen = color[7:4];
149+
assign vgaBlue = color[3:0];
150150

151151
CharSet acs(clock,temp,early);
152152
locByte loc(data,row[1:0],pixels);
153153

154154
initial begin
155-
Hsync<=~POL;
156-
Vsync<=~POL;
157-
char<=7'd0;
158-
color<=12'd0;
159-
data<=32'd0;
160-
hCount<=11'd0;
161-
on<=12'd0;
162-
off<=12'd0;
163-
temp<=8'd0;
164-
vCount<=10'd0;
155+
Hsync<= ~POL;
156+
Vsync<= ~POL;
157+
char<= 7'd0;
158+
color<=12'd0;
159+
data<=32'd0;
160+
hCount<=11'd0;
161+
on<=12'd0;
162+
off<=12'd0;
163+
temp<= 8'd0;
164+
vCount<=10'd0;
165165
end
166166

167167
always @ (posedge clock) begin
@@ -200,34 +200,13 @@ module Display(
200200
data<= early;
201201
flip<= address[7];
202202
off<= address[11:0];
203-
on<=~address[11:0];
203+
on<=~address[11:0];
204204
end
205205
end
206206
endmodule
207207

208-
module forth(
209-
input wire i,
210-
output reg o
211-
);
212-
reg t;
213-
214-
initial begin
215-
t<=1'd0;
216-
o<=1'd0;
217-
end
218-
219-
always@(posedge i)begin
220-
t<=~t;
221-
end
222-
223-
always@(posedge t)begin
224-
o<=~o;
225-
end
226-
227-
endmodule
228-
229208
module locByte(
230-
inputwire [31:0]l,
209+
inputwire [31:0] l,
231210
input wire [ 1:0] s,
232211
outputwire [ 7:0] b
233212
);

0 commit comments

Comments
 (0)