1
$\begingroup$

I try to solve an exercise, unfortunately without any success yet.

From the following given information, the virtual address space should be calculated:

  • Page size is 16 KB
  • Logical address size is 47 bit
  • 3 levels of page tables; all have the same size
  • Page table entry size is 8 byte

My idea is to find out how many pages can be addressed. The page count should lead then to the size of the virtual address space, right?

Virtual address space = page size * page count

As far as I understand is the page count defined by the logical address size. The logical address is split up in 3 levels of page tables plus the offset. Due the page table entry size is 8 byte (2^6 = 64 bit), 6 bits of the logical address are used for each stage to address it. The offset will have the size of 30 bits.

Each page stage can address 64 bit plus the 30 bits offset. So does this result in the page count?

Page count = 64 * 3 + 30 = 222

With the page size and the page count I get the virtual address space of 3552 KB.

I think this is wrong. It should be much larger. What is not correct? Any help is appreciated!

$\endgroup$
  • $\begingroup$ Windows 32 bit has a page size of 4KB, yet it's virtual address size is 4GB. $\endgroup$ – Johan May 1 '16 at 16:38
  • $\begingroup$ And a logical address size of 47-bit corresponds to 140TB. you'd expect the virtual address space to be bigger than the logical size.... $\endgroup$ – Johan May 1 '16 at 16:41
  • $\begingroup$ See: d.umn.edu/~gshute/os/address-translation.xhtml $\endgroup$ – Johan May 1 '16 at 16:49
3
$\begingroup$

Since Logical address size is 47 bit, that means logical address space is 2^47 bytes ( assuming system is byte addressable ).

Otherwise in general if the logical address is not given then also it can be found.

Page size is 16 KB
Logical address size is 47 bit
3 levels of page tables; all have the same size
Page table entry size is 8 byte

From the information assuming the entire page is being used,

number of entries in each page = (page size) / (page table entry size ) = (2 ^ 11)

Now consider the outermost page table. It has 2 ^ 11 entries, which means the second level page table has 2 ^ 11 pages and each page has 2 ^ 11 entries.
Going by this logic it can be derived that the number of pages in process ( logical address space ) = 2 ^ 33
And given page size = 16 KB
Therefore, the logical address space size = ( 2 ^ 33) * 16 KB = 2^47 bytes

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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