OS & Hardware

With 4 KB pages, which pair gives the page number and offset of the 32-bit virtual address 0x00403ABC?

  1. APage number 0x00403, offset 0xABC0
  2. BPage number 0x004, offset 0x03ABC
  3. CPage number 0x00403, offset 0xABC
Show answer and explanation

Answer: C. Page number 0x00403, offset 0xABC

A 4 KB = 2¹² page means the low 12 bits (the last three hex digits) are the offset and the upper 20 bits (the first five hex digits) are the page number. Splitting 0x00403ABC gives page number 0x00403 and offset 0xABC. The page table translates 0x00403 into a physical page number, and appending 0xABC yields the physical address. Using four or five digits as the offset would correspond to 64 KB or 1 MB pages.

  • A. An offset of 0xABC0 is shifted by a digit.
  • B. A five-digit offset applies to 1 MB pages.
  • C. Correct. The last three digits 0xABC are the offset and 0x00403 the page number.
Practice this topic Back to topic

More OS & Hardware questions

  1. Which set of operating modes is defined by the RISC-V privileged architecture?
  2. When returning from an interrupt or exception handler, why is a dedicated return instruction (such as RISC-V's sret or mret) used instead of an ordinary function return?
  3. In a system requiring real-time behavior, which factor most increases interrupt latency, the time from an interrupt occurring until its handler starts?
  4. Which describes an NMI (non-maskable interrupt)?
  5. On a multicore system, when the OS modifies a page-table entry to revoke a mapping, what must be done?