1
votes

The memory architecture of a machine has:

+-----------------------+-------+
| Virtual address:      | 48-bit|
| Page size             | 8 KB  |
| Page table entry size | 32 bit|
+-----------------------+-------+

Let's pretend that 4 bits from page table entry are used by OS to determine the access rights for each page

  1. Virtual memory size ?
  2. Max physical memory size allowed by page table
  3. Page table size

I've tried the following setup:

  • Virtual memory size = 2^48 B
  • Physical memory size = 2^41 B
    PPN = 32-4=28 bits physical address= 28+ offset bits=28+13=41 bits
  • Page table size= 2^35 * 32 bits
    the number of page entries= 48-13=35
    page table size= page table entry size* number of page entries

I'm confused about PPN. Should it be 28 bits or 32 bits? I don't know if my solution is correct. Could someone provide me suggestion(s).

Thank you.

1
Everything seems to check. - Margaret Bloom

1 Answers

0
votes

The question is vague. First, by "max physical memory size" do you mean the maximum physical memory address space size or the maximum physical memory size that can be accessed at any point in time? In the former case, your calculations are correct. In the latter case, the physical memory size is limited by two factors:

  • The maximum number of page table entries.
  • The maximum physical memory address space size.

I think you can figure out the calculations for this case by yourself.

Second, by "page table size" do you mean the the number of page table entries required to cover the maximum virtual address space, the maximum physical address space, or something else (e.g., supported by the page table pointer format)? Also, is the page table single-level or multi-level? Or perhaps it's multi-level, but "page table size" refers only to the last-level page table entries. Your calculations are only correct if "page table size" means the total size of page table entries required to cover the maximum virtual address space where the page table follows the single-level format.

Third, It seems that your are assuming that memory is byte-addressable and that a byte is 8 bits in size. These are common assumptions, but it is better to state them explicitly in the question or the answer. The calculations would be different otherwise.

I'm confused about PPN. Should it be 28 bits or 32 bits?

You're correct, it's 28 bits.