Building a 4-bit CPU TD4 (Part 1)

by Yuji Yokoo


The Motivation

Earlier this year, I have decided that I want to be a "full stack developer". In order to do that, I need to learn the parts of the "stack" I don't know about. The most obvious one, is the hardware layer. Some might say that's not what they mean by "full stack" but I'm not listening to them! Surely, you have to question how full your "full stack" is, if you don't have any hardware to run on. Well, perhaps I should start from semiconductor or metal production, electricity generation, or even inventing the universe, but I think I'd leave that till later, and focus on building a 4-bit CPU by soldering ICs and other parts together.

Why this TD4?

TD4 is the CPU described in the book I have bought about 10 years ago. This book is in Japanese and called "CPUの創りかた (CPU no tsukurikata)", or "How to build a CPU" by Kaoru Tonami. TD4 stands for "とりあえず動作するだけの4bitCPU (Toriaezu Dousa-suru-dakeno 4bitCPU)", or "4-bit CPU that runs". The book shows in detail how everything works in this CPU and shows its circuit diagrams. I had read it before but never actually built the CPU. I'm building it according to those diagrams. The author's webpage is here (in Japanese): http://homepage3.nifty.com/sudamiyako/ 

 This is the scanned cover of the book "CPUの創りかた". This is my copy so you can see some damage and stains but that tends to happen to good books I read a lot :)

This is the scanned cover of the book "CPUの創りかた". This is my copy so you can see some damage and stains but that tends to happen to good books I read a lot :)

Step 1 Order necessary parts

There are some resources (in Japanese) available that tells you exactly what you need in building TD4. I used this and this. I bought most of my parts from Jaycar and element14. Without much knowledge in electronics, it's quite tedious to search through element14's catalogue and buy things, and I ordered a few wrong items too. So I have some extra parts and I am not sure what to do about them. I bought way too many IC sockets by mistake too.

Step 2 Test building some bits of the system

Without any background in electronics, engineering, or hardware in general, I decided to test-build some parts of the TD4 on a breadboard. Here is my manual clock on a breadboard.

Here is the same clock, but instead of manual, now it runs at 1.2 Hz (approx). This is intentionally set slow in the book so it is easier to observe what is happening.

Here is my reset button. The reset has approximately a second's delay. Again, this has been intentionally made slow so it is easier to observe.

From the next post, I will start building it for real. Much soldering to be done.