GATE CS 2024 Set 1 | Question 62

NAT · 2 marks

Consider a memory management system that uses a page size of 2 KB. Assume that both the physical and virtual addresses start from 0. Assume that the pages 0, 1, 2, and 3 are stored in the page frames 1, 3, 2, and 0, respectively. The physical address (in decimal format) corresponding to the virtual address 2500 (in decimal format) is _________

Answer

6596

Explanation

A page holds \(2\ \text{KB} = 2048\) bytes, so split the virtual address into a page number and an offset:

  • page number \(= \lfloor 2500 / 2048 \rfloor = 1\);
  • offset \(= 2500 - 2048 = 452\).

Page 1 is stored in frame 3 (the second pair in the list), and the offset carries over unchanged:

\[3 \times 2048 + 452 = 6144 + 452 = 6596\]

Answer: 6596