1
$\begingroup$

If the following is given:

  1. CPU uses a four-level hierarchical page table, each level can contain 512 entries

  2. the page size is 4KB.

  3. virtual address is 48 bits

How do i get the size of the virtual memory (in terms of pages or bytes). Do i just use the number of page table entries 29*4+12 ?

And can i get the size of the physical memory given this information ?

$\endgroup$

1 Answer 1

1
$\begingroup$

No, you can't get size of physical memory with the provided information.

Explanation:

  1. Virtual memory that you mentioned is correct. But you can calculate it just by seeing the number of bits virtual address has (What you did is correct though).

  2. To calculate the physical memory, we need to know that Physical memory is a collection of frames, which has same size as pages. Since Page size is already given (4KB), next we need to know how many frames does main memory(physical) has. For this we need to know the size of page table entry, which contains frame address. If we know frame address length, then we can calculate the total number of frames by calculating 2^(length of frame address). Then you can multiply the frame size (4KB) with the above value to get the size of Physical memory.

$\endgroup$
2
  • $\begingroup$ Isnt the physical memory supposed to be 2^(length of frame address) only without multiplying by frame size ? e.g. if page table entry is 32 bits RAM is 2^32 i.e. 4GB? $\endgroup$ Apr 27, 2016 at 13:36
  • 1
    $\begingroup$ When i said frame address, it is different from Physical Address. Physical address is frame address + offset. The "offset " is used to address a word(byte) in a particular frame. $\endgroup$ Apr 29, 2016 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.