GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A loop reads a[i] and then b[i] for i = 0..1023, where a and b are int arrays (4 bytes) starting at byte addresses 0 and 4096. The data cache is 4 KB with 32-byte blocks. How many misses occur in a direct-mapped cache and in a 2-way set-associative LRU cache of the same size, as (direct, 2-way)?
- A. (2048, 2048)
- B. (2048, 256)
- C. (256, 256)
- D. (256, 2048)
Correct answer: B. (2048, 256)
In the direct-mapped cache a[i] and b[i] (4096 apart) share a line and evict each other every access: 2048 misses. With 2 ways both blocks live in the same set, so only compulsory misses remain: 1024 ints / 8 per block = 128 blocks per array, 256 in all.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- On a 5-stage pipeline with forwarding, 30% of instructions are loads. Half of them are followed immediately by a dependent instruction…
- After a section of a program was made 10 times faster, measurements on the improved program show that the improved section accounts for…
- A fully associative cache of 3 lines (block = one word) sees the block reference string [2, 4, 4, 0, 4, 5, 5, 2, 0, 2, 2, 2, 3, 5, 2, 1]…
- A 16-bit instruction has 5-bit address fields. Two-address instructions use a 6-bit opcode; further opcodes are obtained by expanding into…
- The back-edge branch of an inner loop executes the outcome pattern T T T N (three taken, one exit), repeated for 6 consecutive outer…
- A memory system has access time 40 ns and cycle time 60 ns per module. If the addresses are low-order interleaved over 4 such modules and…