The CPU (Central Processing Unit)

So I called the CPU the ‘brain’ of a computer. That’s because, like our bodies’ brains, the CPU is where all the critical thinking and processing happens. Everything you do on your computer, from writing an email to playing a video game, is ultimately broken down into tasks that the CPU carries out.
The CPU is a small piece of silicon etched with an intricate pattern of circuits. And when I say small, I mean really small: these circuits are so tiny that you’d need a powerful microscope to see them. But don’t be fooled by its size. This small chip, probably no larger than a postage stamp, is the powerhouse that drives your computer.
Now, you might be wondering what the CPU does. To put it simply, the CPU executes instructions. These instructions are part of the computer programs that you run. Whether you’re browsing the internet, writing in a word processor, or creating stunning 3D graphics, the CPU is tirelessly executing instructions to make all this possible.
To do this, the CPU performs a series of steps known as the fetch-decode-execute cycle:
- Fetch: The CPU fetches the instruction from memory.
- Decode: The CPU decodes the instruction to determine what operation it needs to perform.
- Execute: The CPU executes the instruction, which could be arithmetic, data movement, or controlling other hardware in the computer.
This cycle repeats billions of times each second!
Now, you might see terms like ‘cores’ and ‘threads’ associated with CPUs. These are part of modern CPU design to improve performance. A core is a smaller CPU inside the main CPU, capable of executing instructions independently of the others. This means a dual-core CPU can execute two instructions simultaneously. A quad-core CPU can execute four, and so on. And then there are threads, which allow a single core to act like two (or more) cores to improve performance further.
However, you don’t need to know all the tiny details to become a programmer. Just know that more cores and threads generally mean a more capable CPU because it can run multiple processes simultaneously.