CS FundamentalsVery hardProduct company interview · GATE level

A 32-bit system uses two-level paging with a 10-bit outer index, a 10-bit inner index and a 12-bit offset. The virtual address 0xC0A8F3E7 belongs to a page mapped to frame number 0x2B1C. Which outer index, inner index and physical address does the translation use?

  1. A. Outer 770, inner 655, physical 0x2B1CF3E7
  2. B. Outer 192, inner 168, physical 0x2B1C3E7
  3. C. Outer 770, inner 655, physical 0x2B1C3E7
  4. D. Outer 770, inner 143, physical 0x2B1C3E7

Correct answer: C. Outer 770, inner 655, physical 0x2B1C3E7

0xC0A8F3E7 in binary is 1100 0000 10 | 10 1000 1111 | 0011 1110 0111. The top 10 bits are 1100000010 = 770; the next 10 are 1010001111 = 655; the last 12 give the offset 0x3E7. The physical address is the frame number followed by the 12-bit offset: 0x2B1C x 0x1000 + 0x3E7 = 0x2B1C3E7. Splitting at byte boundaries (0xC0 = 192, 0xA8 = 168) is the trap, since 10-bit fields do not align with hex digits; 0x2B1CF3E7 keeps 16 offset bits instead of 12; 143 drops the two high bits of the inner index that sit inside the hex digit A.

More Operating Systems questions

Exams that ask this topic