Hit time is the critical path: small L1, pipelined writes, and the nineteen-technique scorecard
After this lesson you will explain why the hit time bounds the clock, decide with one inequality when a small, simple L1 beats a bigger one, explain why a write hit is slower than a read hit and how pipelined writes and small sub-blocks hide the difference, and place every cache optimisation of the chapter on one scorecard.
Generation after generation, processors have kept their first-level caches at a few tens of kilobytes, while the second and third levels grew by orders of magnitude (Hennessy & Patterson). The notes put L1 caches at "small (16-64 KB) and fast" (p. 356). Yet a bigger cache misses less. Why keep small the one cache that every access goes through?
The notes' Example 18 puts the choice in two lines: a 32 KB 8-way L1 that "might take 2-3 cycles to access", or a 16 KB direct-mapped L1 that "could be accessed in 1 cycle" and misses more often. Pick one now and write your choice down. The right answer depends on a cache that the example does not mention.
The one term that every access pays
Lesson 22 showed that every access pays the hit time, a miss included: the cache must be looked up before it knows that it missed (p. 303). Put a number on it with the L1 of the notes' Example 16 from lesson 26: 5 % misses, each costing 20 cycles on average behind the L2. With a 1-cycle hit, AMAT = 1 + 0.05 × 20 = 2 cycles. Add one cycle to the hit and AMAT becomes 3. To lose as much through the misses, the miss rate would have to double, to 10 %.
Now the hardware. In the five-stage pipeline of your first course, IF reads the instruction cache on every cycle and ME reads the data cache for every load and store, each in one clock cycle. The L1 sits on the critical path: the slowest stage sets the clock period \(T_{CLK}\). Suppose every stage needs 1 ns except the access to the L1 data cache, which needs 1.25 ns, and take the load-use pair of lesson 2:
I0 LD R2, 0(R1)
I1 ADD R3, R2, R4 # needs R2
Stretch the clock
Add a stage
The designer has two choices (Fig. 1). Stretch the clock: \(T_{CLK}\) = 1.25 ns, so \(f_{CLK}\) falls from 1 GHz to 800 MHz and every instruction runs 25 % slower, also the ones that never touch memory. In CPU time = IC × CPI × \(T_{CLK}\) the last factor grows. Or add a stage: the access is spread over two cycles, M1 and M2, and the clock stays at 1 GHz. The loaded value now arrives a cycle later, so the load-use pair stalls twice instead of once: CPI grows. Split the instruction cache in IF the same way and every mispredicted branch costs one more cycle too, because the branch is resolved one stage further from the fetch.
Either way the L1's access time ends up in the CPU time, cycle after cycle. The notes open the hit-time techniques with exactly this point, a hit "still lies on the critical path of every memory access" (p. 356), but their next sentence mixes up the two choices.
Every access pays the hit time, and the L1 is used on every cycle: a slower L1 lengthens the clock period, or adds a pipeline stage and its stalls.
Small and simple: short wires, one comparison
Back to Example 18. Why should a 16 KB direct-mapped cache answer in one cycle and a 32 KB 8-way cache need two or three? The notes give four reasons (p. 356):
- Shorter wires inside the cache array: a signal crosses a smaller array sooner.
- Fewer sets: a simpler decoder for the index.
- A smaller tag array: a faster tag comparison.
- Lower associativity: fewer tag comparators working in parallel.
The last reason hides the biggest gain. A hit is a chain of steps: decode the index, read the tag and the data, compare the tags and, in a set-associative cache, let the comparison drive the way-select multiplexer (Fig. 2). A direct-mapped cache has one candidate line, so it hands the data on while the comparison is still running; if the tags differ, the data is simply dropped. It is the multiplexer that lesson 25 drew for way prediction. "Simple" removes a whole step; "small" shortens the others.
A second reason, which the notes do not give, is power. The L1 is read on almost every cycle, so the energy of one access is paid about a billion times per second at 1 GHz, and in the CACTI data that Hennessy & Patterson show (5th edition) the energy of a read grows with both the size and the associativity of the cache.
When does the smaller cache win?
The price is in the notes' trade-off table (p. 356): a small cache has a low hit time and a high miss rate, a large one the reverse. AMAT decides which matters more. Write HT, MR and MP for the hit time, the miss rate and the miss penalty, with s for the small design and b for the big one. Both send their misses to the same next level, so they share the miss penalty.
The small design is the better one when its average access is shorter:
\[ \text{AMAT}_s \lt \text{AMAT}_b \]Write both with the formula of lesson 22, with the same MP on both sides:
\[ \begin{aligned} & HT_s + MR_s \cdot MP \\ & \lt HT_b + MR_b \cdot MP \end{aligned} \]Collect the miss terms on the left and the hit times on the right. Left: the extra misses of the small cache times the price of each. Right: the cycles it saves on every access.
\[ (MR_s - MR_b)\, MP \lt HT_b - HT_s \]When the small cache misses more, \(MR_s \gt MR_b\), divide: the two designs tie at the break-even miss penalty, and below it the small one wins.
\[ MP^{*} = \frac{HT_b - HT_s}{MR_s - MR_b} \]Or fix MP and solve for the highest miss rate the small cache may have before it loses:
\[ MR_s^{*} = MR_b + \frac{HT_b - HT_s}{MP} \]
Put numbers on Example 18. The notes give no miss rates, so take 4 % for the small cache and 2.5 % for the big one, with 1 and 2 cycles of hit time. Behind the L1 put the L2 of Example 16, where an L1 miss costs 20 cycles: AMAT = 1 + 0.04 × 20 = 1.80 cycles for the small cache and 2 + 0.025 × 20 = 2.50 for the big one. The extra 1.5 % of misses costs 0.3 cycles per access; the faster hit saves 1. Now take the L2 away and send every L1 miss to memory, 100 cycles: 5.0 against 4.5, and the big cache wins. The two tie at MP* = 1 / 0.015 ≈ 67 cycles.
This is why the L1 is small and the L3 is huge. The L3 is reached only by accesses that missed in L1 and L2: its latency is part of a miss penalty, never of the hit that every access pays. Hence the design practice of p. 356: keep the L1 "small enough for 1-cycle accesses at CPU clock speed" and "use L2 and L3 caches to absorb most misses from L1".
One tension is left. The same page recommends associativity "often 2-4 way in L1", while p. 364 notes that "many modern CPUs use 32 KB, 8-way L1 caches". Hit time pulls the associativity down. The rule of lesson 27, cache size / associativity ≤ page size, pulls it up as soon as the L1 grows beyond one page per way. Hennessy & Patterson add two more upward pulls: many processors already take two or more cycles for an L1 hit, and several threads sharing one L1 cause more conflict misses. Way prediction gives designers both: the miss rate of an 8-way cache with, most of the time, the hit time of a direct-mapped one.
A small, simple L1 wins while its extra misses, times the miss penalty, cost fewer cycles than it saves on every hit.
Why a write hit is slower than a read hit
The notes say that the write path is slow, "due to checking tags, updating data arrays, handling dirty bits" (p. 366), but not why a write hit is slower than a read hit. The reason is the order of two steps. A read hit may read the tag array and the data array at the same moment and use the data only if the tags match: a mismatch costs nothing but a wasted read. A write cannot do that. Writing the data before the comparison would overwrite a word of whatever block sits in that line (Fig. 3). So a write checks the tag first and writes afterwards, two steps in a row where a read needs one. This is the textbook's reason (Hennessy & Patterson), and the first thing to say about pipelined writes.
Read hit
Write hit
Now a burst of stores, in the shape of the notes' Example 22, which splits a write into three one-cycle steps: address decode, tag check, data write. In the papers' mnemonics (the 2026 paper writes registers without the dollar sign; older papers write $F2):
SD F2, 0(R1)
SD F4, 8(R1)
SD F6, 16(R1)
SD F8, 24(R1)
SD F10, 32(R1)
Without pipelining, the cache finishes one store before it starts the next: 3 cycles each, 15 for the five, "one write every three cycles" (p. 366). With pipelined writes a new store enters every cycle. While one store checks its tag, the store before it writes its data and the store after it decodes its address. The five stores need 7 cycles. In general, N stores through a k-stage write path take kN cycles without pipelining and k + N − 1 with it.
| Store | C1 | C2 | C3 | C4 | C5 | C6 | C7 |
|---|---|---|---|---|---|---|---|
SD F2, 0(R1) | D | T | W | ||||
SD F4, 8(R1) | D | T | W | ||||
SD F6, 16(R1) | D | T | W | ||||
SD F8, 24(R1) | D | T | W | ||||
SD F10, 32(R1) | D | T | W |
Notice what did not change: each store still spends 3 cycles from decode to data write, "latency still 3, but overlapped" (p. 366). Pipelining raises the throughput, one write per cycle instead of one every three, which is what store-heavy code on a superscalar core needs. It does not make a single write faster. The notes' "reduced average hit time" means exactly this: the processor no longer waits for each write to finish before it issues the next.
A real cache adds a detail that the notes leave out (Hennessy & Patterson, 2nd edition, describe it on the Alpha 21064). Loads need the data array too, so after its tag check a store's data waits in a small delayed-write buffer and enters the array in a later cycle in which the data array is idle, such as the tag check of the next store, which needs only the tag array. The ticker below writes it in the first idle cycle. The buffer creates the hazard the notes name, "reads don't bypass pending writes to the same address" (p. 366). A load must compare its address with the buffer and, on a match, take the data from there. That check is the first of the three costs the notes list; the others are more complex control and the area and power of the buffers and pipeline registers.
Pipelining is not limited to writes. Hennessy & Patterson's 5th edition counts pipelined cache access among its advanced optimisations: the whole L1 access is spread over several stages so that the clock can run fast. An instruction-cache access took 1 cycle on the Intel Pentium, 2 on the Pentium Pro to Pentium III, and 4 on the Pentium 4 and the Core i7. It is the "add a stage" choice of Fig. 1: a faster clock and more bandwidth, paid with a longer load-use latency and a costlier mispredicted branch.
Pipelined writes overlap the data write of one store with the tag check of the next: one write per cycle, the same latency per write, and every load must look into the delayed-write buffer.
Small sub-blocks: write first, check later
The fourth hit-time technique of the notes (p. 367) attacks the same two-step write from the other side: instead of overlapping the steps, it makes the early write harmless. Take a write-through cache (lesson 23) whose 32-byte blocks hold four 8-byte words, and give every word its own valid bit, the key ingredient: each word is now a sub-block. In Fig. 4 the line holds block A, all four words valid. The store SD F2, 8(R1) writes word 1 of block B, which maps to the same line.
The cache does not wait for the comparison. In the same cycle in which it compares the tags, it writes F2 into word 1 and B's tag into the tag field. Then it looks at the outcome:
| Case | Tag check | Valid bit of word 1 | The early write was | Then the cache |
|---|---|---|---|---|
| 1 | match: the line holds B | 1 | an ordinary write hit | does nothing more |
| 2 | match: the line holds B | 0 | right: a word of B not yet valid | sets the valid bit of word 1 |
| 3 | mismatch: the line held A | — | a word of block A, which memory already holds | keeps tag B, word 1 valid, the other three invalid |
Before: the store writes at once
After: case 3, repaired
Every outcome is either right or repaired at once, so a store never waits for the tag check, and a write hit costs no more than a read hit. As a bonus, a write miss fetches nothing. Two conditions make it work. The sub-block must be one word, so that a one-word store fills it completely and its valid bit can be set with nothing fetched. And the cache must be write-through: case 3 overwrites a word of block A, which is harmless only because memory already holds A's current data. The price is a valid bit per word, and after case 3 the line holds a single valid word of B: a later read of B's other words misses, the notes' "spatial locality underused" (p. 367). This is the mechanism in Hennessy & Patterson (2nd edition); the notes explain the technique differently, and two of their sentences need the red pen.
The hardware is that of sub-block placement (p. 345, lesson 26), one valid bit per sub-block under one tag, put to another use: there to fetch less on a miss (miss penalty), here to write without waiting (hit time). And it is the twin of pipelined writes. Both attack the same rule, "check the tag before you write": one overlaps the two steps, the other makes the early write safe.
With a valid bit per word, a write-through cache can write first and check the tag later: a hit was right, a missing valid bit is set, a mismatch is repaired because memory still holds the old block.
Nineteen rows, three terms: the scorecard of the chapter
The notes close the chapter with three lists, one per term of AMAT, each technique with the page where it starts (pp. 368–369), and with Table 29 (p. 370). Before you look at either, test your memory: the lists are the skeleton of any open question on cache optimisations.
From memory: the eight techniques the notes file under "Reducing Miss Rate", with their pages.
Check yourself
Increase cache size (p. 323), increase block size (p. 324), increase associativity (p. 326), victim cache (p. 328), pseudo-associativity / way prediction (p. 330), hardware prefetching (p. 335), software prefetching (p. 338), compiler optimizations (p. 340).
The six under "Reducing Miss Penalty".
Check yourself
Read priority over write (p. 342), sub-block placement (p. 345), early restart and critical word first (p. 346), non-blocking caches (p. 348), second-level and multi-level caches (p. 350), merging write buffers (p. 353).
The four under "Reducing Hit Time".
Check yourself
Small and simple L1 (p. 356), virtually indexed, physically tagged caches, VIPT (p. 357), pipelined writes (p. 366), small sub-blocks for write-through caches (p. 367).
The lists hold 18 entries. Table 29 has 19 rows, because early restart and critical word first get one each. The scorecard widget below has 20 cards: it also splits the row "Pseudo-Associativity / Way Prediction", since, as lesson 25 showed, way prediction lowers the hit time and pseudo-associativity the miss rate.
| Technique | Miss Rate | Miss Penalty | Hit Time | Complexity |
|---|---|---|---|---|
| Increase Cache Size | ↓ (fewer capacity) | – | ↑ (slower) | ↑ (larger arrays) |
| Increase Block Size | ↓ (spatial locality) | ↑ (bigger transfer) | ↑ a | Moderate |
| Increase Associativity | ↓ (conflict misses) | – | ↑ (tag checks) | ↑ |
| Victim Cache | ↓ (conflict misses) | ↓ (slightly) b | = | Low–Moderate |
| Pseudo-Associativity / Way Prediction c | ↓ (like 2-way) | – | = (fast if predicted) | Moderate |
| HW Prefetching | ↓ (compulsory/capacity) | – | = | ↑ (stream buffers) |
| SW Prefetching | ↓ (predictable patterns) | – | ↑ (extra instr.) d | Moderate (compiler) |
| Compiler Optimizations | ↓ (better locality) | – | = | ↑ (compiler effort) |
| Read Priority over Write | – | ↓ (fewer stalls) | = | Low |
| Sub-block Placement | – | ↓ (partial fetch) | = | ↑ (valid bits) |
| Early Restart | – | ↓ (resume earlier) | = | Low |
| Critical Word First | – | ↓ (critical word first) | = | Moderate |
| Non-blocking Caches | – | ↓↓ (overlap misses) | = | ↑↑ (MSHRs) |
| Second-Level / Multi-Level | ↓ (fewer L1 misses to DRAM) e | ↓↓↓ | ↑ (extra level) f | ↑↑ |
| Merging Write Buffers | – | ↓ (less traffic) | = | Moderate |
| Small & Simple L1 | ↑ (slightly more misses) | – | ↓↓↓ (fast hits) | Low |
| VIPT Caches | – | – | ↓ (parallel TLB/cache) | ↑ (alias handling) |
| Pipelined Writes | – | – | ↓ (higher throughput) | ↑ |
| Small Sub-blocks (Write-through) | – | – | ↓ (less write work) | ↑ |
Most rows say what lessons 25 and 26 said. Six cells need a second look:
- a, block size, hit time ↑: there is no hit-time effect (red pen below).
- b, victim cache, miss penalty ↓ (slightly): a valid second reading. Seen from the L1 alone a victim-cache hit is a short miss; seen from the L1 and its buffer it is no miss at all.
- c, one row, two techniques: the ↓ under miss rate is pseudo-associativity's; way prediction removes no miss, it shortens the hit.
- d, software prefetching, hit time ↑ (extra instr.): the extra instructions raise the instruction count IC of lesson 3, not the time of a hit.
- e, second level, miss rate ↓: the L1 misses as often as before; what falls is the global miss rate of lesson 24.
- f, second level, hit time ↑ (extra level): the L1 hit is untouched; the L2 lookup is paid by L1 misses, inside the L1 miss penalty.
The scorecard below keys all twenty cards with these corrections and the prices found in lessons 25 and 26, and a pattern appears: only six cards push a second term the wrong way. A bigger cache, more ways and pseudo-associativity lengthen the hit, bigger blocks raise the miss penalty, sub-block placement and the small L1 add misses. The other fourteen pay in hardware, bandwidth or complexity.
The textbook's version adds bandwidth and power
Background, not in the notes. The 5th edition of Hennessy & Patterson sums up its advanced optimisations in a table (Fig. 2.11) that adds two columns to the three terms: bandwidth and power. Small and simple caches score on hit time and power; way prediction on hit time; pipelined cache access and multibanked caches (split into banks that serve independent accesses in parallel) on bandwidth, the first at the price of a longer hit; non-blocking caches on bandwidth and miss penalty; critical word first and the merging write buffer on miss penalty; compiler techniques on miss rate; prefetching on miss penalty and miss rate. A quiz that follows the book may therefore count prefetching as a miss-penalty technique too.
Back to the two L1 designs
The cache that Example 18 does not mention is the L2. With the L2 of Example 16 behind it, an L1 miss costs 20 cycles and the small, simple L1 wins, 1.80 cycles per access against 2.50. Without it every miss costs 100 cycles and the 32 KB 8-way L1 wins, 4.5 against 5.0. Generations of small L1 caches rest on the large, fast levels behind them. The notes' "use L2 and L3 caches to absorb most misses from L1" (p. 356) is not a detail of the design; it is its condition.
Sort any technique by what it changes (how many misses, what one miss costs, what every access costs), then name its price: the term it pushes the wrong way, if any, or the hardware it adds.
Exam-style questions
The questions follow the forms of the papers: an open question with eight sub-points as in June 2026, an exercise answered with every intermediate number, and quizzes with multiple answers, a single number and a true/false. The model answers are computed here; there are no official solutions.
Explain the main concepts and benefits of each one of the following techniques used to improve the performance of a cache, and say which term of the average memory access time each one reduces: 1. Small and simple first-level caches; 2. Way prediction; 3. Avoiding address translation during indexing of the cache; 4. Pipelined writes; 5. Small sub-blocks for write-through caches; 6. Victim cache; 7. Giving priority to read misses over writes; 8. Second-level caches.
Show model answer
- Hit time. The L1 is accessed on every cycle, so its access time bounds the clock period or adds pipeline stages. A small array has short wires, a simple index decoder and a small tag array; low associativity needs few comparators and, when direct-mapped, no way-select multiplexer, so the data can be sent on while the tag is compared. Benefit: minimum hit time and lower energy per access. Cost: a higher miss rate, worth it only if (MR_small − MR_big) × MP < HT_big − HT_small, i.e. when a fast L2 keeps the miss penalty small.
- Hit time. A small table remembers, for each set, the way that hit last; only that way is read and its data is sent at once, as in a direct-mapped cache, while one tag comparison confirms the hit. A wrong guess costs an extra cycle to check the other ways, and the table is updated. Benefit: the hit time and energy of a direct-mapped cache with the miss rate of a set-associative one. It does not reduce the miss rate.
- Hit time. The cache is indexed with bits of the virtual address that lie in the page offset, identical in the physical address, while the TLB translates in parallel; the physical tag is compared at the end (virtually indexed, physically tagged). Benefit: the TLB leaves the critical path of every hit. Constraint: index and block-offset bits must fit in the page offset, so cache size / associativity ≤ page size (for example 32 KB, 8-way, with 4 KB pages).
- Hit time. A write hit is slower than a read hit, because the tag must be checked before the data array is written: a wrong read can be discarded, a wrong write cannot. The write is split into stages (address decode, tag check, data write) and a new write enters every cycle; the data write of one store overlaps the tag check of the next, the data waiting in a delayed-write buffer. Benefit: one write per cycle instead of one every k cycles; the latency of a write does not change. Loads must check the buffer for a pending write to the same address.
- Hit time. Each one-word sub-block has its own valid bit, so the cache writes the word and the tag in parallel with the tag check. Match: the write was right (set the word's valid bit if needed). Mismatch: the overwritten word belonged to another block that memory already holds (write-through), so the line keeps the new tag with only this word valid. Benefit: writes never wait for the tag check, and a write miss fetches nothing. Usable only with write-through: with write-back a dirty block could be destroyed.
- Miss rate. A small fully associative buffer (4–16 entries) between the cache and the next level keeps the blocks recently evicted; on a miss it is searched, and a hit there swaps the block back into the cache. It removes many conflict misses of a direct-mapped cache without changing its hit time. Seen from the L1 alone, a victim-cache hit is a cheap miss.
- Miss penalty. A read miss stalls the processor, a buffered write does not; so read misses are served before the writes waiting in the write buffer, after checking the buffer for the same address (otherwise a RAW hazard through memory). In a write-back cache a dirty victim is moved to the write buffer and written after the new block has been fetched. Benefit: the read-miss penalty no longer includes pending writes.
- Miss penalty. An L2, larger and slower than the L1 but much faster than main memory, serves most L1 misses: AMAT = L1 Hit Time + L1 Miss Rate × (L2 Hit Time + L2 Miss Rate × L2 Miss Penalty), with the local L2 miss rate. The L1 miss rate is unchanged; the L1 miss penalty falls, and the global miss rate (L1 Miss Rate × L2 Miss Rate) is the fraction of accesses that reaches memory. It also makes a small, fast L1 affordable.
Eight sub-points in the form of June 2026, about five lines each. A complete sub-point names the mechanism, the term of AMAT and the cost. Two traps: putting "avoiding address translation" under the miss penalty (the January 2026 quiz of lesson 26), and crediting an L2 with a lower L1 miss rate. For sub-point 4, start with why a write hit is slow; for sub-point 5, with the three cases.
Let us consider two designs for the first-level cache of a processor. Design S: 16 KB direct-mapped cache with Hit Time = 1 clock cycle and Miss Rate = 6%. Design B: 64 KB 4-way set associative cache with Hit Time = 2 clock cycles and Miss Rate = 3%. Both are backed by the same L2 cache with Hit Time L2 = 10 clock cycles, Miss Rate L2 (local) = 20% and Miss Penalty L2 = 100 clock cycles.
1. How much is the miss penalty of L1? 2. How much is the AMAT of each design? 3. For which L1 miss penalty would the two designs have the same AMAT? 4. How much would the AMAT of each design be without the L2, if the L1 misses were served by main memory in 100 clock cycles? Which design would you choose in each case?
Show model answer
1. Miss Penalty L1 = Hit Time L2 + Miss Rate L2 × Miss Penalty L2, in clock cycles:
\[ MP_{L1} = 10 + 0.20 \times 100 = 30 \]2. AMAT = Hit Time + Miss Rate × Miss Penalty, in clock cycles:
\[ \text{AMAT}_S = 1 + 0.06 \times 30 = 2.8 \] \[ \text{AMAT}_B = 2 + 0.03 \times 30 = 2.9 \]Design S is faster by 0.1 clock cycles per access.
3. Equal AMAT when the extra misses of S cost exactly the cycle it saves on every hit:
\[ 1 + 0.06\, MP = 2 + 0.03\, MP \] \[ MP = \frac{2 - 1}{0.06 - 0.03} = 33.3 \]S is faster for an L1 miss penalty below about 33 clock cycles.
4. Without the L2 the miss penalty is 100 clock cycles:
\[ \text{AMAT}_S = 1 + 0.06 \times 100 = 7.0 \] \[ \text{AMAT}_B = 2 + 0.03 \times 100 = 5.0 \]With the L2 choose S (2.8 against 2.9); without it choose B (5.0 against 7.0).
Work in this order: first the L1 miss penalty, from the two-level formula of the example A4 sheet, then the two AMATs. The trap is to use 100 cycles as the L1 miss penalty in part 2. Note how close 30 is to the break-even 33.3: a slightly slower L2 would flip the choice.
The write hits of a cache go through a write path of four one-cycle stages (address decode, tag check, data array update, write buffer update). With pipelined writes, how many clock cycles do 10 back-to-back store hits need, from the first decode to the last stage of the tenth store?
Show model answer
Without pipelining \(kN\) = 40 clock cycles. The throughput becomes one store per cycle instead of one every 4; each store still takes 4 cycles.
The pipeline fill counts once: the first store needs all four cycles, each of the other nine finishes one cycle later. The same arithmetic as N instructions in a k-stage pipeline (lesson 3).
(MULTIPLE ANSWERS) Which of the following cache improvements are effective in reducing the hit time?
Show model answer
Answers 2, 3 and 5. Answer 1 reduces the miss rate (and increases the hit time); Answer 4 reduces the miss penalty.
The options mix the hit-time list of the notes (p. 369) with one miss-rate and one miss-penalty technique, the way the January 2026 quiz built its wrong answers. Sort each option by the term it changes and the answer follows.
(MULTIPLE ANSWERS) Which of the following changes increase the hit time of a first-level cache?
Show model answer
Answers 2 and 3. A larger block raises the miss penalty, a victim cache and an L2 act only after an L1 miss.
Answers 1 and 5 are the cells a and f of Table 29 that this lesson corrects. If the paper asks you to motivate, give one line per option: the term it really changes.
(True/False) Pipelining the cache writes reduces the latency of each individual write.
Show model answer
False. With pipelined writes a new write can start every cycle, so the throughput rises (to one write per cycle in Example 22 of the notes), but each write still needs its address decode, tag check and data write: "latency still 3, but overlapped". Its data may even wait longer in the delayed-write buffer when loads are using the data array.
Motivate a true/false with the mechanism: throughput against latency, the same distinction as for an instruction pipeline.
Check yourself
Your L1 data cache needs 1.25 ns, every other stage 1 ns, and you keep the 1 GHz clock. What does the slow cache cost you?
A small L1 hits in 1 cycle and misses 6 % of its accesses; a bigger one hits in 2 cycles and misses 2 %. Below which miss penalty is the small one faster?
Why may a read hit use the data array before the tag comparison is over, while a write may not write it?
With pipelined writes, SD F2, 0(R1) is followed at once by LD F4, 0(R1), and F2 still waits in the delayed-write buffer when the load reads. What must the cache do so that the load gets the right value without waiting?
Small sub-blocks in a write-through cache, one valid bit per word. A store finds a different tag in its line (case 3). Which statements are true?
Which entries of the corrected scorecard are right?
Key take-aways
- Every access pays the hit time and the L1 is used on every cycle, so a slower L1 either stretches the clock period (lower \(f_{CLK}\)) or adds a pipeline stage (higher CPI: more load-use stalls for the data cache, a larger branch penalty for the instruction cache); a delay counted in cycles never lowers the frequency.
- Small and simple means short wires, a simple decoder, few comparators and no way-select multiplexer, so a direct-mapped cache can send the data while it compares the tag; it also saves energy. It pays only while the extra misses, times the miss penalty, cost less than the hit time saved, which is why a fast L2 keeps the L1 small.
- A write hit is slower than a read hit because the tag must be checked before the data array is written. Pipelined writes overlap the data write of one store with the tag check of the next: one write per cycle, the same latency, and loads must look into the delayed-write buffer.
- Small sub-blocks (a valid bit per word) let a write-through cache write first and check later: a hit was right, a missing valid bit is set, a mismatch is repaired because memory holds the old block. With write-back the trick would destroy dirty data.
- Every technique of the chapter lowers one term of AMAT. A few, such as a bigger cache, bigger blocks, more ways and a small L1, push another term up; the rest pay in hardware, bandwidth or complexity. In the corrected Table 29, larger blocks do not raise the hit time, an L2 lowers the L1 miss penalty and the global miss rate but not the L1 miss rate, and way prediction lowers the hit time, not the miss rate.
What to watch and read
-
Pipelined Caches
Milos Prvulovic, Georgia Tech HPCA (Udacity)a few minutes
Watch it at the end of section 3: a drawn example of a cache access spread over pipeline stages, the "add a stage" choice of Fig. 1.
-
Evaluating Associativity in CPU Caches
Mark D. Hill and Alan Jay Smith, IEEE Transactions on Computers, 198919 pages
Real measurements of the trade-off that the balance widget plays with invented numbers: above a certain size, a direct-mapped cache can have a lower effective access time than a set-associative one despite its higher miss ratio.
-
Cache Write Policies and Performance
Norman P. Jouppi, DEC WRL Research Report 91/12, 199148 pages
For sections 3 and 4: write-through against write-back, and whether a write miss should fetch its block or not, measured. Read it with the three cases of the sub-block table in mind.
-
Advanced Caches (Lecture 24, Digital Design and Computer Architecture, Spring 2021)
Onur Mutlu, ETH Zürich
A full-length lecture on advanced cache design: watch it after this lesson to review the cache optimisations of lessons 25 to 28 in one sitting.