FPGA做的VGA显示问题,做的1024*768在1920*1080分辨率的显示器上...
时间:10-02
整理:3721RD
点击:
有效区内自动调整后右边还有一小部分没有显示正常颜色,而是像灰色线条一样的边框,是什么原因?还有最左边怎么会多出一点点不一样的颜色?
module VGA_ROM(clk_50M,res_n,hs,vs,r,g,b);
input clk_50M; //系统时钟50M
input res_n; // 复位
output hs,vs; //行、场信号
output r,g,b; //r,g,b信号各一位
wire hs;
wire vs;
wire CLK_65M;
pll_65 u1(
.inclk0(clk_50M),
.c0(CLK_65M), //1024*768,1344*806*60=65M
);
reg [15:0]h_cnt; //行计数器
reg [15:0]v_cnt; //列计数器
always@(posedge CLK_65M or negedge res_n)
begin
if(!res_n) h_cnt =16'd35)&&(v_cnt =16'd296)&&(h_cnt =Left&&h_cnt =Left+PixelWidth&&h_cnt =Left+2*PixelWidth&&h_cnt =Left+3*PixelWidth&&h_cnt =Left+4*PixelWidth&&h_cnt =Left+5*PixelWidth&&h_cnt =Left+6*PixelWidth&&h_cnt =Left+7*PixelWidth&&h_cnt =TOP&&v_cnt =TOP+PixelWidth1&&v_cnt =TOP+2*PixelWidth1&&v_cnt =TOP+3*PixelWidth1&&v_cnt<TOP+4*PixelWidth1) Ycoloradd<=3'b100;
else Ycoloradd<=3'b110;
end
wire [4:0]coloradd;
wire [2:0]color;
assign coloradd=Xcoloradd|{Ycoloradd,2'b00}; //将水平地址和垂直地址合成ROM实际地址
rom_data u2( // 调用一个单口ROM
.address(coloradd),
.clock(CLK_65M),
.q(color)
);
assign {r,g,b}=(flag==1)?color:0;
endmodule
C:\Users\xzq\Desktop
module VGA_ROM(clk_50M,res_n,hs,vs,r,g,b);
input clk_50M; //系统时钟50M
input res_n; // 复位
output hs,vs; //行、场信号
output r,g,b; //r,g,b信号各一位
wire hs;
wire vs;
wire CLK_65M;
pll_65 u1(
.inclk0(clk_50M),
.c0(CLK_65M), //1024*768,1344*806*60=65M
);
reg [15:0]h_cnt; //行计数器
reg [15:0]v_cnt; //列计数器
always@(posedge CLK_65M or negedge res_n)
begin
if(!res_n) h_cnt =16'd35)&&(v_cnt =16'd296)&&(h_cnt =Left&&h_cnt =Left+PixelWidth&&h_cnt =Left+2*PixelWidth&&h_cnt =Left+3*PixelWidth&&h_cnt =Left+4*PixelWidth&&h_cnt =Left+5*PixelWidth&&h_cnt =Left+6*PixelWidth&&h_cnt =Left+7*PixelWidth&&h_cnt =TOP&&v_cnt =TOP+PixelWidth1&&v_cnt =TOP+2*PixelWidth1&&v_cnt =TOP+3*PixelWidth1&&v_cnt<TOP+4*PixelWidth1) Ycoloradd<=3'b100;
else Ycoloradd<=3'b110;
end
wire [4:0]coloradd;
wire [2:0]color;
assign coloradd=Xcoloradd|{Ycoloradd,2'b00}; //将水平地址和垂直地址合成ROM实际地址
rom_data u2( // 调用一个单口ROM
.address(coloradd),
.clock(CLK_65M),
.q(color)
);
assign {r,g,b}=(flag==1)?color:0;
endmodule
C:\Users\xzq\Desktop
同问~~~~~~~~~~~~~~