GATE CS 2024 Set 1 — Question 62

NAT+2 / -0EasyPaging & Address TranslationMemory ManagementOperating System

Operating System → Memory Management → Paging & Address Translation

Last updated

Question

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

Correct answer

6596 to 6596

Solution

1.Determine Page Size in bytes:
Page size = 2 KB=2×1024 bytes=2048 bytes2\text{ KB} = 2 \times 1024\text{ bytes} = 2048\text{ bytes}.
2.Find the Page Number (PNPN) and Offset (dd) for the given Virtual Address (VAVA):
VA=2500VA = 2500
PN=VA/Page Size=2500/2048=1PN = \lfloor VA / \text{Page Size} \rfloor = \lfloor 2500 / 2048 \rfloor = 1
d=VA(modPage Size)=25002048=452d = VA \pmod{\text{Page Size}} = 2500 - 2048 = 452
3.Map the Page Number to the Frame Number (FNFN):
According to the given mapping:
  • Page 00 \rightarrow Frame 11
  • Page 11 \rightarrow Frame 33
  • Page 22 \rightarrow Frame 22
  • Page 33 \rightarrow Frame 00

For PN=1PN = 1, the corresponding FN=3FN = 3.
4.Calculate the Physical Address (PAPA):
PA=(FN×Page Size)+dPA = (FN \times \text{Page Size}) + d
PA=(3×2048)+452PA = (3 \times 2048) + 452
PA=6144+452=6596PA = 6144 + 452 = 6596.
Therefore, the physical address is 65966596.

More questions on Memory Management

Practice GATE CS PYQs with adaptive difficulty

Timed practice, skill tracking, and AI explanations — free to start.

Start practicing free