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

(Same cache and array setup as before.) The cache hit ratio for this initialization loop is

  • A0%
  • B25%
  • 50%
  • D75%

Explanation

Block size 16 bytes holds exactly 2 doubles (16/8=2). The loop accesses the array strictly sequentially in row-major order, matching memory layout exactly. Each pair of consecutive elements shares one cache block: the first access to a new block is a compulsory MISS, the immediately following second access (same block) is a HIT — a clean alternating MISS,HIT,MISS,HIT,... pattern with no intervening conflicts, giving exactly 50% hit ratio.

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