GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A direct-mapped cache of 128 bytes with 32-byte blocks (4 lines) is used while a program reads the 4-byte words at byte addresses 0, 4, 8, …, 252 in order, and then reads the same 64 words again in the same order. How many cache hits occur in total (out of 128 reads)?
- A. 120
- B. 64
- C. 96
- D. 112
Correct answer: D. 112
64 words span 8 blocks. The first pass has 8 compulsory misses (7 hits per block); the 8 blocks map into 4 lines so the second pass again misses once per block (blocks 4-7 evicted 0-3). Total misses 2 × 8 = 16, so hits = 128 − 16 = 112 (a 4-block cache would not help since the loop is twice the cache).
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A non-pipelined processor takes 180 + 120 + 200 + 260 + 100 ps per instruction. Its 5-stage pipelined version adds a 20 ps latch after…
- Memory access takes 200 ns. A page fault takes 8 ms to service if the replaced page is clean and 20 ms if it is dirty (it must first be…
- In IEEE 754 single precision with round-to-nearest-even, which of these is correct for computing 1.0 + 2⁻²⁴ and (1 + 2⁻²³) + 2⁻²⁴?
- In IEEE 754 single precision with round-to-nearest-even, let x = 3 × 2⁻¹⁴⁹ (three times the smallest positive denormal). What are x / 2…
- A memory protects data with a SECDED Hamming code (single-error correction plus one overall parity bit for double-error detection). How…
- A virtually indexed, physically tagged cache is 32 KB, 4-way set-associative with 32-byte blocks, and pages are 4 KB. To avoid synonyms…