CPUs – the central processing unit of a PC, Mac or Linux based machine. The brain of a computer in layman’s terms. So how does it function? Whether you’re a PC enthusiast, thinking of building a system, or a student of a Computing HND, knowing how a CPU works is vital to understanding computing.
CPUs work in binary – that is they use a language based on 1s and 0s. The letter K, for example, is represented in binary language as – 01001011. Each 1 and 0 is called a bit. Eight bits equal a byte. 1000 bytes (approx) is a kilobyte. 1000000 bytes (approx) equals a megabyte. You’ve heard of megabyte, gigabyte and probably even terabyte, but have you heard of a petabyte (1 trillion bytes), exabyte (1 quintillion bytes), or a zettabyte (1,000 exabytes)?
That’s all well and abstract, but where do CPUs come in? CPU speeds are measured in hertz; hertz means cycles per second; therefore 1 hertz is one cycle per second, and 2.5ghz would be 2.5 billion cycles per second. Each processor has a Register Size that defines how many bits (1s and 0s) it can process per cycle. These come in multiples of 8; the computer this piece is being written on has:
- 5ghz as a cycles-per-second speed and,
- 64-bit Register Size
That’s 64,000,000,000 bits per second.
How Does the Sausage Get Made?
The binary code is transported between components within the CPU, as well as outside the CPU to external components, through electrical lines called a bus. If the code stays within the CPU, the internal data bus is used; when the CPU needs to communicate with an external component, the external data bus is used. Think of London’s tube system as the internal data bus, transporting things around the capital, and the national rail network as an external data bus, taking people/information from the capital out to other cities.
Inside the CPU, several components work together to produce the results we see when working on a computer. Let’s start with the CPU’s manager, called the Control Unit (CU). Essentially, the CU breaks down instructions for the other components, telling them what to do and when.
Next, we have the Arithmetic Logic Unit (ALU). This does most of the CPU’s heavy lifting by carrying out the binary calculation. The CU, or control unit, instructs bits to move from storage (the Register) to the ALU for adding, subtracting or comparing, then once complete the ALU sends the result to another storage register within the CPU. The CU then decides whether the Register needs to store the information for further use.
The processor’s Register Size, remember, defines how many bits (1s and 0s) it can process at once. 32bit CPUs can manipulate 32 bits at once (4 bytes), and a 64bit CPU can, you guessed it, manipulate 64 bits at once (8 bytes). More bits means more data being processed per cycle.
I have the need for speed!
Increasing processor speed can be done in several ways. Getting a processor with an increased clock speed is comparable to having workers who can perform their tasks quicker. Another possibility for increasing CPU speed is through a restructuring of the CPU pipeline – the tasks that must be followed for a process to be completed. This could involve making smaller steps that can be completed simultaneously, as well as making each step more efficient. More pipelines also mean more information can be processed per cycle – compare a road and a motorway with the same width; a 100ft wide road that’s paved wide enough for one car can result in a queue of cars, whereas a 100ft wide motorway allows multiple cars to travel simultaneously.
We’ve barely scratched the surface of how complex the CPU is; if you’re interested in learning more about system components, get in touch with HND Insider and find out if an HND in Computing is for you.