-5

ive had a look around and I cant seem to find an answer or how to work out this question, its a tutorial question for my operating systems course and ive looked through the notes that come with the question and i cant get an answer along with looking at the Ritche and silberschatz OS books. the question asks:

Demonstrate using a diagram how a logical address consisting of 24 bits could be converted to a paging system where each page was 16Kbytes. How many pages would there be in this system?

Darision
  • 1
  • 2
  • please don't **[cross-post](https://meta.stackexchange.com/tags/cross-posting/info "'Cross-posting is frowned upon...'")**: http://stackoverflow.com/questions/43821491/how-to-convert-a-logical-address-to-a-paging-system "Cross-posting is frowned upon as it leads to fragmented answers splattered all over the network..." – gnat May 06 '17 at 15:15
  • I learned virtual memory from Silberschatz & Galvin. I can assure you that it contains exactly the information needed. – Jules May 06 '17 at 20:05

1 Answers1

1

Assuming byte addressable, 16k bytes requires 16k addresses, right?

16k is 214. That means you need 14 bits to represent the full range of possible addresses within a 16k page.

So, what you need to do with the 24-bit logical addresses is consider 14 of those 24 bits as within-the-page addresses and the remaining 10 bits of those 24 bits as page numbers.

Usually this would be done by considering the lower (or least significant) 14 bits as the in-page addresses and the upper 10 bits as the page-number (however many other schemes/configurations/definitions of separating out a set of 14 bits and set of 10 bits from 24 bits are possible).

TL;DR  --  We need to recognize that 16k is 214; then use the lower 14 bits to use as in-page address and use the upper 10 bits to designate the page-number.

How many pages would there be in this system?

I'll leave this as an exercise for the reader.

Erik Eidt
  • 33,282
  • 5
  • 57
  • 91
  • 1
    thank you, this was very helpful, Am i correct in then assuming that the page number of bits (2^10) then amounts to the number of pages in the system, giving a total of 1024 pages? – Darision May 06 '17 at 16:47