Form a probability-weighted hit/miss mean using total-path versus additional-penalty wording correctly. The mixed read/write variant also weights access types; the optimization variant solves an inequality for hit rate.
A cache initially has hit rate 0.8, lookup latency 10 ns and additional miss penalty 100 ns. An optimization increases lookup latency to 15 ns, leaving miss penalty unchanged. What minimum new hit rate prevents AMAT increasing? Round to two decimals.
Answer & solution
Official answer: 0.85
Originally the average access time is 10+(1−0.8)100=30 ns. With the slower 15 ns cache it becomes 15+(1−h)100. Requiring this to be at most 30 gives h≥0.85, so the minimum hit ratio is 0.85. The 100 ns miss penalty is additional to the cache lookup, as in the standard AMAT formula.
Solve 15+100−100h≤30: 100h≥85, hence h≥0.85. At exactly 0.85 the AMAT is 15+15=30 ns. A smaller rate would cause the extra cache latency to outweigh the miss-rate improvement.
A read takes 50 ns on a cache miss or 5 ns on a hit. Hit rate 80%. Find mean read time in nanoseconds.
Answer & solution
Official answer: 14
The stated miss time is the entire request time, not an extra penalty. Average=0.8·5+0.2·50=14 ns.
The random read time takes only two stated values:5 with probability.8 and 50 with probability.2. Its expected value is the probability-weighted sum, .8×5+.2×50=4+10=14 ns. Do not add 5 to the miss case: the prompt already says the entire request takes 50 ns on a miss. If it had called 50 an additional miss penalty, the formula would differ.
Cache access times are read hit 1 ns, read miss 5 ns, write hit 2 ns, write miss 10 ns. A sequence performs 100 instruction fetches, 60 operand reads and 40 operand writes. Cache hit ratio is stated as 0.9. Find mean memory-access time in ns.
Answer & solution
Official answer: 1.68
Our answer: 1.68 if each access class has hit ratio 0.9
Step 1: Count instruction fetches as reads: there are 160 reads and 40 writes, 200 accesses total. Under the intended common hit ratio of 0.9 for each class, a read averages 0.9×1+0.1×5=1.4 ns, and a write averages 0.9×2+0.1×10=2.8 ns. Step 2: Weight by access count: (160×1.4+40×2.8)/200=1.68 ns. Miss times are given complete access times, not penalties to add again. Step 3: Preserve the ambiguity: an aggregate hit ratio alone only fixes 20 total misses. If w are write misses, read misses are 20−w and total time is 160+2×40+4(20−w)+8w=320+4w ns. Thus the mean can be 1.6+0.02w for 0≤w≤20, ranging from 1.6 to 2.0 ns. The official 1.68 assumes w=4 or the same hit ratio for both classes.