IAE Academy

GATE 2024 CS1 Q.62: solution and answer

GATE 2024 · CS1Q.62 · 2 marks · NAT

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 __________

See the question in the paper

Answer and solution

ANSWER

The physical address corresponding to virtual address 2500 is 6596.

Official answer: 6596Source: Official answer key, GATE 2024 CS1 (IISc Bengaluru)

  1. The page size is bytes.

  2. Page number of virtual address 2500: .

  3. Offset within the page: .

  4. The page table, read from the question (pages 0, 1, 2, 3 are in frames 1, 3, 2, 0): Page 1 is therefore in frame 3.

  5. Physical address .

KEY IDEA

Split the virtual address into a page number and an offset by dividing by the page size. Look up the frame in the page table. The physical address is frame number times page size plus offset.

WATCH OUT FOR

Using the page number as the frame number (1 x 2048 + 452 = 2500), or reading the frame list in the wrong order. Another slip is taking 2 KB as 2000 bytes instead of 2048.

From the GATE 2024 CS1 paper. Every question of this paper · Download the full paper · All 10 Memory management questions, with notes

More Memory management questions