To date, this project was my favorite project to work on. During my freshman year at Iowa State University I took an intro to electrical engineering course where we were given creative freedom for half the semester. At this point I had been experimenting with different digital logic 7600 Series Integrated Circuits, however had never taken a class on digital logic. I was challenged (Jokingly) by one of my lab instructors to make some sort of game on a breadboard... I took it literally and decided to make my own rendition of pong, albeit a bit simplistic.
Number of ICs Used : ~36
Memory : 32 Bits (Memory was stored in 8-bit counters that had a load function)
Number of clocks : 2
Lines of code : 0
As I mentioned before, this was one of the most fun projects I have worked on due to several factors. The largest contributor however was the experience of discovery. The only resource I tried using for this project was the datasheets of the ICs themselves meaning all of the logic to get it to work was designed by me. At this point in time I also did not know any of the tools available to aid in designing a circuit such as this and created very crude schematics by hand. It was often very frustrating when I got stuck while working on this project because at the time I did not know what to research when I got stuck.
Before I go forward and criticize my past self, I feel like I should give myself credit as this was before taking any sort of digital logic class. With that being said, the design was very inefficient. The first thing I did was to create the display, because without it... well you don't have much of a game.
To do this, I used a common technique of flashing a sequence of 3 pixels (one for the paddle, and one for each player) one pixel at a time very rapidly. I wanted the game to display at over 60 fps and since there were 3 pixels per "frame" the graphics driver clock ran at 180Hz. It was later increased so cameras could take pictures and have all three pixels displayed.
As for the logic, there were 4 main counters that provided the basic game functions. These counters correspond to the "Balls" X and Y position as well as each players Y position. I decided that each game frame (Slower Clock) the player should only be able to move one pixel left or right, and the ball will only move to one adjacent pixel. Another component that was needed for the logic was what direction the ball was traveling. To do this I had a "variable" I called ball+ for both X and Y. The entire games logic was based around toggling these X and Y values to make the ball move in different ways. If the X+ was toggled the ball would move in the positive X direction, if X+ was low then it would travel in the negative X direction. One major flaw that was found later in the design Is I didn't allow for the case where the ball doesn't move. After the ball motion and player motion was completed, the last thing to do was describing how to win the game.
To do this, I used a large amount of combinational logic that in hindsight could have been replaced by a single EEPROM chip, but at the time I didn't know that existed. This used the information available such as the balls direction, position, each players position, and the max board sizes to determine if the ball collided with a paddle, wall, or if the player missed the ball.
One of the biggest lessons I learned from this entire project was how important pull up and pull down resistors are. I was constantly experiencing noise in all of my signals because I was unaware of pull up and pull down resistors in digital logic. Another lesson I learned was that dealing with large complex projects like this take time, and organization. The amount of time I spent sorting all of my components was close to the amount of time actually designing and building. The last and still most useful skill I learned from this project was how to read datasheets for various ICs. I used around 15-20 different ICs and I had to figure out how each of them would work with the rest of the system. For example some ICs would invert the output while others would not and I had to make sure the ones that did had a corresponding inverter IC along with it.
A Higher level drawing of the system.
A portion of the "CPU"
Not an actual CPU but I didn't know better.
A portion of the "ALU"
My terms foreshadowed my next project haha.
Another Portion of the "ALU"