Question

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 _________

Official answer and solution
Official answer
6596
From
Official GATE 2024 answer key

Solution

Divide the virtual address 2500 by the page size (2048 bytes) to extract the virtual page number and page offset, then substitute the mapped frame number.

  1. Page size in bytes:
    2 KB=2×1024=2048 bytes2\text{ KB} = 2 \times 1024 = 2048\text{ bytes}
  2. Virtual page number (pp) and offset (dd) for virtual address 25002500:
    • p=⌊2500/2048⌋=1p = \lfloor 2500 / 2048 \rfloor = 1
    • d=2500 mod 2048=2500−2048=452d = 2500 \bmod 2048 = 2500 - 2048 = 452
  3. Physical address:
    Virtual page 11 is stored in page frame f=3f = 3. Thus:
    Physical Address=f×2048+d=3×2048+452=6144+452=6596\text{Physical Address} = f \times 2048 + d = 3 \times 2048 + 452 = 6144 + 452 = 6596
Final answer

6596

Common trap

Using 2 KB=2000 bytes2\text{ KB} = 2000\text{ bytes} instead of 2048 bytes2048\text{ bytes}.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
Question
62 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.