0% found this document useful (0 votes)
2K views6 pages

LED Based Snake PDF

The document describes a student project to implement a LED-based snake game using digital logic circuits. The project was completed by 4 students from the Electrical Engineering and Computer Science departments. They successfully created the snake game with features like snake movement in 4 directions, variable speed, regeneration after leaving the screen, and LED patterns to display "SNAKE" at the start and end of the game. The project utilized components like LED matrices, 7-segment displays, EPROMs, multiplexers, counters, latches, and flip-flops. The students spent 5 weeks developing the game, first simulating the circuit and then implementing it with hardware. By the end of the project, they had achieved all planned deliverables and

Uploaded by

Salma Saleem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2K views6 pages

LED Based Snake PDF

The document describes a student project to implement a LED-based snake game using digital logic circuits. The project was completed by 4 students from the Electrical Engineering and Computer Science departments. They successfully created the snake game with features like snake movement in 4 directions, variable speed, regeneration after leaving the screen, and LED patterns to display "SNAKE" at the start and end of the game. The project utilized components like LED matrices, 7-segment displays, EPROMs, multiplexers, counters, latches, and flip-flops. The students spent 5 weeks developing the game, first simulating the circuit and then implementing it with hardware. By the end of the project, they had achieved all planned deliverables and

Uploaded by

Salma Saleem
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Group 14 |1

Project Report
Digital Logic Circuit
Dr. Shahrukh Athar

LED BASED SNAKE GAME

NAME ROLL NO MAJOR


Muhammad Shoaib Hassan 14100005 Electrical Engineering
Syed Muhammad Ali 14100167 Electrical Engineering
Muhammad Ali Gulzar 14100017 Computer Science
Hassan Shabbir 14100026 Electrical Engineering

PROJECT INTRODUCTION AND OBJECTIVES

“Led based snake game” is primarily a hardware implementation of the classic NOKIA snake game
on the Led Matrix. The execution and implementation of the game employs diverse skills learned at
the class from the very first day and covers a wide spectrum of topics. The project appreciates the way
in which different topics and techniques learnt in this course are put to practice, simultaneously, to
perform a specific task. This project capitalizes on the fundamental concepts of combinational logic
and incorporates other pertinent techniques such as, data storage, counter and clock. By the end of this
project, we had successfully implemented the entire game along with pattern generation, food
generation and scoring system.

PROJECT HIERARCHY

SNAKE GAME

Snake's
Snake's Body Snake's Speed Regeneration LED Patterns Food Generation
Movement

Fixed Initital Re-Entry From the At the Start of the


User Interface Variable Speed Movement of food at Scoring System
Length Opposite Side Game
the walls of the LED

Smooth At the End of the


Turn Left/Right Score Automatically
Increment game
restarts at 30 pts

Turn Up/Down

Legal Moves

Smooth Turning
Group 14 |2
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar

PROJECT SPECIFICATIONS

74LS08 • AND Gates

74LS37 • NAND Gates

74LS28 • NOR Gates

555 • Timer/Oscillator

74HCT374 • 8-Bit Edge D-Flip Flops

7404 • Inverter

74LS85 • Bit Magnitude Comparartor

74151 • 1 to 8 Data Selectors/Multiplexers

LED Matrix • Common anode

Resistors • Food

Switches • Controls

Voltage Source • +5V DC Supply

Capacitor • Variable speed

Tri State Buffer • Octal Bus Transceivers

Decoders • 3-to-8 line decoder, and 2-to-4 line decoder

74194 • Bi-Directional Shift Register

2732 • EPROM

74193 • 4-Bit Binary Counter

7447 • BCD to Seven Segment

Equipment Name IC Number No. Used


LED Matrix 8x8 Bi-Colour 6
7-Segment Display Common Anode 2
EPROM's 2732 2
Quad Mux's 74157 14
1 to 8 Multiplexer 74151 8
Octal Bus Transceivers 74245 8
Bi-Direction Shift register 74194 8
4-Bit Comparators 7485 8
4-Binary Counter 74193 4
BCD to Seven Segment 7447 2
Timer/Oscillators 555 2
8-Bit Edge D-Flip Flops 74374 2
3-8 Line Decoder 74138 2
2-4 Line Decoder 74HC139 1
AND 7408 12
NOT 7404 24
XOR 7432 8
Resistors 100/220/7000 Ω 40
Capacitors 10/5/20 µF 5
Group 14 |3
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar

PROJECT DELIVERABLES (WHICH WERE ACCOMPLISHED)

By the end of this project, we had successfully implemented these features:

1. Movement of the snake on the LED Matrix.


2. Increment in its position with the help of a user control system only in the legal directions.
3. Variable speed of the movement of the snake as a functional feature.
4. Keeping track of the snake and regeneration of the snake once it leaves from the one side of
matrix.
5. Led pattern generation at the start and end of game as an additional feature using multiplexing
with the help of which the “SNAKE” letters were generated.

MODULE COMPOSITION

SNAKE GAME

Snake's
User Interface Snake's Speed Regeneration LED Pattren Food
Length

Fixed Smooth
Snake Turning Smooth Turning Variable Speed Counter LED Matrix At walls
Length Increment

Tri- Tri
SR n to 1 D Flip n to 1 D Flip D Flip n to 1 D- 7-Seg
state Timer Timer Capacitor Timer Timer State ROM Counters
Latches Mux Flops Mux Flops Flop Mux Latches Display
Buffer bufer

WEEKLY BREAKDOWN

WEEK 1: During the first week, we exercised our knowledge to go about this problem on the proteus
software. We tackled the problems faced during the simulation process and tried to find their solution.
Moreover, we learnt how to use a led matrix because it was a fundamental component of our project.

WEEK 2: After having a fair idea about the proceedings, we had a go at the hardware implementation
of our simulated circuit. Our main focus was to have a firm control over the functioning of counters,
clocks, latches and flip flops. We strived to use these components with the led matrix such that we
could build foundation for the later events.

WEEK 3: Having our structure ready in the previous week, we went a step ahead in this week by
implementing the incremental motion of the snake. Once this function was implemented, we finalized
the length of the snake and will work on its movements on the led matrix. The functionality of the
variable speed with which a snake moves on a led matrix also got implemented by the end of this
week.
Group 14 |4
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar

WEEK 4: During this week, the additional features such as led pattern generation at the start and the
end of the game were considered. We figured out a way to crack it through multiplexing and by using
the effective ROM writing technique learnt in the lab, we accomplished this task.

WEEK 5: Utilizing this time we winded up the project by giving it finishing touch. But we went a step
ahead in the final week to implement, if time permits suggestion which we proposed according to
which the snake eats the food and there is a proper scoring system to recognize this action. We
successfully implemented and demonstrated all the deliverables along with bonus part on the day of
demonstration.

Week 1 Week 2 Week 3 Week 4 Week 5


• Proteous Simlutaion • Hardware Implementaion • Implementation of • Additional feature like • Food generation.
• Debugging • Use of Flips Flops, Counters, incremental motions of • LED Pattrens at the start and • Scoring system of the food.
• Undetrstanding of LED Clocks and Latches snake end using multiplexing. • Neatness of the project.
Matrix • Synicrnoization between • Length of the snake • Smooth movement by
LED Matrix and other • Variable speed avoiding abrupt turns
componants.

TECHNICAL ISSUES FACED

Firstly, the most disturbing issue faced by our group was that we had extensively large circuit and it
was breathtaking to debug it if the desired result was not obtained during the testing phase. We
cracked this problem with the help of colour coding and using labelled wires. Most importantly, we
had a working Proteus simulation in front of us, so wherever lost, we grasped help from that.

Secondly, the design of the controller was not an easy task. The design was intriguing since there
were five controlling variables and we had to cut that down to two variables. Along with that we had
to take care of the legality of the moves from the user side. This task employed some critical thinking
and in the end our group was able to overcome the problem by using a 2-to-4 line decoder, couple of
OR gates and couple of SR latches.

Thirdly, when we tried to implement the time permits module, we were not sure how to add food
generation logic in the circuit and the execution of this step was pertinent problem because our circuit
had little space for anything else. We dominated this issue by using a separate logic to implement
this task, i.e. rotation with the help of Shift registers through which were successfully able to
generate food. Finally, we added a counter and testing unit to detect the food eating condition of the
snake to accomplish the implementation of our scoring problem.

Fourthly, we had to incorporate multiplexing in our project to generate the LED patterns. We learnt
the ROM writing and using technique taught in the lab with a little help from the supervisor, we were
able to overcome this hurdle.
Group 14 |5
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar

PROTEUS SCREENSHOTS

Figure 1: Schematic for snake game circuit

Figure 2: Schematic for multiplexing circuit


Group 14 |6
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar

TRUTH TABLES FOR CONTROLLER’S OPERATIONS

Controller using 2-to-4 line decoder


Input
Output Lines
Lines
I2 I1 Switch A Switch B
0 0 1 0 Vertically Upwards
0 1 1 1 Move to the left (horizontally)
1 0 0 1 Move to the right (horizontally)
1 1 0 0 Vertically Downwards

SR latch for column operations


Input
Output Lines
Lines
I2 I1 R S
0 0 0 0
0 1 0 1
1 0 1 0
1 1 0 0

SR latch for row operations


Input
Output Lines
Lines
I2 I1 R S
0 0 0 1
0 1 0 0
1 0 0 0
1 1 1 0

You might also like