Central Processing Unit (CPU)
The CPU is the brain of a computer, containing all the circuitry needed to process input, store data, and output results.
The CPU is constantly following instructions of computer programs that tell it which data to process and how to process it. Without a CPU, we could not run programs on a computer.
For example, a simple calculator program might instruct the CPU to take two numbers, 2 and 2, add them, and send back the result.
The CPU can process those instructions easily, thanks to a control unit that knows how to interpret program instructions and an Arithmetic Logic Unit (ALU) that knows how to add numbers. With the control unit and ALU combined, the CPU can process much more complex programs than a simple calculator.
Inside the CPU
At the hardware level, a CPU is an integrated circuit, also known as a chip. An integrated circuit "integrates" millions or billions of tiny electrical parts, arranging them into circuits and fitting them all into a compact box.
We can visualize the layers of the CPU chip:
Some of those layers are physical devices, like the chip and transistors, and some of those layers are abstractions, like logic circuits and gates.
It's impressive that we can put together seemingly simple devices like logic gates to create CPUs that power complex devices like our phones, computers, and even self-driving cars.