Skip to content
Steve Julian edited this page Jan 31, 2022 · 43 revisions

Verilog FPGA Pingpong Game wiki

Introduction

The objective of this project was to design and implement an electronic pingpong game using Verilog and the Basys3 Field Programmable Gate Array (FPGA) kit.

According to the project requirements document provided: “This assignment is to enable the student to extend electrical and electronic knowledge for specialist applications in embedded systems.”

Digilent Basys 3 FPGA Board

Requirements

The following specification was provided in the project requirements document:

“It is a game of two players; each player has a push button. Either player can start the game by pressing his/her push button. Eight LEDs represent the position of the ball. The ball movement is indicated by the illumination of the LEDs and the opponent player should press his/her push button only, when the ball is at his end. The ball is considered struck if the player presses the push button while the ball is resident on the last LED at the players end. The ball should be flying until any player violates the rule. Once violation happens, then a player gets the point. Scores of the players should be displayed on seven segments LED. The speed of the ball’s movement should increase as the game progresses.”

Methodology

The requirements specification was transcribed into an overall State Machine diagram as a method for gaining understanding of what work needed to be done.

Pingpong State Machine Diagram

Test Results

Initial testing was found to have somewhat unpredictable results. The one change that appeared to remedy this was writing the decimal places on the 7-segment display. Previously the decimal place was ignored however it was found that writing a blank output had the result of the FPGA circuit behaving as described by the State Machine diagram.

A system crash in combination with a development process failure appeared to have been the cause of some data loss which delayed the demonstration of the finished project. Changes to the development process were implemented to prevent this from recurring and the project was successfully completed.

Features Wish List

The attachment of a piezoelectric buzzer or speaker to an output interface of the Basys 3 could be valuable both to testing and to improving the game play experience via audio notifications of game events such as ball hitting and game round points awarding.

Conclusion

This project proved to be a useful exercise for learning how to design, implement and test an FPGA circuit working with an FPGA development board. The project was completed and functioned correctly as per the provided requirement specifications.

References

Project Report (~3.6 MB PDF, 31 pages)