0

Given the size of the page is 4KB, find the page number and page offset of this address (provided in decimal) 21235.

The Offset would be 21235 / (4*2^10) = 5.xxx => 5

The page number would be 21235 % (4*2^10) = 755

And I am wonder the explanation of this? I know the numbers but not the explanation

Thank you, you all !

CosmosLee
  • 57
  • 3
  • 7

1 Answers1

0

Update:

Page number = logical address / page size in this case is 21205 / 1024 = 20

Offset = logical address mod page size in this case is 21205 mod 1024 = 725

Sources:

http://www.yorku.ca/pkashiya/cse1520/Paged%20memory%20technique.htm http://www2.cs.uregina.ca/~hamilton/courses/330/notes/memory/paging.html

The Post over at Meta:

https://cs.stackexchange.com/questions/124826/determine-page-number-and-offsets-for-address-references/142321#142321

CosmosLee
  • 57
  • 3
  • 7
  • 1
    [Link only answers](https://meta.stackexchange.com/questions/8231/are-answers-that-just-contain-links-elsewhere-really-good-answers/8259#8259) are considered very low quality and [can get deleted](https://stackoverflow.com/help/deleted-answers), please put the important parts from the linked resource into the answer body. – helvete Feb 04 '22 at 11:47
  • I believe this is incorrect. Your link clearly mentions that you are looking at 1KB offset, and this question says 4KB. – Normen Yu Feb 23 '23 at 03:36