FPGA Implementation of PING PONG Game using Spartan3 FPGA Image Processing kit
Call for Price
This Project implements the design of graphic game named “Ping Pong” in Spartan3 FPGA Image Processing kit. “Ping Pong” is a game with 2 players.
Description
Abstract
This Project implements the design of graphic game named “Ping Pong” in Spartan3 FPGA Image Processing kit. “Ping Pong” is a game with 2 players. One is the human player and the opponent is created by the game and tries to simulate a basic AI player. The opponent and also the human player are fighting for points. The player controls a green rectangular board and the artificial opponent controls a blue rectangular board. The ball is a small red square that bounce from one board to another and also from the left and right walls. The background of the game is white. The losing occurs when a player isn’t able to catch the ball and the ball passes by him, and so the other player gains a point. This happenes until one player reaches the score of 128 points and then the player remains at this score. The design is complete, meets most of the requirements, and it has been verified by physical implementation.
Demonstration Video
Tool required
Software
- Xilinx ISE 11.1i
Language
- VHDL
Hardware
- Spartan3 FPGA Image Processing kit
- VGA Monitor
- PS/2 Keyboard
Block Diagram for PING PONG Game using Spartan3 FPGA Image Processing kit
Introduction
In the implementation of this game it was used VHDL codes that implements a keyboard reader for the control of the game, a monitor horizontal, vertical synchronizing signals and color signal, a 7 segment 4 digit led display control.
The player controls the game from the key Left Arrow, Right Arrow of the keyboard and also from BTN1 and BTN2 of the DIO4. The game is turned on/off by the SW1.The score of the player and his artificial opponent is shown on a 2 digit 7 segments display.
- The game inputs and outputs signals are shown in Table 1
Input signals Output signals
Clk-a 50 Mhz clock from the FPGA, synchronous signal | Hsync-a synchronous signal used for the horizontal synchronization of the monitor |
SW1-a asynchronous signal generated by the SW1 that begins or stops the game. |
Vsync- a synchronous signal used for the vertical synchronization of the monitor |
BT1- a asynchronous signal generated by BTN1 that controls the right movement of players pad |
Red, Green, Blue- asynchronous signals used for coloring the pixels of the monitor screen. |
BT2- a asynchronous signal generated by BTN2 that controls the left movement of players pad |
SSG(6:0)- asynchronous signals used for the 4 digit display, by turning on/off the segments |
PS2C-a synchronous signal that is generated by the PS/2 keyboard, and contains the clock generated by the keyboard. |
AN(1:0)- synchronous signals used for turning on/off the 2 digit display i.e selecting the corresponding digit |
PS2D-a asynchronous signal that is generated by the PS/2 keyboard, and contain the data from the keyboard |
PERR- asynchronous signals that turns on LED1 when a parity error from reading the keyboard keys appears |
RESET-a asynchronous signal that is generated by the BTN5 and that resets the keyboard reading mechanism when an error in reading occurs |
FERR- asynchronous signals that turns on LED2 when a frame error from reading the keyboard keys appears |
The player’s and enemy pads are rectangular shapes with 140 column pixels and 20 row pixels. The enemy’s pad slides from left to right or right to left in the top of the screen the first 20 row pixels, but the player’s pad slides in the last 20 row pixels (figure 2).
Hardware implementation of Ping Pong game using FPGA
1)Power connection ,VGA and PS2 connection to the FPGA kit
2)JTAG connection with the FPGA kit.
3) VGA output of the Ping Pong game
Conclusion
The game is fully functional as is intended in this form but one’s cane modify from the type of players: can be human to human or AI to AI, or to implement more mode of play, or to implement more speed levels, or to change the position of the board from left to right, to have more player, and so on in Spartan3 FPGA Image Processing kit.
Additional information
Weight | 1.000000 kg |
---|
Reviews
There are no reviews yet.