U.G.C. NET Exam. June 2023 Paper-II (COMPUTER SCIENCE)

Total Questions: 100

91. Consider the following program fragment that deals with T with 17 rows and 1024 columns, computing an average for each column and printing it to screen (i is row index and j is column index):

for j = [0.... 1023]{
temp = 0;
for i =[0...16];
temp = temp + T [i] [j];
print (temp/17.0;}
T [i] [j] and temp are 32 bit floating point values and memory is word addressable. the temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is page and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", If T is stored in the virtual address space in row major format.
Consider again that T is stored in columnmajor format, what is the main memory hit ratio?

Correct Answer: (d) 99.9%
Solution:

92. Consider the following program fragment that deals with T with 17 rows and 1024 columns, computing an average for each column and printing it to screen (i is row index and j is column index):

for j = [0.... 1023]
{ temp = 0;
for i =[0...16];
temp = temp + T [i] [j];
print (temp/17.0;}
T [i] [j] and temp are 32 bit floating point values and memory is word addressable. the temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is page and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", If T is stored in the virtual address space in row major format.
Consider that T is stored in column major format, how many page faults will be encountered?

Correct Answer: (d) 17
Solution:

93. Consider the following program fragment that deals with T with 17 rows and 1024 columns, computing an average for each column and printing it to screen (i is row index and j is column index):

for j = [0.... 1023]
{ temp = 0;
for i =[0...16];
temp = temp + T [i] [j];
print (temp/17.0;}
T [i] [j] and temp are 32 bit floating point values and memory is word addressable. the temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is page and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", If T is stored in the virtual address space in row major format.
How many page faults will be encountered?

Correct Answer: (b) 17,408
Solution:

Each column spans 17 pages. main memory can hold only 16 pages at a time.
Therefore, for each column, there will be
17 – 16 = 1 page fau
There are 1024 columns and 17 rows.
so, the total number of page faults would be
= 1024 × 17
= 17408.

94. Consider the following program fragment that deals with T with 17 rows and 1024 columns, computing an average for each column and printing it to screen (i is row index and j is column index):

for j = [0.... 1023]
{ temp = 0;
for i =[0...16];
temp = temp + T [i] [j];
print (temp/17.0;}
T [i] [j] and temp are 32 bit floating point values and memory is word addressable. the temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is page and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", If T is stored in the virtual address space in row major format.
What is fault ratio of row major to column major arrangements?

Correct Answer: (a) 1024:1
Solution:

For the row-major arrangement: Each row contains 1024 contiguous memory locations. Accessing each column sequentially would result in a page fault every 1024 accesses, Since there are 1024 columns, there would be 1024 page faults. For the column-major arrangement:
Each column contains 17 contiguous memory locations. Accessing each column sequentially would result in a page fault every 17 accesses.
Both arrangements result in the same number of page faults, 1024. Therefore, the fault ratio of row major to column major arrangements is 1024:1.

95. Consider the following program fragment that deals with T with 17 rows and 1024 columns, computing an average for each column and printing it to screen (i is row index and j is column index):

for j = [0.... 1023]
{ temp = 0;
for i =[0...16];
temp = temp + T [i] [j];
print (temp/17.0;}
T [i] [j] and temp are 32 bit floating point values and memory is word addressable. the temporary variable temp is kept in a processor register so access to temp does not involve a memory reference. The main memory is page and holds 16 pages of size 1024 words, the page replacement policy is "least recently used", If T is stored in the virtual address space in row major format.
What is the main memory hit ratio?

Correct Answer: (a) 0
Solution:

96. IP datagram has arrived with following partial information in the header (in hexadecimal) 45000054000300002006....

How many more routers can the packet travel to?

Correct Answer: (d) 32
Solution:

The Time-to-Live (TTL) field represents the number of routers, the packet can traverse before being discarded. In hexadecimal, the TTL field is typically represented by the 9th byte in the header. In the given partial information, the 9th byte is '20'. Which in hexadecimal equal 32 in decimal. So, the packet can travel through 32 more routers before being discarded.

97. IP datagram has arrived with following partial information in the header (in hexadecimal) 45000054000300

What is the protocol of the payload being carried by the packet?

Correct Answer: (c) TCP protocol
Solution:

In hexadecimal, the protocol field is typically represented by the 10th byte in the header. In the given partial information, the 10th byte is '06', which in hexadecimal equals 6 in decimal. The value '6' corresponds to the TCP protocol. Therefore, the payload being carried by the packet is using the TCP protocol.

98. IP datagram has arrived with following partial information in the header (in hexadecimal) 4500005400

What is the size datagram?

Correct Answer: (c) 84 bytes
Solution:

In hexadecimal, this field typically occupies bytes 3 and 4 of the header. From the partial information provided, the total length field is represented by '0054' in hexadecimal. Which in hexadecimal equals 84 in decimal. Therefore, the size of the datagram is 84 bytes.

99. IP datagram has arrived with following partial information in the header (in hexadecimal) 4500005400030000200

What is the header size?

Correct Answer: (b) 20 bytes
Solution:

In the given partial information the internet header length (IHL) field is represented by the first nibble (4 bits) of the second byts. The second byte is '05' in hexadecimal, since the IHL field is measured in 32 bit words.
header length = 5 × 4 = 20 bytes
So, the header size is 20 bytes.

100. IP datagram has arrived with following partial information in the header (in hexadecimal) 45000054000300002

What is the efficiency of this datagram?

Correct Answer: (a) 76.19%
Solution: