retagged by
19,706 views
49 49 votes
A computer system supports a logical address space of $2^{32}$ bytes. It uses two-level hierarchical paging with a page size of $4096$ bytes. A logical address is divided into a $b$-bit index to the outer page table, an offset within the page of the inner page table, and an offset within the desired page. Each entry of the inner page table uses eight bytes. All the pages in the system have the same size.

The value of $b$ is _________. (Answer in integer)

12 Answers

41 41 votes

Logical Address Space $= 2^{32}$ Bytes
Page Size $= 4096$ Bytes $= 2^{12}$ Bytes
Page Table Entry Size $($at inner page table$)$ $= 8$ Bytes $= 2^{3}$ Bytes

It is given that there is two-level hierarchical paging, with $b-$bit index to the outer page table.

Now, as given all pages in the system have the same size. So, $1$ Page Table should fit in $1$ Page.
Therefore, Page Table Size $=$ Page Size.

Page Table Size $= 2^{12}$ Bytes
Page Table Size $=$ No. of Entries $\times$ Page Table Entry Size

So, 
No. of Entries $\times$ Page Table Entry Size $= 2^{12}$ Bytes

No. of Entries at inner level$= \frac{2^{12}}{2^{3}} = 2^{9} $

As, no. of entries are $2^{9}$ at inner level, $9$ bits would be required for index at that level.
So, $x=9$

$b+x+12 = 32$
$b=32-12-9$
$b=11$

Answer : Value of $\mathbf{b}$ is $\mathbf{11}$  

edited by
5 5 votes

Given here Logical Address space size is $32$ bit.
Page table size = $4096$ bytes=2^12 bytes. 

Given it is a $2-level$ page table , so we have it will be look like this,

 

So we need to find $x$ only.
Inner page table entry size is =$8$ bits.
So number of entries inner page table can store is =$2^{12}/8=2^{9}$.
So $x=9$ bits.
So, $b=(32-9-12)=11$ bits.

So correct answer is 11 bits.

1 flag:
✌ Edit necessary (nobodysomebody “inner page table entry is 8 bytes not 8 bits”)
4 4 votes

We are given the following parameters:

  • Logical address space: 232 bytes
  • Page size = 4096 bytes = 212 bytes means Page offset = 12 bits
  • Inner page table entry size = 8 bytes = 23 bytes
  • Number of entries per page (inner page table): 4096 / 8 = 512 = 29 so Inner page table index = 9 bits

 

The 32-bit logical address is divided as follows:

  • Outer page table index: b bits
  • Inner page table index: 9 bits
  • Page offset: 12 bits

Therefore:

b + 9 + 12 = 32

b = 32 - 21 = 11

Answer: The value of b is 11.

3 3 votes
Inner Page Table size= No.of pages * e
                                   = [(2^32)/2^12]*2^3
                                   = 2^23

Now, we will apply paging on this page table
So, number of pages in the outer page table= (2^23)/2^12= 2^11
so the value of b which acts as a page number= log(No. of pages)= log(2^11)=11
Answer:
Position:
Show:

No related questions found