The Central Processing Unit (CPU) is often called the brain of the computer. But unlike a biological brain, it doesn't "think" in vague terms. It executes precise, simple instructions one after another at blinding speeds.
In this article, we'll break down the fetch-decode-execute cycle that powers everything from your phone to supercomputers.
We start with a single NAND Gate.
Computes need to compute, and therefore they need to store numbers. How can we store numbers? With a flip flop!
We start with 5 NAND Gates arranged for a D-Latch.
To store a Byte (8 bits), we need 8 D-FlipFlops working in parallel. Wiring inputs, outputs, enable, and power to 8 independent circuits acts as a "Parallel Interface".
The ALU is the mathematical heart of the CPU. By combining many logic gates, it can perform addition, subtraction, and logical operations.
The ALU is the calculator of the CPU. It takes two numbers (A and B), performs a math operation, and outputs the result. Click the numbers to change them, and toggle the SUB switch to change from ADD to SUB.