I'm working on learning operating systems and I've come across a strange question that I don't know how to answer.
The question is:
Assuming a 1-KB page size, what are the page numbers and offsets for the following address references (provided as decimal numbers)?
The notes and slides I have are very confusing and I can't find anything quite like this from my searches. I understand that a 1KB page size means that it's 2^10 but what do I do after that exactly? Most descriptions I see involve splitting that in half and using the first half as your offset and the other half as the page number but then I see others saying not to do this and my notes, as I mentioned, are useless. I'm sure this is extremely easy but I feel like I've been given only 1/3 of the knowledge needed.
Any help would be greatly appreciated!
I took a step back for a little while and I think I realized where my confusion was coming from.
I determined that 21,205 is within the range of 2^15, so it's a fifteen bit number. If I subtract the size of the page (10) from the size of the number (15) then that should, in theory, give me a page number of 10 and an offset of 5.
The next bit is pure speculation on my part but I'm assuming that I then take the decimal form of 21,205, which is 101001011010101, and segment it accordingly. The first ten bits (1010010110) equals 662 and the last five bits (10101) equals 21. So my tentative answer is
Page Number = 662 & Offset = 21.
Is this at all reasonable or do I do it completely wrong?