The architecture we will use for this project is an attempt to strike a balance between simplicity, visual presentation, and features. First and foremost, we want to provide a simple model for understanding the data-flow in processors. We want to put this model in the spotlight, and build the rest of the processor around that.
Secondly, we need to decide our feature set. We want our CPU to support a decently wide set of capabilities:
- Addressable registers.
- Control flow.
- A stack.
- Immediate values.
- Enough memory to store programs, data segments, and a stack.
Keeping the basic model in mind, I put together an architecture that can support these features.
This model has the memory, registers, and transform module (ALU) in focus, similarly to the earlier simplified model. The rest of the modules sit above, to clearly separate them as assisting components.
An advantage of this model is that most instructions can be performed in only two sub-instructions, while the complex instructions take at most four. The data-flow of every instruction can be clearly traced through the data-paths, without having to keep track of many steps.
A disadvantage is that 4 multiplexers are needed to implement this (two of these are in the register file). To build an 8-bit multiplexer with 4 inputs, you need 4 chips, and it can get a little messy to build on breadboards.
We can easily add input and output to the model later if we so wish, by connecting a new module to bus A or B.
Almost all components will be primarily built out of the TTL chips of the 74LS series. These are readily available and have relatively high output current, meaning that we don’t have to worry about driving LEDs and multiple other chips at the same time. They also run on 5V, which we can supply from a typical phone charger for now. A reference manual for these chips can be found here.
I will explain each part of the processor as we build it. The next post will take a slight detour to talk about computers and data in general. After that we move on to the registers or ALU.