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

(Same 64KB, 2-way set associative, 16-byte-block cache and 1024×1024 double array ARR stored in row-major order, starting at a virtual page boundary.) Which of the following array elements has the same cache index as ARR[0][0]?

  • AARR[0][4]
  • ARR[4][0]
  • CARR[0][5]
  • DARR[5][0]

Explanation

ARR[i][j] byte offset = (i×1024+j)×8. ARR[0][0] offset=0, set index=(0/16) mod 2048=0. We need another offset that's a multiple of 16×2048=32768 bytes. ARR[4][0] offset = 4×1024×8 = 32768 bytes exactly — set index = 32768/16 mod 2048 = 2048 mod 2048 = 0, matching. The other options give set indices 2, 2, and 512 respectively.

Source: GATE CS 2008 (2008)

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