0
$\begingroup$

I am studying Computer Systems. I have th following question and its answer:

Given the logical address 0xAEF9 (in hexadecimal) with a page size of 256 bytes, what is the page number?

Answer: 0xAE (I found this answer in the web, but I want to know how can I figure it out myself?

How can I figure out the page number for a given logical address?

$\endgroup$
0
$\begingroup$

Your logical address is made of 16 bits, that means you have a addressable space of $2^{16}$ bits. The page size is typically a power of 2, $2^n$, in this case $2^n = 256 \Rightarrow n = 8$.

The page number is calculated by substracting $n$ from the size of your logical address: $16 - 8 = 8$, so the first 8 bits of the address are your missing page number, that is 0xAE

$\endgroup$
0
$\begingroup$

Logical address includes both page number and the offset within the page.
Your logical address is 16 bit.

Page size as mentioned is 256 = 28. It means that 8 bit address is necessary to address any word within the page. The least significant 8 bits are used for this purpose (as offset address)

The remaining bits (the most significant 8 bits) are used as page number.
So the fist 8 bits specify the page number. 0xAE in this case.

$\endgroup$
  • $\begingroup$ duplicated answer maybe $\endgroup$ – Alejandro Sazo May 4 '13 at 23:45
0
$\begingroup$

Page Number=Logical Address/Page Size

AEF9 converted to decimal-> 1*9+16*15+16^2*14+16^3*10 = 44793

44793/256=174

174 in hexa-> AE

$\endgroup$
  • $\begingroup$ There is absolutely no need to convert to decimal. AE are the first two hexadecimal digits of AEF9. $\endgroup$ – Yuval Filmus Dec 18 '16 at 16:01

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.