If you missed the introductory post, head here: Part 0.
In order to make a CPU we need to start from somewhere. The 0th level of abstraction here is physics (at least to our understanding), but I think that’s too low. Let’s skip that, let’s also skip electrical engineering and head straight into logic, Boolean logic that is. But before we do that I do feel the need to talk about the building block of it all.
Meet the transistor.
Transistors are very useful, before them we used cogs, relays, vacuum tubes. Obviously each one was an improvement but they were still slow as heck. But what is a transistor?
A transistor is a semiconductor device used to amplify or switch electronic signals and electrical power.
But for our purposes just think of it as a switch, you know, like the one you are using to turn on or off a light bulb. Except it’s not mechanical, and can switch thousands times per second.
There are many types of transistors, but we only care about P-type and N-type. Essentially in N-Type you need to apply current to let current flow in the gate (close ...