GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A fully associative cache holds 4 blocks. A loop cycles through 5 distinct blocks 0,1,2,3,4,0,1,2,3,4,… for 30 references. How many hits does LRU produce, and how many would the optimal (Belady) policy produce?
- A. 19 and 0
- B. 1 and 19
- C. 0 and 16
- D. 0 and 19
Correct answer: D. 0 and 19
LRU (and FIFO) always evict exactly the block needed next, so a loop one block larger than the cache gets zero hits. OPT keeps most of the loop, evicting the block that is furthest away.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- In C99, int x = −37 (32-bit two's complement), and this implementation's >> on negative values is an arithmetic shift. What are x / 4, x…
- A non-pipelined processor takes the sum of its stage delays (90, 150, 110, 170, 80, 130 ps) per instruction. Its pipelined version has the…
- Which hexadecimal pattern is the IEEE 754 single-precision representation of 0.1 (round to nearest)?
- A 4-stage pipeline has stage delays 240, 160, 320 and 200 ps and a 40 ps latch after each stage. The 320 ps stage is split into two 160 ps…
- A memory has B low-order interleaved banks (bank = word address mod B, any positive integer B). A bank stays busy for 6 cycles after an…
- IEEE 754 half precision has 1 sign bit, 5 exponent bits (bias 15) and 10 fraction bits. What is the smallest positive integer that it…