GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 62

Translate a page number while preserving the offset

Operating Systems · Virtual Memory & Paging · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q62 2 marks · NAT
Report issue

Virtual Memory & Paging

Question 62, GATE 2024: Pages are 2 KB, with addresses starting at zero. Virtual pages 0,1,2,3 occupy physical frames 1,3,2,0 respectively. What decimal physical address corresponds to decimal virtual address 2500? Use 1 KB=1024 bytes.
Tap to enlarge
Answer & solution

Official answer: 6596

Step through it (5 steps)

Approach: Split the virtual address into a page number and page offset. The page table replaces only the page number; the offset stays unchanged.
1. Page size is 2×1024=2048 bytes. Compute 2500=1×2048+452, so the virtual page is 1 and the offset within it is 452 bytes.
2. The mapping for virtual page 1 is physical frame 3. It is the second listed mapping because page numbering starts at 0.
3. Physical frame 3 begins at address 3×2048=6144. Add the same offset: 6144+452=6596.
Answer: 6596. The result lies within frame 3's address range [6144,8191], and subtracting its start recovers offset 452. Using page 2 or frame 1 would confuse zero-based numbering with the order in which the mappings are listed.

Original paper, page 35 · Answer key