Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module dibujar_pantalla(
- input reset,
- input CLK100MHZ,
- output VGA_HS,
- output VGA_VS,
- output [3:0] VGA_R,
- output [3:0] VGA_G,
- output [3:0] VGA_B
- );
- logic clk_vga;
- logic [11:0] VGA_COLOR;
- logic [11:0]vc_visible,hc_visible;
- logic [11:0] cambio = 'b0;
- clk_wiz_0 ins(
- .clk_out1(clk_vga),
- .locked(),
- .clk_in1(CLK100MHZ),
- .reset(0));
- driver_vga_1024x768(
- .clk_vga(clk_vga),
- .hs(VGA_HS),
- .vs(VGA_VS),
- .hc_visible(hc_visible),
- .vc_visible(vc_visible)
- );
- localparam CUADRILLA_XI = 212;
- localparam CUADRILLA_XF = CUADRILLA_XI + 600;
- localparam CUADRILLA_YI = 250;
- localparam CUADRILLA_YF = CUADRILLA_YI + 400;
- localparam COLOR_BLUE = 12'h00F;
- localparam COLOR_YELLOW = 12'hFF0;
- localparam COLOR_RED = 12'hF00;
- localparam COLOR_BLACK = 12'h000;
- localparam COLOR_WHITE = 12'hFFF;
- localparam COLOR_CYAN = 12'h0FF;
- always @(posedge clk_vga )
- begin
- if(( hc_visible != 0) && ( vc_visible != 0))
- //el fondo de la pantalla
- if((hc_visible > CUADRILLA_XI) && (hc_visible <= CUADRILLA_XF) && (vc_visible > CUADRILLA_YI) && (vc_visible <= CUADRILLA_YF))
- VGA_COLOR = COLOR_RED;// el fondo de la grilla.
- else
- VGA_COLOR = COLOR_BLACK;
- else
- VGA_COLOR = COLOR_BLACK;//esto es necesario para no poner en riesgo la pantalla.
- end
- assign {VGA_R, VGA_G, VGA_B} = VGA_COLOR;
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement