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, you will find a step-by-step explanation of how a CPU works. With interactive simulations, you can see how each component works and how they work together.
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. First how can we do arithmetic with binary numbers? THen how do we combine this into an ALU?
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.
This unit demonstrates how a Bus and Multiplexers (Mux) coordinate
data movement.
Goal: Transfer a number from Register A to Register
B.
You can also move data from B back to the Bus using BO (B Out).
Step 1: Inside the Counter.
Here we see how 4 D-FlipFlops can be chained together to count pulses.
Click the PULSE button on the left to manually advance
the counter. Each FlipFlop toggles its state when it receives a rising
edge provided by the previous FlipFlop.
the ordering of the chapters about might need to change. We can introduce the bus sooner, and talk about register transfers we can introduce MUX and control signals at that point.