Dark Mode

409 views

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)

- $1052$
- $2221$
- $5499$ respectively.

- $1052$, $2221$, $5499$
- $7196$, -------- , $379$
- $7196$, --------- , $5120$
- -------, $2221$, --------

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 )

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 )

0

2

0 votes

0

(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 )

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

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**