Aspire Faculty ID #18493 · Topic: UGC NET Computer Science June 2023 (Paper II) · Just now
UGC NET Computer Science June 2023 (Paper II)

Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average for each column and printing it to screen, where 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 paged 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?

Solution

For row major arrangement:

Each row has 1024 elements.

Page size = 1024 words

So, each row occupies 1 page.

Total rows = 17, so total pages = 17.

Main memory can hold only 16 pages.

The program accesses column-wise:

$T[0][j], T[1][j], T[2][j], ..., T[16][j]$

So, every access causes a page fault.

Row major page faults:

$17 \times 1024 = 17408$

For column major arrangement:

Elements of each column are stored continuously.

Total elements:

$17 \times 1024 = 17408$

Page size = 1024 words

Column major page faults:

$\frac{17408}{1024} = 17$

Fault ratio:

$17408 : 17 = 1024 : 1$

Previous 10 Questions — UGC NET Computer Science June 2023 (Paper II)

Nearest first
1
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average f…
Topic: UGC NET Computer Science June 2023 (Paper II)
2
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average f…
Topic: UGC NET Computer Science June 2023 (Paper II)
3
Consider again that T is stored in column major format, what is the main memory hit ratio?
Topic: UGC NET Computer Science June 2023 (Paper II)
4
Consider the following program fragment that deals with a table T with 17 rows and 1024 columns, computing an average f…
Topic: UGC NET Computer Science June 2023 (Paper II)
5
An observational technique that can be used to understand operational process and help to derive requirement for softwa…
Topic: UGC NET Computer Science June 2023 (Paper II)
6
Consider universe positive integer $X = {1 \le n \le 8}$, proposition P = "n is an even integers", Q = "$(3 \le n \le 7…
Topic: UGC NET Computer Science June 2023 (Paper II)
7
Match List I with List II LIST ILIST II  A. CDMA I. It provides mobile internet connection with fas…
Topic: UGC NET Computer Science June 2023 (Paper II)
8
Consider the following statements:A. The set of Turing machine codes for TM's that accept all inputs that are palindrom…
Topic: UGC NET Computer Science June 2023 (Paper II)
9
Which one of the following is NOT a part of ACID properties of a database transaction?
Topic: UGC NET Computer Science June 2023 (Paper II)
10
Let $(Z,+)$ denote the group of all integers under addition. Then the number of all automorphisms of $(Z,+)$ is
Topic: UGC NET Computer Science June 2023 (Paper II)

Next 10 Questions — UGC NET Computer Science June 2023 (Paper II)

Ascending by ID
Ask Your Question or Put Your Review.

loading...