The access time of cache memory is 10 ns and that of main memory is 100 ns. If…

2026

The access time of cache memory is 10 ns and that of main memory is 100 ns. If the hit ratio is 0.9, what is the average memory access time?

  1. A.

    19 ns

  2. B.

    28 ns

  3. C.

    55 ns

  4. D.

    90 ns

Attempted by 138 students.

Show answer & explanation

Correct answer: A

Concept

Average memory access time (AMAT) is the mean time the CPU waits to read a word, weighted by how often the word is found in the fast cache versus how often the slow main memory must be reached. With hit ratio h, cache time Tc and main-memory time Tm, the standard (simultaneous-access) model is: AMAT = h · Tc + (1 − h) · Tm. Here the cache and main memory are looked up in parallel, so a miss costs only Tm — the cache lookup overlaps it and is not added again.

Application

  1. Identify the values: hit ratio h = 0.9, so miss ratio (1 − h) = 0.1; cache time Tc = 10 ns; main-memory time Tm = 100 ns.

  2. Hit contribution: h · Tc = 0.9 × 10 = 9 ns.

  3. Miss contribution: (1 − h) · Tm = 0.1 × 100 = 10 ns.

  4. Add them: AMAT = 9 + 10 = 19 ns.

Two conventions (why 19 ns, not 20 ns)

Some textbooks instead use the hierarchical (sequential) model, where on a miss the cache is searched first and main memory is reached only afterwards, so a miss costs (Tc + Tm): AMAT = h · Tc + (1 − h) · (Tc + Tm) = 0.9 × 10 + 0.1 × (10 + 100) = 9 + 11 = 20 ns. Which model applies is decided by the wording. This stem simply gives a cache time, a main-memory time and a hit ratio, with no statement that the cache must be searched first before main memory is consulted — that plain phrasing is the standard signal for the simultaneous-access model, so the miss penalty is just Tm and the answer is 19 ns. (As a confirming check, the hierarchical value 20 ns is not even offered, whereas 19 ns is.) The two models differ only by the single cache-search term (1 − h) · Tc = 1 ns.

Cross-check

A sanity bound: AMAT must lie between Tc (10 ns, all hits) and Tm (100 ns, all misses). With a high 0.9 hit ratio it should sit close to Tc — and 19 ns does, confirming the result.

Explore the full course: Niacl Ao It Specialist