edited by
717 views
9 votes
9 votes

Assume a linear page table, with a 1-byte page-table entry. Assume physical and virtual address spaces of size 128 bytes with 32-byte pages. The page-table base register is set to physical address 16. The contents of the page table are:
$$
\begin{array}{cc}
\textbf{VPN} & \textbf{PFN} \\
0 & 1 \\
1 & \text{Not valid} \\
2 & 3 \\
3 & \text{Not valid}
\end{array}$$
Where VPN is the Virtual Page Number and PFN is the Physical Page Number.
 

Now, finally assume we have the following instruction, which loads a SINGLE BYTE from virtual address 70 into register R1:
$$\text{10: LOAD 70, R1}$$
This instruction resides at virtual address 10 within the address space of the process.

What are the physical addresses that will get referred in fetch and execute of the above instruction?

  1. 10
  2. 42
  3. 102
  4. 70
edited by

2 Answers

Best answer
4 votes
4 votes

It is a very conceptual question .

there 2 virtual address that is being referred one is 10(instruction) and the other is 70(load 70 in R1).

for 10 as the page is ZERO will get mapped to 1 frame and the decmal offset is 10 mod 32 =0.3125
so 1+0.3125 =1.3125
so 1.3125*32=42 which is physical adress.

for the 70 virtual adress

the page is (70/32=2.1875)  "2" and the offset is 0.1875

so frame will be 3 and the offset is same which will result in 3.1875 to get physical address 3.1875*32 = 102

selected by
0 votes
0 votes
Here, 70 is the virtual address we are addressing and it will reside in page number 2 (0-indexing). The page number 2 has PFNs from 96 to 127. How is 70 a correct option?
Answer:

Related questions

528
views
1 answers
4 votes
GO Classes asked Feb 5
528 views
Consider a sliding window protocol with a window size of $5$ using cumulative ACKs (and ACK is being sent for each segment).Assume that the retransmission ... packet 3 was duplicated by the networkACK packet A3 was duplicated by the network
633
views
1 answers
5 votes
GO Classes asked Feb 5
633 views
For sets $A$ and $B$, let $f: A \rightarrow B$ and $g: B \rightarrow A$ be functions such that $f(g(x))=x$ for each $x \in B$. Which among the ... function $f$ must be onto.The function g must be one-to-one.The function $g$ must be onto.