in Operating System edited by
409 views
2 votes
2 votes

Suppose the page table for the process currently executing looks like the following.

All numbers are decimal, everything is numbered starting from zero, and all addresses are memory byte addresses. The page size is $1024$ bytes.

$\begin{array}{|c|c|c|c|c|} \hline \text{Virtual } & \text{Valid} & \text{Reference} & \text{Modify} & \text{Page} \\ \text{Page no} & \text{Bit} & \text{Bit} & \text{Bit} & \text{Frame No} \\ \hline 0 & 1 & 1 & 0 & 4 \\ \hline 1 & 1 & 1& 1 & 7 \\ \hline 2 & 0 & 0 & 0 & \text{BLANK} \\ \hline 3 & 1 & 0 & 0 & 2 \\ \hline 4 & 0 & 0 & 0 & \text{BLANK} \\ \hline 5 & 1 & 0 & 1 & 0 \\ \hline \end{array}$

What physical address, if any, would each of the following Virtual addresses correspond to?  (Do not try to handle page faults, if any)

  1. $1052$
  2. $2221$
  3. $5499$  respectively.
  1. $1052$,  $2221$, $5499$
  2. $7196$,   -------- ,   $379$
  3. $7196$,   --------- , $5120$
  4. -------,   $2221$,   --------
in Operating System edited by
by
409 views

3 Answers

7 votes
7 votes
Best answer
(i)1052 = 1024 + 28 maps to VPN 1 in PFN 7 (7 * 1024 + 28 = 7196)    so it is 7196

1052/1024 = 1 and remainder is 28 ,

this 1 is VPN which maps to PFN 7 . so 7 * 1024 + 28 = 7196

ii)  2221 = 2 * 1024 + 173 maps to VPN 2,   page fault ,     this have page fault so blank

(iii)   5499 = 5 * 1024 + 379 maps to VPN 5 in PFN 0  (0 * 1024 + 379 = 379 )  it is 379

5499/ 1024 = 5 , this 5 is VPN 5 which maps to PFN 0

 so (0 * 1024 + 379) ( where 379 is remainder when devide 5499 / 1024 )
selected by

4 Comments

@Bikram sir small confusion : how are we deducing that hwo many bits are used in page no like 1052 could be represent as 1024+28=1000011100 now offset is itself 10 bits then page no would be 0? please clarify?
0
0
no 1052 is represented as 10000011100 in binary and page offset is lower 10 bits and thus page number becomes 1
2
2

saxena0612

1052 = (10000011100 )2

10000011100 = 1024 +16+8+4 = 1024 + 28= 1052

0000011100 are lower 10 bits they are use as page offset so page number is remain bit which is 1 .

------

similarly 

2221 =(100010101101)2

lower 10 bits are 0010101101

so we left with 10 which is 2 ..hence page number =2

0
0
@parulk

@Bikram sir

My bad, thanks, I got it!
0
0
0 votes
0 votes
not getting question ?

3 Comments

This question is about Virtual to Physical address translation.

There are three virtual address is given and we have to find corresponding physical address and fill-in blanks represents page fault .
0
0
plz provide the solution also
1
1
(i)1052 = 1024 + 28 maps to VPN 1 in PFN 7 (7 * 1024 + 28 = 7196) so it is 7196

1052/1024 = 1 and remainder is 28 , this 1 is VPN which maps to PFN 7 . so 7 * 1024 + 28 = 7196

ii)2221 = 2 * 1024 + 173 maps to VPN 2, page fault, this have page fault so blank

(iii) 5499 = 5 * 1024 + 379 maps to VPN 5 in PFN 0  (0 * 1024 + 379 = 379 )  it is 379

5499/ 1024 = 5 , this 5 is VPN 5 which maps to PFN 0  so (0 * 1024 + 379) ( where 379 is remainder when devide 5499 / 1024 )
3
3
0 votes
0 votes

 

All numbers are decimal, everything is numbered starting from zero, and all addresses are memory byte addresses. The page size is 10241024 bytes.

  • 1052

1052th address would be in second page => Page Number 1 => Frame Number 7.

 

  • 2221

2221th address would be in third page => Page Number 2 => Absent.

 

  • 5499

5499th adress would be in sixth page => Page Number 5 => Frame Number 0.

 

Clearly, Option B

Answer:

Related questions