The CPU and Fetch–Decode–Execute
The CPU repeats a cycle: fetch, decode, execute.
About this topic
The central processing unit (CPU) is the computer's brain. It repeatedly runs the fetch–decode–execute cycle: fetch the next instruction from memory (address held in the program counter), decode it in the control unit, and execute it, with the arithmetic logic unit (ALU) doing calculations. Registers hold data temporarily and cache gives fast access.
Clock speed, measured in gigahertz, tells how many cycles happen each second, so 3 GHz means about three billion ticks per second. Modern CPUs have several cores, each able to run its own stream of instructions, and use tricks like pipelining to overlap the stages of different instructions.
Consider the instruction ADD R1, R2. The CPU fetches it from memory, the control unit decodes it as an addition, the ALU adds the two register values, and the result is stored back. Then the program counter moves on to the next instruction, or jumps elsewhere if the program says so. Everything you do on a computer, from playing video to browsing, is built from this loop. A common misconception is that higher GHz always means faster; the number of cores, cache size and design also matter greatly.
Key ideas
- Program counter points to the next instruction
- Clock speed in GHz
- Cores run tasks in parallel
Quick check
Use cases: where The CPU and Fetch–Decode–Execute helps
- Homework: review the key idea behind The CPU and Fetch–Decode–Execute before you start a problem set.
- Exam revision: use the quick check to test whether you can recall The CPU and Fetch–Decode–Execute without notes.
- Visual learning: play with the interactive lab to see how The CPU and Fetch–Decode–Execute changes when you adjust its inputs.
- Teaching a friend: explain The CPU and Fetch–Decode–Execute in your own words, then compare your version with the key ideas.
Computing ideas run phones, search engines, games and the wider internet.
Frequently asked questions
What is The CPU and Fetch–Decode–Execute?
The CPU repeats a cycle: fetch, decode, execute.
What will I learn in The CPU and Fetch–Decode–Execute?
Program counter points to the next instruction. Clock speed in GHz. Cores run tasks in parallel.
Is The CPU and Fetch–Decode–Execute part of Computer Science?
Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.
Does the The CPU and Fetch–Decode–Execute lab work on a phone or tablet?
Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.
How should I study The CPU and Fetch–Decode–Execute?
Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.
Do I need an account, and is my progress saved?
No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.