Paging

On the following slide is a small example in which each page and each frame stores 4 bytes. Logical memory has 16 addresses (0 to 15), and physical memory has 32 addresses (0 to 31.)

Mapping examples:

  1. Logical address 11 in that example will map to physical address 7 since 11 is on page 2, which maps to frame 1, and the offset of 11 is 3 (since 11 is address 3 on page 2 because 8 is address 0 on this page,) so the physical address will be 1*4 + 3 = 7 (4 is the size of the pages/frames = 4 bytes.)
  2. Logical address 13 maps to physical address 9 since 13 is on page 3, which maps to frame 2, and the offset is 1 (since 13 is address 1 on page 3 because 12 is address 0 there,) so the physical address will be 2*4 + 1 = 9.

This is a miniature example; in real-world operating systems, pages are typically 512 to 8192 bytes in size, with 4096 (= 4K) being a typical value.