I am given a system with a segmented paging architecture. Both physical and virtual address spaces contain $2^{16}$ bytes each. The virtual address space is divided in $8$ equal size segments. The page table consist of $2$ byte page table entries.
Question 1:
What is the minimum page size in bytes so that page table for a segment requires at most 1 page to store it?
My interpretation:
There are $2^{16}$ virtual addresses. These are evenly divided between $8$ segments so each segment is $\frac{2^{16}}{2^3}=2^{13}$ bytes.
Now each segments will be divided into pages. Each page will be $2^n$ bytes. So there are $2^{13-n}$ pages (and page table entries) per segment. A page table entry is $2$ bytes long and page size is $2^n$. So $2^{n+1}$.
$2^{13-n} = 2^{n+1}$ gives $n = 6$. But the answer should be $n = 7$.
I know I made a mistake in page table entry as I didn't get the page table entry concept properly. Is that a f (f+d = memory address)? I am not getting page table entry. Please explain to me this concept.
Question 2:
Assume that page size is $512$ bytes. Each page table entry contains (besides other information) $1$ valid bit, $3$ bits for page protection and $1$ dirty bit. How many bits are available in a page table entry for storing the aging information for the page?
My way of thinking about the answer here:
$16$ bits for physical memory. Page size is $512$ bytes means $9$ bits required. That's $16-9= 7$ bits for a frame.
Now I'm stuck.