1

I am looking for help with the following homework question:

It is assumed that a program has a virtual space of 1200 words. Consider the following series of virtual addresses:

60; 222; 160; 910; 450; 345; 412; 10; 180; 20; 443; 766; 812.

Give the sequence of the referenced page numbers, assuming that each page has 200 words.

How does the total virtual space relate to the 200 word pages? Does this mean the memory has 6 pages? How do I determine the page number from the virtual address?

Just looking for help to understand the steps, not a full solution thanks! I have looked through many examples and have had trouble seeing a repeatable formulaic way to do this. I have trouble understanding long text chunks and prefer mathematical formulas but available answers seem to have very wordy explanations.

I'm thinking virtual address #60 on page 1 because it is less than 200. Then after that, 222 would be on page 2 since ceiling(222/200) = 2.

  1. Is that correct? Is ceiling(virtual address/page size) the right way to do it?

  2. What do I make of the 1200? Would a virtual address of 1201 be invalid for a virtual space that size?

John Kugelman
  • 349,597
  • 67
  • 533
  • 578
Bulbasaur
  • 303
  • 3
  • 19
  • 1
    You aren't looking for a full answer, but it seems your understanding is essentially correct amd there isn't much more to add to that to get to the full answer. But in most environments the page numbering and address numbering would start at 0, so floor instead of cieling. – user2407038 Dec 06 '20 at 23:35

1 Answers1

0

The formula is floor (virtual address / page size) for systems that use positional notation (start at zero) and ceiling (virtual address / page size) for systems that are 1-based (start at 1).

Bulbasaur
  • 303
  • 3
  • 19