Having successfully designed and built a reasonable complex project (a TTL computer) I would like to make some suggestions to those who are considering doing the same.
If your a genius then you make your own rules and don't need to consider my learnings.
The key message is that you need structure. It is great fun firing up the soldering iron and doing something but the novelty wears off pretty quickly and the project is soon abandoned. You need a plan before you begin.
So what is structure or a plan?
My structure is based on divide and conquer. Break the project down to smaller sub-projects. How small? That depends on you ability to complete the sub-project.
An example: A discrete transistor CPU
- Design your project (CPU) using standard MSI logic gates (don't worry too much about memory as it is not part of the CPU).
- Redesign the CPU with SSI logic gates.
- Replace the SSI logic gates with discrete transistor equivalents.
- MSI = Medium Scale Integration (for example an 8 bit latch or an ALU)
- SSI = Small Scale Integration (for example a quad NAND gate or a Dual D-Flipflop)
- Each stage is complete after you have built and debugged it!
- There are plenty of MSI standard logic gate CPU designs on this forum to get you started.
- Pick one and make it your own (Szoftveres' TTL CPU is worth a look).
- You can easy get someone to review your schematics.
Now even these steps are too big for most people but you get the idea.
Is there a doable path to follow?
You don't need to full populate the plan providing you are confident it is doable when you get there. For example, how to program the ROM can wait.
Testing and debugging
- Me: "Well I have designed and built my CPU but it does not work!"
- My dog: "No surprise, it is to be expected!"
- Me: "?"
- My dog: "Why did you assemble the CPU without testing each component/board first?"
- Me: "!"
A big hint - It takes longer to test and debug a CPU project than to design and built it!
So two things to note:
- Time spent making sure the design is correct is time saved.
- The sooner you test and debug your work the better.
Arduino to the rescue
How did I test and debug my CPU?
I emulated the CPU and CPU components with an Arduino.
Okay, which board would you build first? Did you say the IO Board?
Why, because it is pretty easy to write code for the Arduino to:
- test the IO Board (early visual success)
- emulate the CPU (to test boards and software)
- test the monitor program (with the actual IO Board).
Did I tell you that the monitor program when uploaded to the CPU PROM worked first time! But it did take two attempts to get the Arduino code for the PROM programmer to work (but I had made provision for this).
I wrote quite a few Arduino programs to help me debug my boards.
If you cannot program an Arduino the perhaps you should not be reading this post!