How Computers Work Intermediate
A CPU follows tiny instructions step by step — fetch the next one, decode what it means, execute the work, store the result, and repeat billions of times a second.
The CPU is the computer's fast-thinking worker. It doesn't do everything at once — it follows tiny instructions, one step at a time, incredibly fast. Let's watch it think!
Where does a job begin? Programs are made of instructions, like "add these numbers" or "open this file." We might write a high-level instruction such as ADD 2, 3, but inside the computer that becomes machine code — just bits, zeros and ones. That's the language the CPU actually reads.
Where do instructions wait? In memory (RAM), lined up in order. The CPU doesn't guess what to do next — it reads the instructions one by one, in sequence.
How does the CPU know which one is next? A special counter called the Program Counter (PC) keeps track. It points to the address of the next instruction, and the CPU fetches that instruction from memory. Then the counter moves on to the one after it.
What's inside a CPU? It's like a tiny, super-fast factory on a chip, with parts that work together: the Control Unit tells everyone what to do; one or more cores process instructions (many CPUs have several!); the ALU (Arithmetic Logic Unit) does the math and logic; registers are tiny super-fast holding spots; a small cache keeps recently used data close by; and a clock keeps the beat so every step happens at the right time.
What happens to an instruction? Two quick steps. First decode: the CPU figures out what the instruction means (so ADD 2, 3 means "add 2 and 3"). Then execute: the ALU does the actual work, and 2 + 3 = 5.
Where does the answer go? After executing, the CPU stores the result — maybe in a register (R1 = 5), maybe written back to memory, or maybe used to update something like the screen (showing a 5).
Then it does it all again. The CPU goes back for the next instruction and repeats the cycle: fetch, decode, execute — over and over, millions or billions of times every second. It's like following a recipe with billions of steps per second!
One more thing: CPU vs GPU. A CPU is a general-purpose fast thinker — great at different kinds of tasks and complex instructions, with a few powerful cores. A GPU is great at doing many similar jobs at once, with lots of smaller cores — perfect for graphics and parallel work.
What should we remember? Fetch it, decode it, do it, repeat it. A CPU runs your programs by following tiny instructions step by step, unbelievably fast. Be curious, not careless!
A CPU runs programs as a stream of machine-code instructions through the fetch–decode–execute cycle. The Program Counter holds the address of the next instruction; the control unit fetches it from memory, decodes it, and directs the ALU to perform the operation, with registers holding operands and results and a small cache keeping recently used data close. A clock synchronizes each step, and the cycle repeats billions of times per second. Multiple cores run separate instruction streams at once. A GPU differs by design: instead of a few powerful general-purpose cores, it has many smaller cores built to do the same simple operation across lots of data in parallel, which is why it excels at graphics and similar workloads.
Want the full story? These go deeper: