Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////////////////
- // Create Date: 05.03.2019 14:28:42
- // Module Name: draw_background
- // Description:
- //////////////////////////////////////////////////////////////////////////////////
- `timescale 1ns / 1ps
- module draw_background(
- input wire pclk,
- input wire [10:0] hcount_in,
- input wire hsync_in,
- input wire hblnk_in,
- input wire [10:0] vcount_in,
- input wire vsync_in,
- input wire vblnk_in,
- output reg [10:0] hcount_out,
- output reg hsync_out,
- output reg hblnk_out,
- output reg [10:0] vcount_out,
- output reg vsync_out,
- output reg vblnk_out,
- output reg [11:0] rgb_out
- );
- reg [11:0] rgb_out_nxt;
- always @(posedge pclk)
- begin
- // Just pass these through.
- hsync_out <= hsync_in;
- vsync_out <= vsync_in;
- hblnk_out <= hblnk_in;
- vblnk_out <= vblnk_in;
- hcount_out <= hcount_in;
- vcount_out <= vcount_in;
- // During blanking, make it it black.
- if (vblnk_in || hblnk_in) rgb_out <= 12'h0_0_0;
- else
- begin
- // Active display, top edge, make a yellow line.
- if (vcount_in == 0) rgb_out <= 12'h0_0_0;
- //LITERKA M
- else if (hcount_in >= 100 && hcount_in <= 150 && vcount_in >=150 && vcount_in <= 450) rgb_out <= 12'hf_a_0;
- else if (hcount_in >= 150 && hcount_in <= 200 && vcount_in >=150 && vcount_in <= 200) rgb_out <= 12'hf_a_0;
- else if (hcount_in >= 200 && hcount_in <= 250 && vcount_in >=200 && vcount_in <= 250) rgb_out <= 12'hf_a_0;
- else if (hcount_in >= 250 && hcount_in <= 300 && vcount_in >=150 && vcount_in <= 200) rgb_out <= 12'hf_a_0;
- else if (hcount_in >= 300 && hcount_in <= 350 && vcount_in >=150 && vcount_in <= 450) rgb_out <= 12'hf_a_0;
- //Uzupelnienia(male kwadraty)
- else if (hcount_in >= 175 && hcount_in <= 200 && vcount_in >=200 && vcount_in <= 225) rgb_out <= 12'hf_a_0;
- else if (hcount_in >= 250 && hcount_in <= 275 && vcount_in >=200 && vcount_in <= 225) rgb_out <= 12'hf_a_0;
- //LITERKA R
- else if (hcount_in >= 450 && hcount_in <= 500 && vcount_in >=150 && vcount_in <= 450) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 500 && hcount_in <= 625 && vcount_in >=150 && vcount_in <= 200) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 625 && hcount_in <= 675 && vcount_in >=200 && vcount_in <= 250) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 500 && hcount_in <= 625 && vcount_in >=250 && vcount_in <= 300) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 625 && hcount_in <= 660 && vcount_in >=300 && vcount_in <= 375) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 640 && hcount_in <= 675 && vcount_in >=375 && vcount_in <= 450) rgb_out <= 12'h0_7_a;
- //Uzupelnienia(male kwadraty)
- else if (hcount_in >= 625 && hcount_in <= 650 && vcount_in >=175 && vcount_in <= 200) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 625 && hcount_in <= 650 && vcount_in >=250 && vcount_in <= 275) rgb_out <= 12'h0_7_a;
- else if (hcount_in >= 600 && hcount_in <= 625 && vcount_in >=300 && vcount_in <= 325) rgb_out <= 12'h0_7_a;
- else rgb_out <= 12'h8_8_8;
- end
- end
- endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement