GATE Computer ScienceHardGATE CS (PYQ pattern)
A 64-byte, 2-way set-associative cache with 16-byte blocks and LRU replacement is empty. The processor reads these byte addresses in order: [20, 0, 20, 140, 0, 220, 20, 160, 160, 140, 100, 40]. How many of the 12 reads hit?
- A. 5
- B. 4
- C. 3
- D. 2
Correct answer: B. 4
Block = ⌊addr/16⌋, set = block mod 2. Tracking each set's LRU order gives 4 hits (FIFO would give 5; direct-mapped 2).
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- 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…
- A DMA controller uses cycle stealing and may take at most 20% of the bus cycles. Bus 1 is 32 bits wide with a 50 ns cycle; bus 2 is 64…