What Your Computer Boils Down To (Sort of)

So in theory I’m supposed to be doing work because it turns out that physics gets very complicated very quickly but procrastination attempts have now reached the point where I’m learning stuff to avoid learning stuff… maybe I should just get Netflix.

Anyway, as part of my course I have to write an article on a topic of choice (I went for quantum computing because it’s great) and in my time researching it, I unsurprisingly ended up learning about normal computing. What was surprising was that I found out that all computers; the one you’re reading this on (unless you’re super keen and have been printing our articles), the really old ones that give you a worrying dose of radiation if you sit too close to them and the ones that Apple are designing now (which I presume for the sake of minimalism will have no ports and you’ll have to drill your own holes in yourself) can be described using just 2 fundamental operations with 6 possible outcomes between them. Personally, I think this is amazing. Maybe I’m just easily impressed.

I guess I should start by explaining what the picture at the top of the article actually is. The two shapes under the words AND and NOT are called logic gates. Logic gates take certain number of binary inputs (so 1s or 0s) and depending on which inputs are given, spews out another 1 or 0. A good way to think about it is to imagine that you’re asked if someone you know has both brown hair and blue eyes. If the person in question has either only brown hair or only blue eyes, the answer is no. If they have neither, the answer is obviously still no. Only with the combination of brown hair and blue eyes will you say yes. This is the basis of the AND logic gate, which is the one on the left. Only when the two inputs are of certain desired values will the output of the logic gate change. As the number of outcomes is usually pretty small, they are often given with their associated logic gate in a ‘truth table’. These are the tables under the gates in the picture at the top.

The thing is that the AND and NOT logic gates are rather important, as they are what are called ‘universal gates’. This means that all other logic gates can be built out of a combination of these 2 gates. As all the processes a computer performs come down to a set of calculations it is running, and these calculations are themselves evauated by passing in a binary input through a series of logic gates, on a theoretical level it all comes down to a VERY long set of AND and NOT gates. And as you can see from the picture, they are really pretty basic procedures.

Admittedly the way they are combined eventually means that trying to describe what is going on inside a computer by just using AND and NOT gates becomes convoluted and almost impossible to understand. After all, you don’t look at things on the atomic level if you’re trying to do calculations considering a problem on a human scale. But it’s still cool to see the fundemental rules it comes down to. As a final thing, you could even say that all functions can be computed with only ONE kind of logic gate (the NOT-AND or the NOT-OR), but then you end up in a chicken or the egg situation (I’m not getting into that one) where you say that both of these are themselves made up of the NOT and AND or the NOT and OR gates; which themselves can be made of the NOT-AND or the NOT-OR gates. So you just go round in circles.

Either way, I thought it was really cool that all the complexity you get from computers today can be built up from two (or one) incredibly simple operations.

Max

References:

Logical AND gate

Logical NOT gate

AND, NOT, OR, NAND and NOR gates as universal gates