NOTE: Being a techie and an engineer, I’m often asked questions about how things work. These types of questions are the best, because as you might imagine, engineering types are generally obsessed with how things work. So, I have created a new category on my site here entitled “How Does it Work?”
The first post in this new category is the answer to a question that a friend just asked me the other day: How does a microprocessor actually work?
Everyone nowadays is familiar with microprocessors. Everything now uses a processor of some kind: computers, MP3 players, cell phones, washing machines, food processors, and even some electric toothbrushes!
One question I get asked a lot is: how do these processors actually work? Everyone knows that there is a thing called a microchip, and that it has transistors. But how do you go from a bunch of ones and zeros to a video playing in the web browser on your cell phone? I hope to explain here in very simple terms how a microprocessor works without getting too technical – and therefore too boring!
Let us begin at the lowest level of the architecture of a processor: the transistor. There are many kinds of transistors, but the kind used in modern microprocessors are FETs, or Field Effect Transistors. There are also various types of FETs, but for our purposes, there is only one thing you need to understand: a transistor is like a light switch. When the switch is on (on = 1), electricity flows through it. When the switch off (off = 0), no electricity flows. The following diagram might help:
Wasn’t that easy?
Now, the next step in understanding how processors work is the concept of logic gates. All operations that a processor performs (mathematical or otherwise) can be carried out by these things called logic gates. When you connect a bunch of transistors (switches) together in different ways, you get interesting results. For example, you can make an AND gate. An AND gate has 2 inputs and 1 output. The output is always 0 (off) unless both inputs are 1 (on). There is also an OR gate. With an OR gate – as the name implies – the output is 0 unless one OR both inputs are 1. See the following image to get a better idea of what this actually means.
You don’t need to really understand logic gates, or even how you connect transistors together to make logic gates. There are also a lot more types of logic gates, such as NOT, XOR, NAND, NOR, and so on. All you really need to understand is that combining a bunch of switches together in clever ways allows us to make functional units called logic gates that let us perform different operations on 1’s and 0’s.
Okeydokey – the next level gets even more complicated. First, we combined transistors together to make logic gates. Now, in combining a whole lot of logic gates together in clever ways, we can make complex circuits that do things like adding two numbers together, multiplying two numbers together, moving data from one place to another, and so on. Exactly how this is accomplished is the subject of university-level computer engineering courses, so I’ll spare you the details.
As you may have noticed, everything in a microprocessor is interpreted in binary, i.e. in terms of either a 1 or 0. In simpler terms, 1 means electricity is flowing, and 0 means electricity is NOT flowing. Numbers and images and videos and everything else a microprocessor actually processes can be broken down into huge strings of 1’s and 0’s. For example, the number 1,354,856 in binary is 101001010110001101000. An image can be transformed into a huge string of binary numbers consisting of three different binary numbers representing the intensity of red, green, and blue that make up the actual color of each pixel, in sequence. As you can see, processors have tons of 1’s and 0’s to process.
In addition, a computer or cell phone or other device has various components that make it go – the processor can’t do anything alone! As such, each component in a computer or other device has it’s own “address”, also consisting of – you guessed it – a bunch of 1’s and 0’s. For example, in your computer, the graphics card has its own “address space”, as does your ethernet card or chip, the RAM modules installed, your hard disk, and so on. Address space is much like a binary version of a street address. Since each component has its own address, software running can tell the processor things like, “Get me the PDF document stored at Apt 321 on the harddrive, which is located at 1702 W. 57th Street!” Of course, there are different layers of software that run on a microprocessor, so the whole process isn’t quite as simple as I’ve just presented it, but it’ll do!
In any case, it’s all done with 1’s and 0’s, which is the “language” that processors understand. As you can imagine, with that many 1’s and 0’s, it takes a LOT of logic gates to make it all happen. And since each logic gate is created from several individual transistors, you can easily see why it is that modern processors contain hundreds of millions of transistors!
Finally, I thought I’d touch on how microprocessors are fabricated. A microchip generally consists of layers of different materials as well as other goodies like those little teeny tiny pins that bring the 1’s and 0’s into and out of the chip. The transistors on microchips are created through a process known as lithography. In the end, what you end up with is a multi-layer sandwich of materials with different electrical properties that form the millions of transistors – all connected in clever ways – to make a microprocessor. The lithographic process is ridiculously complicated, and far beyond the scope of this hopefully down-to-earth explanation! If you really want to see how it all works, you can check out Chris Mack’s glorious lithography explanation.
Well, that about wraps it up. Even if you didn’t have any idea how processors worked before, hopefully you do now. If there’s anything you’d like to know more about, drop me a line!
i would like to say thank you first, your article is really interesting and have helped me a lot on my assignment and saving me from dizzying after reading heaps of article with so many technical terms that i have no idea what it is all about. thanks again~
its helpful for me thank you for your information very easy to get it.
Thank u very much,clear explanation.May god bless u.
thanks so much…its very easy to understand
I went through a bunch of articles on “how microprocessors work” that were actually describing what they do. So happy to have finally found this… thanks a ton.
Good really understandable