I am having difficulties with understanding the concept of paging.
As a result I've got no idea how I can solve the following exercise - I'm lacking one more equation to solve it.
I've read a lot about paging and watched a few tutorials, but I still cannot solve paging problems easily. I'll provide some of the resources I learnt from at the bottom of this question.
Background:
The CPU has two level paging and the logical and physical addresses are of $34$ bits size each.
The sizes of the page table directory, the table directory and the page are equal.
The logical address $(12345678)_{16}$ has been translated to the $(ba9678)_{16}$ physical address.
What's the size of a single page?
My attempt:
- The logical address can be decoded to:
$$(00\ 0001\ 0010\ 0011\ 0100\ 0101\ 0110\ 0111\ 1000)_2$$ The physical address can be decoded to: $$(00\ 0000\ 0000\ 1011\ 1010\ 1001\ 0110\ 0111\ 1000)_2$$ So, as you can see, they share the last $14$ bits.
Hence, the number of bits representing offset is $\leq 14$. The physical address looks like this:
+-----------+-----------+--------+ +-page-size-+-page-size-+-offset-+ +-----------+-----------+--------+
because page size = page table size = table directory size.
Therefore, we get the following equation: $$ 2\times \text{page size} + \text{offset} = 34 $$
However it is not sufficient to tell what is the page size. I'm stuck.