Untitled
public text v1 · immutable always @(posedge clk) begin
if (candraw) begin
n_vga_blank <= 1'b0;
// output a red rectangle in the middle of the screen
for (i = 0; i < 16; i = i + 2) begin
if (x > (i * 80) && x < ((i + 1) * 80)) begin
red <= 10'b11_1111_1111;
green <= 10'd0;
blue <= 10'd0;
// with a blue background
end else begin
red <= 10'd0;
green <= 10'd0;
blue <= 10'b11_1111_1111;
end
end
end else begin
// if we are not in the visible area, we must set the screen blank
n_vga_blank <= 1'b1;
end