AI InterviewSearch…Search problems, topics, or pages…Ctrl KGet started
Hardtlbpagingperformance

~150s

Effective memory access time

A paged system has a TLB hit ratio of 80%. A TLB lookup takes 20 ns and a memory access takes 100 ns. On a TLB miss the page table must be read from memory before the data itself is fetched. What is the effective memory access time?

Show the answer and the worked solution

Correct answer: C.

140 ns

Worked solution

  1. On a hit the cost is the TLB lookup plus one memory access: 20 + 100 = 120 ns, which happens 80% of the time.
  2. On a miss the cost is the TLB lookup, a memory access for the page table and a second one for the data: 20 + 100 + 100 = 220 ns, which happens 20% of the time.
  3. The weighted average is 0.8 × 120 + 0.2 × 220 = 96 + 44 = 140 ns.

Answer: 140 ns.

The idea

Read the question carefully for whether the TLB lookup is charged on a miss as well, and whether the hit ratio is given as a fraction or a percentage — both are where marks are lost.

Shortcut. Every access pays 20 + 100 ns and only the misses pay a second 100: 120 + 0.2 × 100 = 140 ns.

Common trap. "120 ns" is the cost of a hit alone, ignoring the 20% of accesses that must also read the page table.

Effective memory access time — Aptitude Question

Effective memory access time: A paged system has a TLB hit ratio of 80%. A TLB lookup takes 20 ns and a memory… Answer and worked solution on CodeKairo.

Question

A paged system has a TLB hit ratio of 80%. A TLB lookup takes 20 ns and a memory access takes 100 ns. On a TLB miss the page table must be read from memory before the data itself is fetched. What is the effective memory access time?

Options

  1. 100 ns
  2. 120 ns
  3. 140 ns
  4. 220 ns
Show the answer and the worked solution

Correct answer: C. 140 ns

Worked solution

  1. On a hit the cost is the TLB lookup plus one memory access: 20 + 100 = 120 ns, which happens 80% of the time.
  2. On a miss the cost is the TLB lookup, a memory access for the page table and a second one for the data: 20 + 100 + 100 = 220 ns, which happens 20% of the time.
  3. The weighted average is 0.8 × 120 + 0.2 × 220 = 96 + 44 = 140 ns.

Answer: 140 ns.

The idea

Read the question carefully for whether the TLB lookup is charged on a miss as well, and whether the hit ratio is given as a fraction or a percentage — both are where marks are lost.

Shortcut. Every access pays 20 + 100 ns and only the misses pay a second 100: 120 + 0.2 × 100 = 140 ns.

Common trap. "120 ns" is the cost of a hit alone, ignoring the 20% of accesses that must also read the page table.

All OS, DBMS & Networks questions · placement mock tests