In this post, we’ll take a look at the control unit of my 8-bit computer. Ben used an EEPROM to make the control unit in his computer. This is a quite clever approach if you are building your computer on a breadboard as it drastically decreases the complexity, amount of components and space needed. But in my case, it was much easier to just implement the control unit using discrete logic gates.
The job of the control unit is to take in an instruction decode it and execute it by toggling the control lines to various components in the appropriate sequence.
Note: The images don’t include the whole circuits as they are too big. The circuitry just repeats anyway so you are not missing out on anything.
Here you can see the inputs coming into the control unit from the instruction register, flags register, and the microinstruction counter.
The microinstruction counter is just a ripple-carry counter(same as the program counter). It is used to step through all the single actions actually required to execute an instruction.
The flags register is used to store the flags conditions from the previous operation. This computer has two flags. The zero flag is for when the result of a computation in the ALU is zero. While the Carry flag is for when the computation in the ALU exceeds 255 and carries over/overflows. These flags can then be used to implement the JMC(jump if carry) and JMZ(jump if zero).
Finally, you can also see a bunch of output lines to control all the various components of the computer