GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Derive cache hit latency from tag comparison and way selection

2 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Using the complete shared Q74-75 stem, derive tag width for each cache organization, apply the k/10 ns tag-comparator delay, and include the supplied way-selection mux delay only for the two-way organization.

2 marks · MCQ
Report issue

Two-way cache hit latency

Cache Memory

Question 74, GATE 2006: Compare two 32 KB caches with 32-byte blocks and 32-bit addresses: one is two-way set associative, the other direct mapped. A 2:1 multiplexer takes 0.6 ns; a k-bit comparator takes k/10 ns. The hit-latency model counts comparator and way-selection delays. Find two-way cache hit latency h₁.
Options:
(A) 2.4 ns
(B) 2.3 ns
(C) 1.8 ns
(D) 1.7 ns
Question 74, GATE 2006: Compare two 32 KB caches with 32-byte blocks and 32-bit addresses: one is two-way set associative, the other direct mapped. A 2:1 multiplexer takes 0.6 ns; a k-bit comparator takes k/10 ns. The hit-latency model counts comparator and way-selection delays. Find two-way cache hit latency h₁.
Options:
(A) 2.4 ns
(B) 2.3 ns
(C) 1.8 ns
(D) 1.7 ns
Tap to enlarge
Your answer
Answer & solution

Answer: A (no official key was published)

Step 1: 32 KB / 32 B=1024 cache lines. Two ways give 512 sets, so index=9 bits and block offset=5 bits.

Step 2: The tag is 32−9−5=18 bits. Two tag comparisons proceed in parallel, taking 18/10=1.8 ns; selecting the matching way adds 0.6 ns.

Step 3: Thus h1=2.4 ns, A, within the stated model that counts comparator and multiplexer latency.

Step 4: Teaching check: Two-way associativity halves the number of sets relative to direct mapping, increasing the tag by one bit. Both way tags are compared in parallel, so do not double comparator latency. The selected data then passes through one 2:1 multiplexer.

Original paper, page 11

2 marks · MCQ
Report issue

Direct-mapped cache hit latency

Cache Memory

Question 75, GATE 2006: Compare two 32 KB caches with 32-byte blocks and 32-bit addresses: one is two-way set associative, the other direct mapped. A 2:1 multiplexer takes 0.6 ns; a k-bit comparator takes k/10 ns. The hit-latency model counts comparator and way-selection delays. Find direct-mapped hit latency h₂.
Options:
(A) 2.4 ns
(B) 2.3 ns
(C) 1.8 ns
(D) 1.7 ns
Question 75, GATE 2006: Compare two 32 KB caches with 32-byte blocks and 32-bit addresses: one is two-way set associative, the other direct mapped. A 2:1 multiplexer takes 0.6 ns; a k-bit comparator takes k/10 ns. The hit-latency model counts comparator and way-selection delays. Find direct-mapped hit latency h₂.
Options:
(A) 2.4 ns
(B) 2.3 ns
(C) 1.8 ns
(D) 1.7 ns
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. A direct-mapped 32 KB cache with 32-byte blocks has 1024 lines, requiring 10 index bits and 5 offset bits. The tag has 32−10−5=17 bits.

2. Its comparison takes 17/10=1.7 ns and no way-selection multiplexer is needed. Thus h2=1.7 ns, D, using the problem’s comparator/multiplexer-only timing model.

3. Teaching check: Direct mapping determines the only candidate line from the index bits, so no way selection is needed. There are 1024 lines rather than 512 sets, giving a 17-bit rather than 18-bit tag. The difference in hit time comes from both the tag size and the absent multiplexer.

Original paper, page 11