How much speed do we gain by using the cache when the cache is used 80% of the…

2013

How much speed do we gain by using the cache when the cache is used 80% of the time? Assume the cache is 20 times faster than the main memory.

Answer: C. 4.16ConceptA cache speeds up memory access because most requests are served by the fast cache instead of the slow main memory. If a fraction h of the accesses hit…

  1. A.

    5.27

  2. B.

    2.00

  3. C.

    4.16

  4. D.

    6.09

Attempted by 188 students.

Show answer & explanation

Correct answer: C

Concept

A cache speeds up memory access because most requests are served by the fast cache instead of the slow main memory. If a fraction h of the accesses hit the cache and the remaining (1 − h) go to main memory, the average (effective) access time is EAT = h·Tc + (1 − h)·Tm. The speed gain from using the cache is the time needed WITHOUT it divided by the time needed WITH it:

Speedup = Tm / EAT = Tm / [ h·Tc + (1 − h)·Tm ]

Applying it here

The cache is used 80% of the time, so h = 0.8; and the cache is 20 times faster than main memory, so Tm = 20·Tc. Take Tc = 1 unit, which makes Tm = 20 units.

  1. Effective access time: EAT = 0.8 × 1 + 0.2 × 20.

  2. EAT = 0.8 + 4 = 4.8 units.

  3. Speed gain = Tm / EAT = 20 / 4.8.

  4. Speed gain = 4.166… ≈ 4.16.

Cross-check

The maximum speed gain at an 80% hit ratio happens when the cache is infinitely fast (Tc → 0), and it equals 1 / (1 − h) = 1 / 0.2 = 5. The answer 4.16 lies just under this ceiling of 5, so it is consistent. Any value above 5 is impossible at this hit ratio, and a value close to 2 would require the cache to be only about 2–3 times faster than main memory, not 20 times.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…