edited by
39,435 views
115 115 votes

Assume that in a certain computer, the virtual addresses are $64$ bits long and the physical addresses are $48$ bits long. The memory is word addressible. The page size is $8$ kB and the word size is $4$ bytes. The Translation Look-aside Buffer (TLB) in the address translation path has $128$ valid entries. At most how many distinct virtual addresses can be translated without any TLB miss?

  1. $16 \times 2^{10}$
  2. $256 \times 2^{10}$
  3. $4 \times 2^{20}$
  4. $8 \times 2^{20}$

12 Answers

0 0 votes

To make it very simple 

 

## Page size is 2^13 bytes,MM is word addressable , so 2^13/ 4 bytes =2,048 words = 2^11 words , each page is 2^11 words.

 

## Some Basics: TLB is a kind od  subset of Page Table , Page table has Page no with frame no , where as TLB has Page number , Frame no , Valid bit and dirty bit to . And the basic concept we need to know to solve this problem is , Each page has one entry in Page table and if so in TLB .So for 2^11 words only one entry in TLB and Page Table .

 

# So if TLB has 128 valid entries(that means there might be more but there are the entries for which valid bit is 1 and this are the one's which can be used)=> Then 128 X 2^11 =2^7 X 2^11 =2^8 X 2^10 = 256 X 2^10.  SO OPTION B .

0 0 votes

## Page size is 2^13 bytes,MM is word addressable , so 2^13/ 4 bytes =2,048 words = 2^11 words , each page is 2^11 words.

 

## Some Basics: TLB is a kind od  subset of Page Table , Page table has Page no with frame no , where as TLB has Page number , Frame no , Valid bit and dirty bit to . And the basic concept we need to know to solve this problem is , Each page has one entry in Page table and if so in TLB .So for 2^11 words only one entry in TLB and Page Table .

 

# So if TLB has 128 valid entries(that means there might be more but there are the entries for which valid bit is 1 and this are the one's which can be used)=> Then 128 X 2^11 =2^7 X 2^11 =2^8 X 2^10 = 256 X 2^10.  SO OPTION B .

0 0 votes

We can do this by convering to Byte addressable as well
Given , 
Page size = 2^13 B .
TLB has 128== (2^7). entries which means each entry maps to 2^13 distinct Virtual addresses
So in Total 128 entries maps to 2^7*2^13 = 2^20 Bytes 
To convert to word addressable divide by 4
Finally we can do 2^20 / 2^2  = 2^18 = 256 * 2^10

0 0 votes
In 128 ($2^7$) TLB entries we can store $2^7$ page to frame translation information.
Which means we have to look how many virtual addresses are present in those 128 pages.

Which can be calculated by:
$$128 \times 8 \text{ kB} \quad (\because \text{Page Size} = 8 \text{ kB})$$
$$= 128 \times 2^3 \times 2^{10} \text{ B} \quad (\because 1 \text{ kB} = 2^{10} \text{ B})$$
$$= 128 \times 2^{13} \text{ B}$$

Since the memory is word-addressable, we provide an address to each word, so we have to convert bytes into words.
To convert to words, we divide by the word size which is $4$ ($2^2$) Bytes:
$$= \frac{128 \times 2^{13}}{2^2} \text{ words}$$
$$= 128 \times 2^{11} \text{ words}$$

Which means $128 \times 2^{11}$ distinct addresses:
$$= 256 \times 2^{10} \text{ addresses} \quad (128 \times 2 = 256)$$

$\because$ Option B is correct.

 
0 0 votes

Mathematical Solution

$$\text{Word Size} = 4 \text{ B} = 2^2 \text{ B}$$

$$\text{Page Size} = 8 \text{ kB} = 2^{13} \text{ B}$$

Since the system is word-addressable:

$$\text{Words per Page} = \frac{\text{Page Size}}{\text{Word Size}} = \frac{2^{13} \text{ B}}{2^2 \text{ B}} = 2^{11} \text{ words}$$

$$\implies \text{Page Offset} = 11 \text{ bits}$$


TLB Translation Capacity

$$\text{TLB Entries} = 128 = 2^7 \text{ entries}$$

Each TLB entry maps exactly one virtual page containing $2^{11}$ distinct word addresses.

$$\text{Max Virtual Addresses without Miss} = \text{TLB Entries} \times \text{Words per Page}$$

$$= 2^7 \times 2^{11}$$

$$= 2^{18}$$

$$= 2^8 \times 2^{10}$$

$$= 256 \times 2^{10}$$

Correct Option: B ($256 \times 2^{10}$)

Answer:
Position:
Show:

Related questions

58 58 votes
8 8 answers
23.2k
23.2k views
Arjun asked Feb 7, 2019
23,215 views
Consider the following snapshot of a system running $n$ concurrent processes. Process $i$ is holding $X_i$ instances of a resource $R$, $1 \leq i \leq n$. Assume that all...
75 75 votes
6 answers 6 answers
47.6k
47.6k views
Arjun asked Feb 7, 2019
47,555 views
Consider the following four processes with arrival times (in milliseconds) and their length of CPU bursts (in milliseconds) as shown below:$$\begin{array}{|c|c|c|c|c|} \h...
39 39 votes
6 answers 6 answers
36.0k
36.0k views
Arjun asked Feb 7, 2019
35,971 views
The index node (inode) of a Unix -like file system has $12$ direct, one single-indirect and one double-indirect pointers. The disk block size is $4$ kB, and the disk bloc...
45 45 votes
11 answers 11 answers
29.2k
29.2k views
Arjun asked Feb 7, 2019
29,166 views
The following C program is executed on a Unix/Linux system :#include<unistd.h int main() { int i; for(i=0; i<10; i++) if(i%2 == 0) fork(); return 0; }The total number of ...