Project ForgeSign up free
Computer Organization & Architecture
Memory Hierarchy & Floating Point
GATE 2007
Expert

(Same setup: byte addressable 2¹⁶ byte memory, direct-mapped cache with 32 lines of 64 bytes, 50×50 byte array starting at 1100H, accessed twice.) Which of the following lines of the data cache will be replaced by new blocks in accessing the array for the second time?

  • line 4 to line 11
  • Bline 4 to line 12
  • Cline 0 to line 7
  • Dline 0 to line 8

Explanation

As derived above, only the cache lines that were touched twice during pass 1 (once by blocks 68-75 and again by blocks 100-107, both ranges mapping to lines 4-11 via block-number mod 32) get replaced again during pass 2's traversal — first when blocks 68-75 reload (evicting pass-1's blocks 100-107... actually re-evicting what pass 1 left there), and again when blocks 100-107 come around again in pass 2. The affected lines are 4 through 11.

Source: GATE CS 2007 (2007)

This question is part of a 15-day revision cycle — sign in and Project Forge will bring it back the day before you'd forget it.

Start revising free