GATE Computer ScienceHardGATE CS (PYQ pattern)
Three caches with 4 one-word lines each see the block trace [0, 1, 2, 3, 0, 4, 1, 5, 2, 6, 3, 7, 0, 4]: (i) direct-mapped, (ii) 2-way set-associative with LRU, (iii) fully associative with LRU. How many hits does each produce, as (i, ii, iii)?
- A. (4, 2, 4)
- B. (1, 2, 4)
- C. (4, 2, 1)
- D. (4, 1, 2)
Correct answer: C. (4, 2, 1)
More associativity does not always mean more hits: this trace sweeps 8 blocks, and LRU keeps evicting exactly the block that returns next, while the direct-mapped cache happens to keep blocks 1, 2, 3 across their second use (the early repeats). Simulating gives (4, 2, 1).
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A 64-byte, 2-way set-associative cache with 16-byte blocks and LRU replacement is empty. The processor reads these byte addresses in…
- A 16-bit instruction set has 4-bit address fields and expanding opcodes: three-address instructions use a 4-bit opcode, two-address…
- A RISC machine has 32-bit (4-byte) instructions at word-aligned addresses and a PC-relative branch with a 12-bit signed offset field…
- A direct-mapped cache has 8 lines (block = 1 word). A program issues block references [0, 8, 0, 8, 1, 9, 1, 9, 2, 10, 2, 10, 0, 8, 1, 9]…
- An 8-bit CPU adds the 16-bit two's-complement numbers 0x7F9C and 0x00A7 with ADD on the low bytes followed by ADC (add with carry) on the…
- A disk spins at 7200 rpm with 400 sectors of 512 B per track, an average seek of 9 ms and a 0.2 ms controller overhead. A 64 KB block (1…