This repository has been archived on 2023-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Arkanoid2PDE1/vga_sync.v
Kirill Kirilenko baf891d878 Version 1.0 released.
Implemented features: ball moving, platform moving, showing scores on digital table, game reset.
2012-05-28 19:06:42 +04:00

25 lines
No EOL
470 B
Verilog

`ifndef _vga_sync_
`define _vga_sync_
// VGA synchronization
localparam VGA_LINES_LIMIT = 799;
localparam VGA_FRAMES_LIMIT = 524;
always @ (posedge clk25MHz)
begin
if(h_counter == VGA_LINES_LIMIT)
h_counter <= 0;
else
h_counter <= (h_counter + 1);
end
always @ (posedge clk25MHz)
begin
if (v_counter == VGA_FRAMES_LIMIT)
v_counter <= 0;
else if (h_counter == VGA_LINES_LIMIT)
v_counter <= (v_counter + 1);
end
`endif // _vga_sync_