Building a CPU - 50% through the project
Summer 2023

As part of my education, I have to do a bigger project before finishing school. I've always been very interested in computer architecture and design, so I decided to combine the two: Build a CPU as a project.
This is obviously an ambitious project, additionally because I didn't just want to build the simplest things possible. And this is already the most important advice I can give to anyone: Keep it as simple as possible. And if you think it is simple enough, make it 10 times simpler.
Anyways, how does one actually build a CPU? Producing your own chip is pretty much out of question, the cost are way to high. For example, the semiconductor prototyping platform efabless.com lists a price of only 10'000$.
Since I want a real product and not just a simulation in something like an FPGA, I decided to build the thing using 74-Series glue-logic integrated circuits. They are great. To connect them, I use breadboards and wire.

However, I mainly wanted this post to be about my learnings. Here is a list
- Keep it simple. It will take you long enough to finish the project, so don't make it needlessly complicated. You can always do a second build/upgrade your current one.
- Cutting wires sucks. If anyone knows a better solution on breadboards, let me know.
-
Don't forget the power supply. You will need to supply your project with power. Ideally, your power
supply is short circuit prove. Because I didn't have anything better, I
usedfried and arduino as a USB adapter. Don't do it. Get a lab power supply, resettable fuses, anything to protect you. While I haven't managed to destroy my CPU with short circuits yet, I managed to create plenty of them. -
Try to make your architecture modular. This way, you can
- Add more features later on
- Test parts of the CPU earlier
-
Simulate your CPU before building it. It doesn't need to be super detailed on an electronic component
level, it's enough to model the ISA. I've found many, sometimes severe oversights while doing this
that saved me a lot of time should I've missed them.
- Don't write it in python, doing bit manipulations in python is a bit annoying. I can
recommend zig for it, as it allows you to specify the bit
width of an integer type to the bit, e.g. you can have an
u5
: A 5-bit unsigned integer.
- Don't write it in python, doing bit manipulations in python is a bit annoying. I can
recommend zig for it, as it allows you to specify the bit
width of an integer type to the bit, e.g. you can have an
- Multiply the breadboard space requirements by at least 1.5 times the amount you've calculated you'll need.
Maybe one day I'll write about the details of the architecture of a CPU, but until then, these are my experiences I wanted to get out and share with the wild. On James Sharmann's discord from time to time people ask questions that exactly need this kind of answer, so I hope it helps ¯\_(ツ)_/¯.