We’ve seen that nearly all computer systems including one adopted on tablets – work by translating user actions in the application layer, or the Operating System, into what the Central Processing Unit or CPU does. Most of this translation happens because applications are written in higher-level programming languages that are designed to be human-readable, whereas CPUs can only understand machine (‘assembly’) code. The translation is performed through a number of layers, and happens mostly at the kernel, which is the ‘heart’ of any Operating System.
So how does the CPU in your tablet unit work? We’ve said that the CPU only understands machine code. Would you like to see some? Here it is:
[ op | target address ]
2 1024 decimal
000010 00000 00000 00000 10000 000000 binary
What on earth does that mean? Actually, very few people would be able to understand it. The 1s and 0s on the bottom line are the instructions to feed to CPU. In the line above – what we might call an abstraction layer – we’ve converted it in to a human decimal number, and in the line above that (another abstraction layer, perhaps), we’ve explained what each of those numbers refers to.
So what’s actually inside your CPU? This is where ‘logic gates’ come in. A CPU will perform operations based on a 1 or a 0. We could think of that as being ‘open’ or ‘closed’. In the example above – that is target address (CPUs contain many millions of logic gates) – we’ve told a particular set of logic gates to be ‘closed, closed, closed, closed, open, closed’. This will correspond to a particular function that the CPU could do, for example managing where some memory is being stored.
These logic gates don’t contain the whole story. Each gate is constructed out of a number of transistors. These tiny components in your tablet are very similar to switches; with only a tiny input of electricity, they can switch between open and closed, or between 1 and 0. The best bit for the people who discovered them (Shockley, Bardeen and Brattain, in 1947 -for which they were awarded the Nobel Prize in Physics, in 1956) is that once a transistor is in one state, it stays like that until it’s changed, with no extra required energy (known as the hysteresis effect). So, despite the fact that the tiny CPU (which could be only a few millimetres across in your tablet) contains millions upon millions of these things, the whole affair can run on relatively small voltages. That means your tablet uses its battery more efficiently, and you get a longer battery life.
So, that was a whirlwind tour through the role of logic gates in your tablet PC. Along the way, we’ve taken a look at some serious Computer Science concepts; including abstraction, machine code, and the role of the kernel. The most amazing thing is that these concepts are ubiquitous. Whether you go with iPad or Lenovo’s Android tablet and it’ll run in the same way. So what makes the difference? These real come in the kinds of applications and programs that run in the Operating System layer, as well as the way the Operating System kernel communicates with the hardware layers below it. If you’d like to know more, take a look at some of the CS courses on iTunes U, which go in to far more detail on all of the concepts we’ve introduced here.