Learning Objectives
By the end of this topic, you should be able to:
- Define the purpose of the ALU, Control Unit, registers, program counter, instruction register, and bus, and the role each plays in the CPU.
- Explain how general-purpose registers, main memory, and secondary memory work together and their role in fetching and storing data.
- Explain the differences between mass storage, main memory, and general-purpose registers.
Learning Activities
To help you meet the learning objectives, we have prepared a combination of readings, activities, and videos.
Course Readings
These reading were designed to introduce the course topics to an audience of educators. They should be considered "required" and read in order.
- Reading 1 – The CPU and Its Components — the ALU, Control Unit, registers, Program Counter, and Instruction Register
- Reading 2 – Registers, RAM, and the Memory Hierarchy — how data moves between levels of memory and why the hierarchy exists
Supplemental Readings
Some participants find it helpful to read about a topic from a source written for a slightly more technical audience. These supplemental readings cover similar material as the course readings but may not fully align with the course learning objectives. Use them as an optional complement to your study, not a substitute for the course readings.
- Reading: Dive Into Systems, Chapter 5, Computer Architecture
- Reading: Dive Into Systems, Chapter 5.2, The von Neumann Architecture
- Reading: Dive Into Systems, Chapter 5.5, Building a Processor
Lesson Videos
These videos support the readings above and may present the material with some deeper connections and worked examples.
Checking for Understanding, Questions
Review the Learning Objectives at the top of this page. You will be asked to demonstrate these skills on this week's competency demo. To check your understanding, try the following questions. Try each one on your own before looking at the answer key. It is completely fine if you need to revisit the readings as you work through these questions.
CPU Components
- Explain in your own words how the ALU and Control Unit divide responsibilities inside the CPU. Which one calculates? Which one coordinates?
- What is the difference between the Program Counter and the Instruction Register? What does each one hold, and when?
- Why are registers necessary? What would happen if the CPU had to fetch every value directly from RAM every time it needed it?
The Memory Hierarchy
- Rank registers, RAM, and secondary storage by speed. Then rank them by capacity. What do you notice about the relationship between those two rankings?
- Describe a scenario where a computer must move data from secondary storage to RAM to registers. What triggers each step of that movement?
- Imagine RAM disappeared from a computer. What would break, and why? What about if registers disappeared?
Checking for Understanding, Answers
You can compare your answers to the following answer key.
Show Answer Key
CPU Components
- The ALU (Arithmetic Logic Unit) performs actual calculations — addition, subtraction, comparisons, and logical operations. The Control Unit does not calculate; it coordinates. It reads instructions, tells the ALU what to do, controls where data moves, and manages the timing of the entire fetch-decode-execute cycle. Think of the ALU as the calculator and the Control Unit as the manager directing what gets calculated and when.
- The Program Counter (PC) holds the memory address of the next instruction to be fetched. It advances automatically (usually to the very next spot in memory) after each fetch. The Instruction Register (IR) holds the current instruction being executed — the one that was just fetched from RAM. The PC points ahead; the IR holds what is being worked on right now.
- Registers are extremely fast storage built directly into the CPU. If the CPU had to reach out to RAM for every value, it would spend most of its time waiting — RAM is orders of magnitude slower than the CPU's internal speed. Registers allow the CPU to work with a small number of values at full speed, only going back to RAM when it needs to load new data or save results.
The Memory Hierarchy
-
By speed (fastest to slowest): registers > RAM > secondary storage.
By capacity (smallest to largest): registers < RAM < secondary storage.
The pattern: faster storage is always smaller and more expensive. This tradeoff is fundamental — there is no free combination of fast, large, and cheap. - When you open a program (double-click its icon), the OS loads the program's instructions from secondary storage into RAM. Once in RAM, the CPU can begin fetching instructions. When a specific instruction needs a value to work on, that value is loaded from RAM into a register. The ALU then operates on register contents. Results may be written back to RAM, and eventually saved to secondary storage when the user saves their work.
-
Without RAM: The CPU would have nowhere to load programs or data for active use. Secondary storage is far too slow to feed the CPU at anything near its operating speed. The computer would be essentially non-functional for any real task.
Without registers: The CPU would have to fetch every operand directly from RAM for every single operation, making it thousands of times slower. Modern computing relies on registers to bridge the speed gap between the CPU and RAM.
Extend Your Learning
The following resources go a little deeper on topics we touched on but did not fully explore in the readings. These are entirely optional — none of this material appears on the Competency Demo — but each one is a natural "next question" from something covered this week.
-
CPU microarchitecture: pipelining and superscalar execution
Modern CPUs process multiple instructions simultaneously by overlapping the fetch, decode, and execute stages — a technique called pipelining. Superscalar execution takes this further, running multiple pipelines in parallel. This article from HowStuffWorks gives an accessible introduction to how these techniques dramatically increase throughput beyond what the basic FDE model describes.
How Microprocessors Work — HowStuffWorks -
Cache memory: the layer between registers and RAM
Between registers and RAM sits another layer: cache. It is faster than RAM but slower than registers, and it exists to reduce how often the CPU has to wait for data from main memory. Modern CPUs have multiple levels of cache (L1, L2, L3). This Wikipedia article explains how cache works and why it matters for everyday computing performance.
CPU Cache — Wikipedia