GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A loop reads 128 words at addresses 0, 64, 128, …, 8128 and repeats this whole sweep three times. The cache is 4 KB, 2-way set-associative with LRU and 32-byte blocks. How many misses occur in total?
- A. 256
- B. 384
- C. 192
- D. 128
Correct answer: B. 384
The 128 addresses are in 128 different blocks (4 KB of cache holds 128 blocks), but with stride 64 only the even-numbered sets (index = 2i mod 64) are used, so 32 sets × 2 ways = 64 blocks fit; cyclic LRU thrashes every sweep, giving 128 misses per sweep and 3 × 128 = 384 in all.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A 64 MB byte-addressable memory with a 64-bit data bus (8 bytes per bus word) is built from 4M × 4 DRAM chips. How many chips are needed…
- Every memory reference first looks up a TLB (2 ns, hit ratio 96%). On a TLB miss the hardware walks a 3-level page table, each level…
- An x86-like addressing mode computes EA = base + index × scale + displacement, where the displacement is an 8-bit field that is…
- A 32-bit carry-select adder is built from blocks. A block of n bits contains two ripple adders (carry-in 0 and 1) that have their…
- A device produces a 40,000 bytes/s stream into a 16-byte buffer, and the CPU (500 MHz) polls it periodically, never letting the buffer…
- 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…