How a CPU Works, and Why We Say it’s the Brain of a Computer

Dave Guymon
3 min readAug 1, 2020

--

I’ve often heard others refer to the Central Processing Unit (CPU) of a computer as the computer’s “brain.” But I’ve never known what that means exactly. So, I did my homework and learned how CPUs work generally.

Photo by Akshat Sharma on Unsplash

As with our human brains, the primary responsibility of a CPU is to execute instructions. The instructions that our brain receives take the form of sensory input (sight, taste, feel, etc). While the instructions that our CPU receives is often referred to as Assembly (or Machine) Language.

Similarly to how a brain has different regions that handle different responsibilities, a CPU has two main components, known as the Control Unit (CU) and the Arithmetic & Logical Unit (ALU).

The CU of a CPU is like our brain’s thalamus. Both are responsible for receiving incoming instructions and telling other parts within the system (whether CPU or brain) how to respond.

The ALU receives interpreted instructions from the CU and performs all mathematical and logical computations through the use of logic gates (which depend on transistors) to receive binary input (1s and 0s) and return the appropriate output (such as the sum of an addition problem).

As you can imagine, even the simplest processes performed by a computer require a large number of logic gates. These groups of logic gates are known as registers. While there are different types of registers, the primary function of any register is to store data and make it quickly accessible by other computer components, such as memory.

Data from the ALU is transmitted to other parts of the CPU via electrical pathways known as an internal bus. Extending our brain analogy, the internal bus functions like our brain’s dendrites, which receive and transmit data to other parts of the brain.

The internal bus (as well as all other types of buses) have two main parts: a data bus and an address bus. These two buses work together to transfer actual data to a specific destination. That transfer occurs as electrical signals are sent via RD (read) or WR (write) lines to a computer’s Random Access Memory (RAM), which itself is an example of thousands of registers compacted together to store a large amount of data in a volatile way (it stops storing the data when you turn off your computer).

Not all CPUs send these signals at the same rate, however. Clock cycle is used to measure the speed of instruction sets sent from a CPU’s bus to the computer’s RAM.

Measured in gigahertz (gHz), a CPU’s clock cycle speed tells us how many billions (10⁹) of instructions can be handled per second.

Looking at the current clock cycle speed for my MacBook Pro (from around 2017), I see that each of four CPU cores has a clock speed of 2.2 GHz (or 2.2 billion instructions per second). Since my CPU has four cores, that means that my 3-year old MacBook has the ability to execute 8.8 billion instructions every second it is powered on.

If that drops your jaw, consider Moore’s Law, which observes that computer speed doubles roughly every 18 months!

As with our human brains, there is much more depth to the inner workings of a computer’s Central Processing Unit. And even though it is estimated that a brain can handle 10 quadrillion instructions per second, this was a good enough start for me. 😆

--

--