GATE Computer ScienceVery hardGATE CS (PYQ pattern)
A loop computes y[i] += A[i][j] × x[j] for a 32×32 matrix of 4-byte floats (A in row-major order at address 0, x at 4096, y at 4224); for each (i, j) it reads A[i][j] and x[j], and y[i] is read once per row. The data cache is 1 KB direct-mapped with 32-byte blocks. How many misses occur in total, and how many in a 2-way LRU cache of the same size, as (direct, 2-way)?
- A. (376, 136)
- B. (136, 376)
- C. (136, 136)
- D. (376, 376)
Correct answer: A. (376, 136)
Simulate every reference. The compulsory minimum is 136; in the direct-mapped cache blocks of A and of x map to the same lines and keep evicting x, giving 376, while 2-way LRU gives 136.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A direct-mapped cache has a 1-cycle hit time, a 4% miss rate and a 40-cycle miss penalty on a 1.0 ns clock. A 2-way version also hits in 1…
- An interrupt is recognised only at instruction boundaries. The longest instruction takes 30 cycles; on average an interrupt arrives…
- A program has base CPI 1.2 and makes 1.4 memory references per instruction. Per memory reference, 3% miss in L1 and 1.2% miss in L2 (a…
- Design 1 is a direct-mapped cache (hit 1.0 ns, miss rate 6%) with a victim buffer that catches 25% of its misses for 1 ns extra; the other…
- A cache with 8-word blocks is cold. A program reads an array of 1000 consecutive words once, starting at a block boundary. How many…
- A processor has 64 general registers and a fixed 32-bit instruction word. Its three-register format has three 6-bit register fields and…