Академический Документы
Профессиональный Документы
Культура Документы
A game of Ping-Pong.
DATE: 24/10/2011
Page | i
DECLARATION OF ORIGINALITY
UNIVERSITY OF PRETORIA
The Department of places great emphasis upon
integrity and ethical conduct in the preparation of all written work submitted for academic evaluation.
While academic staff teach you about referencing techniques and how to avoid plagiarism, you too have
a responsibility in this regard. If you are at any stage uncertain as to what is required, you should speak
to your lecturer before any written work is submitted.
You are guilty of plagiarism if you copy something from another authors work (eg a book, an article or a
website) without acknowledging the source and pass it off as your own. In effect you are stealing
something that belongs to someone else. This is not only the case when you copy work word-for-word
(verbatim), but also when you submit someone elses work in a slightly altered form (paraphrase) or use
a line of argument without acknowledging it. You are not allowed to use work previously produced by
another student. You are also not allowed to let anybody copy your work with the intention of passing if
off as his/her work.
Students who commit plagiarism will not be given any credit for plagiarized work. The matter may also be
referred to the Disciplinary Committee (Students) for a ruling. Plagiarism is regarded as a serious
contravention of the Universitys rules and can lead to expulsion from the University.
The declaration which follows must accompany all written work submitted while you are a student of the
Department of .......................................................................... No written work will be accepted
unless the declaration has been completed and attached.
Full names of student: ............................................................................
Student number:
............................................................................
Topic of work:
............................................................................
Declaration
1.
I understand what plagiarism is and am aware of the Universitys policy in this regard.
2.
I declare that this (eg essay, report, project, assignment,
dissertation, thesis, etc) is my own original work. Where other peoples work has been used (either from
a printed source, Internet or any other source), this has been properly acknowledged and referenced in
accordance with departmental requirements.
3.
I have not used work previously produced by another student or any other person to hand in as
my own.
4.
I have not allowed, and will not allow, anyone to copy my work with the intention of passing it
off as his or her own work.
SIGNATURE
...................................................................................................................................
Page | ii
Contents
List of Figures ............................................................................................................................................... iii
AIM OF THE PRACTICAL ................................................................................................................................ 1
METHOD........................................................................................................................................................ 1
RESULTS ........................................................................................................................................................ 2
CONCLUSION............................................................................................................................................... 14
BIBLIOGRAPHY ............................................................................................................................................ 14
List of Figures
Page | iii
METHOD
Firstly, following the design principles stated in (Wakerley, 2007), the project was divided into three
parts, i.e. Next-State Logic, State Memory and Output Logic. A state diagram was then constructed
according to the word description of the problem given, to account for every possible situation in the
game. Secondly, the Excitation table and Excitation maps were constructed to relate inputs and current
states to next/future states.
It was chosen not to implement state registers, but rather only bit counters in conjunction with
decoders and a clock signal. The design of the court was expanded into a two-dimensional LED array
where the ball exhibited dynamic behaviour. The players would play the game by using the remote,
which allows for a comfortable and exciting gaming experience.
After the theoretical design of the project had been completed, the actual layout of the circuit had to be
designed and built. The circuit design was created using PSPICE and ORCAD software. After this step had
been completed, the actual circuit was realised using several logic gates, flip-flops, bit-counters, LEDs
and so forth.
Finally, the project also had to be coded in VHDL format. This was done only after the circuit had been
completely constructed.
Page | 1
RESULTS
State diagram
In figure 1 it can be seen that scoring has not yet been implemented. After scoring has been taken into
account, it adds two more states to the above diagram i.e. one state being Player1 wins and the other
being Player2 wins.
Page | 2
Page | 3
S0
S1
LPB
RPB
L-LAMP
R-LAMP
S0*
S1*
Page | 4
Figure 6 above shows the relationship between the Next-State logic and Current-State logic. In each of
these states, the outputs of the circuit were clearly defined, the outputs being the LED array as well as
the scoring implementation. This is the Excitation table that was used to generate the Excitation maps in
order to obtain the simplified excitation equations.
Page | 5
Excitation maps
This equation represents the next value of S0 as a function of the inputs and previous states. This
confirms the Mealy machine design hypothesis.
Page | 6
This equation represents the next value of S1 as a function of the inputs and previous states. This
confirms the Mealy machine design hypothesis.
The two excitation equations, given by S0* and S1*, were implemented by using normal combinational
logic design, i.e. logical AND, OR and NOT gates. Seeing as SO* and S1* are both functions of the inputs
and current states, the scoring implementation would also have to be dependent on these inputs and
states. The scoring implementation was formally described by the following equations:
Circuit diagrams
Please refer to the diagrams below for the full representation of the logic circuit. Please also note that in
the logic diagrams, each logic gate is actually situated within its own specific IC (Integrated Circuit).
These ICs are all supplied with 5 Volts DC to enable proper functionality of the logic gates housed
within.
CLK
S1
CLK
CLR
Bit
Counter
2
1
3
2
1
3
2
1
3
3-8 Decoder
Page | 8
560
560
Wires leading
to the 4-2
decoder
560
560
Page | 9
(LL + RL)'
CLK
Wires leading
to the LEDs
3
CLK
CLK
1
2
4-2
Decoder
3
1
2
Bit
Counter
Page | 10
S0
2
1
3
2
9
S1
8
10
4
3
6
5
LPB
1
2
6
S0*
4
5
RPB
6
1
3
2
RL
LL
3
2
RPB
6
1
9
3
8
10
RL
2
3
S1*
1
4
5
9
1
2
8
LL
10
4
6
5
S0
2
1
2
13
12
3
4
5
9
10
11
Page | 11
VCC
VCC
3
2
5.6k
6
5.6k
Page | 12
RPB
RL
1
3
2
2
S1
Score_Player_1
Score_Player_2
3
2
1
3
S0
LPB
LL
1
3
2
3
2
S1
S0
2
1
3
2
3
1
4
Clock
Q
Q
11
CLK
4
10
3
11
CLR
PRE
13
10
5
6
7474
12
Score_Player_2
8
6
Q
Q
9
8
CLK
CLR
PRE
13
1
A
B
C
D
QA
QB
QC
QD
5
9
2
12
CLK1
CLK2
CLR
LOAD
74196
7474
Page | 13
CONCLUSION
It can be seen that a fully functional sequential logic circuit can be implemented to create a game of
Ping-Pong. Throughout this project, it was seen that memory forms an integral part of the design of
sequential logic circuits and also that memory can be used to perform a large variety of tasks.
BIBLIOGRAPHY
Wakerley, J. (2007). Digital Design: Principles and Practices 4th Edition. Pearson Prentice Hall.
Page | 14