Pong on FPGA

Released by Atari in 1972, Pong was a simple video game that became a huge commercial success and is actually considered the game that started the whole video game industry. Pong has simple 2D black-and-white graphics and involves hitting a ball with a paddle located on one side of the screen, simulating table tennis. It can be played with a computer controlled opponent or with another human player and has many different variants that emerged over the years, including on home consoles.

This project features a game of Pong on a Pluto FPGA board that connects to a VGA monitor and has a mouse as a game controller. The HS and VS (horizontal and vertical synchronization, respectively) are digital signals and can be directly connected to FPGA pins or using two low values resistances. The R, G, B signals are analog, so three resistances are required to form voltage dividers that get the 3.3V FPGA output close to the 0.7V nominal values of the aforementioned analog signals (you can find more information about these values and calculations in the link).

Displaying the actual game on the monitor is a bit tricky, you have to generate the HS and VS to be able to display something on the monitor. Then, drawing the actual game, the paddles and the ball is another story, you need to generate the R, G, B and make the ball moving. Another part that can get hairy is the collision detection, you need the ball bouncing off when it hits the paddles. The code for all this is available below, as well as detailed pictures on the board, the VGA connectors and other Pong FPGA project links.

Pong on FPGA: [Link]