Beruflich Dokumente
Kultur Dokumente
Group 3
Leader:
Members:
Instructor
TABLE OF CONTENTS
Page
List of Tables ii
Abstract iv
I. Introduction 1
II. Objectives 3
V. List of Materials 10
VI. Prototype 12
X. Conclusions 57
XI. Recommendations 59
Appendices 60
i
References 65
LIST OF TABLES
ii
LIST OF FIGURES
Figure No. Title Page
Figure 1 Top View of the Prototype 2
Figure 2 Front View of the Prototype 2
Figure 3 Left-Side View 2
Figure 4 Right-Side View 2
Figure 5 Block Diagram of Tap Until You Drop 3
Figure 6 Flowchart of the Game 6
Figure 7 Project Prototype showing Essential Parts 12
Figure 8 VHDL Codes for Sequence 1 15
Figure 9 VHDL Codes for Sequence 2 23
Figure 10 VHDL Codes for Sequence 3 30
Figure 11 VHDL Codes for Sequence 4 38
Figure 12 Pin Assignments of Sequence 1-4 45
Figure 13 RTL View of Sequence 1-4 46
Figure 14 Summary Report for Sequence 1 46
Figure 15 Functional Simulation of Sequence 1 47
Figure 16 Timing Simulation of Sequence 1 47
Figure 17 Summary Report for Sequence 2 48
Figure 18 Functional Simulation of Sequence 2 48
Figure 19 Timing Simulation of Sequence 2 48
Figure 20 Summary Report for Sequence 3 49
Figure 21 Functional Simulation of Sequence 3 49
Figure 22 Timing Simulation of Sequence 3 49
Figure 23 Summary Report for Sequence 4 50
Figure 24 Functional Simulation of Sequence 4 50
iii
Figure 25 Timing Simulation of Sequence 4 50
Abstract
Games especially those involved on gadgets have been one of the endeavors nowadays. One of
the recent android games that have been popular is the so - called Piano Tiles – a rhythm game
where its keys are moving in a fast-paced manner displayed on the screen of a device such as an
Android phone. The player should press the key/s at the right moment before it disappears from
the screen to keep playing, or else it will be a game over. This project entitled, “Tap Until You
Drop” is based from the said android game; however, with the group’s modifications, the project
was designed. Instead of an android phone, it was completely modified to a prototype that
consists of 6 push buttons as input and a 6x6 LED matrix as output which are programmed
through Quartus II VHDL codes and DE2 Altera Field Programmable Gate Array (FPGA) board.
Moreover, instead of black and white, the LEDs consist of red, blue and green colors. The
game’s goal is that the player should tap an LED, before it turns off, through a push button
iv
I. Introduction
The advancement of new technology has been taking place since the beginning of human
history. It is usually represented by electronic devices nowadays such as computer, mobile phones
and etc. Behind this electronic device is a circuit that executes process and even controls a function
in a computer namely, logic circuits. This circuit execute logical operation on information to
process it.
need to comprise a circuit that provides both input and output relationship that is relative to the
Boolean algebra. This is known as the logic circuits. Furthermore, since logic gates are the building
blocks of digital electronics, they have been castoff on different digital products including personal
computers, tablets, mobile phones, and etc. For this project, a combination of logic circuits will be
The project is entitled “Tap Until You Drop”, and it is composed of a 6 x 6 led matrix with
6 push buttons. The concept of this game is adapted from the IOS and android application “Piano
Tiles” that consists of many classical songs that is being played as the game began, and the gamer
must aim to tap all the black tiles without making any mistakes. In this project, each level has a
corresponding led color and pattern and as the level increases the speed also increases. A field
programmable gate array (FPGA) and the combination of logic circuits will be used for the
In order to accomplish the prototype of the “Tap Until You Drop” game the proponents
1|Page
2. Push Buttons
3. Cardboard
The dimensions of the casing are 8.5 inch in height x 7 inch in length x 7 inch in width.
Looking like an arcade machine, the whole casing is made up of cardboard which is covered with
a printed layout evidently seen on the side view figures shown below and with a light blue
construction paper seen on the top and front views. Presented also on Figure 1, the screen of the
so – called arcade machine is a 6x6 led matrix where different led patterns will appear. Below the
led matrix are the 6 push buttons to be pressed during the game.
Figure 1. Top view of the Prototype Figure 2. Front View of the Prototype
2|Page
II. Objectives
The project aims to design a game entitled “Tap Until You Drop” with the use of Quartus
software, Altera FPGA board and other external devices such as push buttons and LEDs. To
1. To create a prototype that consists of a 6x6 RGB LED matrix with other external
components such as push buttons that are compatible to the Altera board for
programming.
2. To implement through Quartus II VHDL codes the different game modules needed then
3. To test and evaluate the functionality of the implemented project via game play.
Block Diagram
PROCESS:
FPGA
INPUT
OUTPUT
6 Push 6 x 6 LED
Buttons Four Sequence Matrix,
Generators with Buzzer
Clock and
Buzzer Codes
3|Page
Operation of Project
On the perspective of the player, the inputs of the game are the 6 push buttons located at
the bottom of each column of the 6x6 LED matrix. Through these, the player can control the game
whereas when a button is pushed or tapped, goal of the game is achieved which is to turn off an
LED before it disappears on a situated column. The output of the game is designated or can be
seen on the 6x6 LED matrix where lights are running in a specific pattern. The process of the
whole game is made possible by the different modules implemented on the Quartus II VHDL
Codes and on the Altera FPGA Board. Sequence 1 – 4 modules are the main interface of the project
since it is where the pattern and speed of the running LEDs and the time duration of the game were
developed. Additional sound output feature was added which can be heard through a buzzer
whenever the player taps a button – made possible by the buzzer code part in each Sequence
Operated by Altera FPGA board, the game “Tap Until You Drop” is associated with a
prototype that is composed of 6x6 RGB LED matrix that displays colors red, green and blue. The
player can play the game via the 6 push buttons located at the bottom of each column of the matrix.
Tap Until You Drop’s main objective is to turn off the randomly running LEDs before it disappears
at a situated column by tapping the specific push button at the end of the matrix. Also, the LEDs
will randomly lit then run which goes from slow to fast speed conveying some complexity in the
game. Hence, the running LEDs are going faster as the game proceeds. In addition, a sound is
4|Page
Discussion of Each Module Utilized
The following are the four sequence modules that were utilized in the program that made the
Sequence 1 – In this module, the LED lights running are in its lowest speed with a clock
Sequence 2 – Here, the speed of the running LEDs is quite faster compared to Sequence
Sequence 3 – From here, it can be observed that higher number of sequence module
indicates a faster speed of the running LEDs; hence, this module would indicate a higher
level of difficulty compared from the first two mentioned. It has an estimated time duration
of 9 seconds.
Sequence 4 – This module consists of the most difficult level of the game since the LEDs
Buzzer – This portion is part of each sequence module generated; here, the sounds
generated every time the player taps a push button is made possible.
5|Page
Project Flowchart and Algorithm
No
Yes
1. Start of Game.
2. Sequence module will generate the patterns for the running 6x6 LED Lights.
3. When LED reached the bottom and then a button is tapped, a sound will generate.
5. End of Game.
6|Page
IV. Design Specifications
The table below shows the pins assigned to the terminals used in the DE2 Altera FPGA Board; it
also indicates the General Purpose Input/ Output (GPIO) and the design specifications of the whole
project. Pin assignments below are true for all sequence generator modules implemented.
7|Page
Output - LED LED2[2] PIN_J20 2 3
8|Page
Output - LED LED5[4] PIN_K19 5 5
9|Page
V. List of Materials
Board
On-board Crystal: 16 & 12MHz
Button
DC forward voltage:
Red: 625nm
Green: 525nm
Blue: 470nm
Lead Polarity:
Lead 1: Negative
Lead 2: Positive
Lead 3: Negative
Lead 4: Negative
10 | P a g e
220 Ohms
Resistor
½ Watt
Material: Plastic
Compatible swath size:12x12x7.3mm
Dimension:
Male to Female
7.87 in x 2.2 in x 0.12 in (20 cm x 5.6 cm x
Connector
0.3 cm)
Laptop with
Quartus II 13.0sp1
(64-bit)
11 | P a g e
VI. Prototype
Shown in the picture is the prototype associated to the project where the game is
implemented through Altera FPGA and Quartus II VHDL codes. The essential parts evident in the
prototype are the 6 push buttons and 6x6 LED matrix. The 6 red push buttons located at the bottom
part of the LEDs, serve as the controller of the user/player to be able to play Tap until You Drop.
Each button controls a corresponding column of the LED matrix which LEDS are connected in
parallel to each other. The game proper is displayed through the LED matrix where the lights are
running in a pace of increasing manner. These LEDs also show the pattern or sequence made by
the sequence generator. Via the push buttons, the specific LED needed to be turned off during the
game is tapped.
12 | P a g e
VII. Project Development
At the time of the proposal we researched for the games that we could implement in the
Quartus II. We came up with the game entitled “Tap Until You Drop” which is a modified
The group bought all the materials needed for the prototype which are rgb led, push
buttons, connecting wires, electrical tape for the insulation of the soldered wires,
and cardboards. We decided to make the prototype to look like a mini arcade. In
making the prototype, the group must consider the connections of the led lights
since there are many of it involved there is a tendency that it might get shorted
that’s why the group must properly solder the wire and insulate it. Our prototype is
also grounded whenever we touch the laptop the sound of the buzzer changes. In
line with the codes, the group must do more research in order to better implement
the project.
The group used an available reference for our project which we modified to meet
the main and specific objectives of the game but it took days before it work though
there are no errors but we cannot implement it properly in the prototype as desired.
The codes of the LED patterns each have the clock where the speed of the pattern
is set and the time duration of the game. The group implemented for sequence
modules with different clock for each one in Quartus II VHDL codes. The patterns
for each sequence are all the same the only difference is the speed for each one. For
13 | P a g e
the first sequence is 11 seconds. The second is 9 seconds. The third one is 7 seconds.
From Piano Tiles which is the basis of the game, the group pursued to generate a
sound whenever the push button is tapped. At first only one buzzer was tried; after
further research and troubleshooting, each column of the matrix was connected to
a buzzer. A total of 6 buzzers were utilized which is the same number of push
buttons used. The codes in order to generate a sound through the buzzer is
incorporated in the sequence module. As can be seen in the codes, push buttons will
work when it is high or 1 while the buzz will sound when it is low or 0.
The group had a very hard time to compile the modules altogether; hence, playing each
module or each level requires a manual operation of the Quartus software and of the
Altera FPGA Board. After several troubleshooting of both the program and the
prototype, the final function of Tap Until You Drop was developed. As it started on the
Quartus software, the 6x6 RGB LED light will run down the matrix while some whistle
sound can be heard from the buzzer. To play the game, the player should hold the push
button tight rather than just simply pressing it; moreover, as the button is pressed, the
LED light upon reaching the last row will just stop rather than being turn off. Finally,
as the LED is tapped through the push buttons, a clearer and louder sound can be heard
through the buzzers. The game stops when all the LED lights are already tapped by the
14 | P a g e
VIII. VHDL Programming
The following show the VHDL codes of each sequence module utilized and implemented
in the project which made the game’s features and functions possible. Codes that make sound
possible is also associated with each sequence module. The pin assignments and the Register
SEQUENCE 1
VHDL Codes
15 | P a g e
16 | P a g e
17 | P a g e
18 | P a g e
19 | P a g e
20 | P a g e
21 | P a g e
Figure 8. VHDL Codes for Sequence 1
22 | P a g e
SEQUENCE 2
VHDL Codes
23 | P a g e
24 | P a g e
25 | P a g e
26 | P a g e
27 | P a g e
28 | P a g e
29 | P a g e
Figure 9. VHDL Codes for Sequence 2
SEQUENCE 3
VHDL Codes
30 | P a g e
31 | P a g e
32 | P a g e
33 | P a g e
34 | P a g e
35 | P a g e
36 | P a g e
Figure 10. VHDL Codes for Sequence 3
37 | P a g e
SEQUENCE 4
VHDL Codes
38 | P a g e
39 | P a g e
40 | P a g e
41 | P a g e
42 | P a g e
43 | P a g e
44 | P a g e
Figure 11. VHDL Codes for Sequence 4
Upon assigning pins, compilation or summary report, functional simulation and timing
simulation of each of the four Sequence Generators are presented below which are simulated
SEQUENCE 1
Compilation Report/ Summary Report
46 | P a g e
Functional Simulation
Timing Simulation
47 | P a g e
SEQUENCE 2
Functional Simulation
Timing Simulation
48 | P a g e
SEQUENCE 3
Functional Simulation
Timing Simulation
49 | P a g e
SEQUENCE 4
Functional Simulation
Timing Simulation
the game Tap Until You Drop. Actual images shown are the patterns generated which is the
No. No.
1 31
2 32
3 33
51 | P a g e
4 34
5 35
6 36
7 37
8 38
52 | P a g e
9 39
10 40
11 41
12 42
13 43
53 | P a g e
14 44
15 45
16 46
17 47
18 48
54 | P a g e
19 49
20 50
21 51
22 52
23 53
55 | P a g e
24 54
25 55
26 56
27 57
28 58
56 | P a g e
29 59
30
X. Conclusions
Tap Until You Drop is designed by developing program codes with the use of Quartus II
software implemented on a DE2 Altera Field Programmable Array (FPGA) board to a prototype
that consists of 6 push buttons as input and 6x6 LED matrix as output. In addition, based from
1. Through the use of soldering iron and leads, connecting wires, push buttons, and RGB
LEDs the prototype for the project was created. Its casing was made of illustration boards,
folders, paste materials, and papers with some design that added to the attractivity of the
prototype as a whole. The prototype looks like a mini arcade machine where the 6x6 LED
matrix connected in parallel, serves as the screen display while the 6 push buttons serve as
the controls of the user. The functionality of the codes programed on the Altera Board
through Quartus VHDL codes is reflected on this prototype. Adjustments on the codes
where made whenever its desired function is not seen on the prototype.
57 | P a g e
2. The game modules that were programed to the prototype through Quartus II VHDL codes
are the four sequence modules. The four sequence generator modules serve as the main
interface of the game. Through these, patterns are shown on the running lights of the 6x6
LED matrix along with the speed of the LEDs and the time duration of the whole game;
also, codes that generate sounds through the buzzer are manifested in these modules.
Sequence 1 to 4 indicate a level of difficulty where the speed of the LEDs run faster as the
game proceeds. In addition, software simulation results of each module utilized were
obtained such as the RTL view, compilation report, functional simulation and timing
simulation.
3. Upon executing a hardware simulation of the created prototype programmed with the
different modules needed through Quartus II VHDL codes that are implemented on an
Altera FPGA Board, the following realizations were attained. Firstly, when a push button
is tapped before an LED disappears in a situated column, the LED does not turn off literally
but only stops. However, pattern for the 6x6 LED matrix was generated that involve
varying speed which can be observed in an increasing manner. With this, the main interface
of the game is accomplished. Finally, a sound can be heard through a buzzer whenever a
button is tapped which feature is similar to the basis of the game, Piano Tiles.
58 | P a g e
XI. Recommendations
After implementing the project prototype and software, the following are the group’s
recommendations for future references:
To increase the complexity of the game, developers could add more LEDs
instead of tapping any color of LED going down, the player should tap
only a specific color of LED for each round, for instance, color red only
A storage module can be added to the system to save a record of the scores
obtained on each level then be able to recall whenever desired by the player.
An external LCD Display can be added where the score is conveyed and
where the player can choose a level of difficulty before starting the game.
59 | P a g e
APPENDICES
60 | P a g e
61 | P a g e
RGB LED
62 | P a g e
63 | P a g e
Push Button
64 | P a g e
REFERENCES
https://docs-apac.rs-online.com/webdocs/1698/0900766b81698ecf.pdf
https://www.kitronik.co.uk/pdf/5mm_RGB_led.pdf
https://www.digchip.com/datasheets/parts/datasheet/1838/CFR-25JB-220R-pdf.php
65 | P a g e