239 views

2 Answers

0 votes
0 votes
1.Ease of calculation in binary

2.Tranparency to programmer ,assembler and loader
0 votes
0 votes

To obtain the Page number and Page offset ,  you need to perform some operation on the address(Virtual address ) which is generated . 

  1. Page number : You divide the address with the page size .
  2. Page Offset : You have the mod of the address with page size . 

And , now to do this you have to select that number which will require less operation and the less number of the operator to do the operation and we know that for doing the divide operator we can use (>>) Right shift operator which is equivalent to the divide with the 2 and for having he offset we need the mod with page size so its basically doing the ( AND ) operation to take the mod . 

Example : 12 :→ 1100 

Now, assume you have the page size as 8 ( power of 2 ) 

for divide you only need to shift 3 place :) 

for mod you only have to the (12& ( 8-1))  = ( 1100 & 01110 ) = 100 :→ 4 in decimal .

And for doing this operation for having in  power of two you need to require less hardware set up in mem and os for  calculating the operation . So , that’s why we have the page size in power of two . 

 

Related questions

0 votes
0 votes
0 answers
3
akash.dinkar12 asked Mar 21, 2019
346 views
Describe a mechanism by which one segment could belong to the address space of two different processes.