Skip to guide

Instructions to memory

Computer Organization

Follow one instruction from its software-visible contract through the datapath, cache hierarchy, address translation, and physical memory.

Reason cycle by cycle, calculate the cost of misses and stalls, and explain why each implementation choice changes performance or correctness.

Updated July 20266 connected chaptersInteractive labs + worked examples

One instruction, every layer

Trace a load from opcode to physical data.

Cold-path lensTLB miss + L1 miss
ISSUE
LW x5,24(x2)
BASE
x2 = 0x00008130
VA
0x00008148
VPN / OFFSET
0x8 / 0x148
L1 SET / BYTE
05 / 08
PPN
0x1A3
PA
0x001A3148
REFILL LINE
0x001A3140

The trace assumes a 4 KiB page, 32 KiB 8-way VIPT L1, 64-byte lines, and a 40-bit physical address. The set read begins with page-offset bits while translation proceeds. Candidate data remains unusable until the physical tag and permissions arrive.

Latency note: a cold four-level walk plus DRAM refill can cost hundreds of cycles. Exact latency depends on cached PTEs, lower-level hits, memory-level parallelism, and the machine's miss machinery.

Reasoning checkpoints

Questions worth answering without notes.

Each answer states the mechanism first, then the consequence.
01Why can forwarding not completely remove a load-use hazard?

A load produces its value only after the memory stage, while the immediately following instruction needs that operand at the start of execute. Even a direct MEM-to-EX bypass arrives too late for the same cycle, so the dependent instruction stalls for one cycle.

02How does associativity reduce conflict misses?

Associativity gives every index multiple candidate lines. Addresses with the same index can coexist in different ways instead of repeatedly evicting one another, at the cost of more tag comparisons, replacement state, power, and often hit latency.

03What happens on a TLB miss?

The processor or operating system walks the page-table hierarchy using the virtual-page number. A valid leaf supplies the physical-page number and permissions, the translation is installed in the TLB, and the original access restarts. An invalid or disallowed entry raises a page fault or protection exception.

Keep practicing

Move from recognition to explanation.

These links open the existing practice bank without publishing protected solutions on this guide.

Continue the system

Connect the adjacent layer.