basren.blogg.se

Pong game code in vhdl
Pong game code in vhdl












  1. #PONG GAME CODE IN VHDL HOW TO#
  2. #PONG GAME CODE IN VHDL SOFTWARE#

Īlso, If you want to display a colour other than black, you need to specify 8 bit values of red, green, and blue for the monitor to display. Basically, it activates the pixels one by one (serially) in an orderly fashion from left to right, going downwards. It keeps doing this until it reaches (y = 480, x = 640), where it will start the process all over again. When it reaches the edge of the screen (x = 640), the monitor starts activating pixels at (y = 1, x = 0) and does the same thing. The monitor activates one pixel at a time, going right along the top of the display until it reaches (y = 0, x = 640).

pong game code in vhdl

The output of our keyboard module is a 'one hot' 5 bit output, the direction the snake goes depends on the position of the 1.Ī 640 x 480 VGA display works like this: a pixel is activated at the top left (y = 0, x = 0). This information will only apply to a PS/2 keyboard, do not try to use a different type of keyboard with an adapter and expect the same results. Note that all key presses have the same break code in common: F0. To look up the keyboard make/break codes, there are many sources. It wants to make the total number of ones an odd number. If there are an even number of ones, it will be 1, and if there are an odd number of ones, the parity bit will be 0. The parity bit is either a one or a zero, depending on how many 1s are in the make code. It sends first a zero to start, then 8 bits of data specific to the key you pressed (the make code), a parity bit (PB), and finally a one to stop. To expand, the first image shows what the keyboard will send within every 11 bits. You do not need to define your own clock to work with the keyboard. The keyboard has its own clock that you can read. The keyboard sends data on the negative edge of its clock.Ħ.

pong game code in vhdl

The keyboard will send the same 11 bits containing the make code over and over again while you hold a specific key down.ĥ. (There are exceptions when pressing specific keys, don't worry about these too much)Ĥ. When it is released, it will send an 11 bit 'break' code, proceeding with the same make code again. When a key is first pressed, it sends 11 bits of data in the form of a 'make' code. A single key press will consist of at least 33 bits of input from the keyboard.ģ. When the keyboard is not sending input, it is sending a constant 1 (high) for its data, as well as the clock.Ģ. The input from the keyboard is straightforward to understand. **Mainly, this instructable tries to be a concise guideline for future project-goers who need a reference for various modules, and to understand more of the capabilities of the FPGA board. These were the most difficult parts of the project to do, because there is not a great amount of useful information on the internet for implementing these functions with Verilog.

#PONG GAME CODE IN VHDL HOW TO#

Subsequent steps will explain the features of the game, and explain VGA output/keyboard input to give future students a better idea of how they work, and how to implement them in their own projects.

#PONG GAME CODE IN VHDL SOFTWARE#

Quartus II Software to edit and open the Verilog code USB cable to upload program to the board PS/2 keyboard (a USB keyboard with a PS/2 adapter may or may not work, do not count on it)

pong game code in vhdl

The four contributors to this project are:Ĭomputer Engineering students: Daniel Lovegrove, Ian SweetlandĮlectrical Engineering students: Kristjan Jacobson, Roberto Alves For example, in the YouTube website, you can play snake over a video while it loads, and Google has made a doodle in which you can play a slightly updated version of snake. The game originated from the 1976 arcade game Blockade, and variations on the game are still around today. You lose if the head of the snake collides with its own body, or if the snake hits one of the borders. The snake gets longer and harder to control the more items it consumes. "Snake" is a simple game where the user controls a snake to eat items generated at random locations in the play area. Coding is done with Verilog HDL via Quartus II. The board used throughout the project is an Altera DE2 Cyclone IV board. This project was completed for the class ECE2220, at the University of Manitoba, for the Fall 2015 term.














Pong game code in vhdl