LED Based Snake PDF
LED Based Snake PDF
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar
“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
Turn Up/Down
Legal Moves
Smooth Turning
Group 14 |2
Project Report
Digital Logic Circuit
Dr. Shahrukh Athar
PROJECT SPECIFICATIONS
555 • Timer/Oscillator
7404 • Inverter
Resistors • Food
Switches • Controls
2732 • EPROM
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.
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