• recategorized by
374 views
0 0 votes

 

Consider the following program fragment that deals with a table $\mathrm{T}$ with $17$ rows and $1024$ columns, computing an average for each column and printing it to screen ( $\mathrm{i}$ is row index and $\mathrm{j}$ is column index):
for $\mathrm{j}=[0 \ldots 1023]\{$
temp $=0$
for $\mathrm{i}=[0 \ldots 16]$
temp $=$ temp $+T[i][j]$
print ( temp/ 17.0); }

$\mathrm{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 $\mathrm{T}$ is stored in the virtual address space in row major format.

How many page faults will be encountered?

  1. $16,402$
  2. $17,408$
  3. $18,208$
  4. $18,608$

 

Please log in or register to answer this question.

Position:
Show:

Related questions

0 0 votes
0 0 answers
416
416 views
admin asked Jul 28, 2023
416 views
Consider the following program fragment that deals with a table $\mathrm{T}$ with $17$ rows and $1024$ columns, computing an average for each column and printing it to sc...
0 0 votes
0 0 answers
340
340 views
admin asked Jul 28, 2023
340 views
Consider the following program fragment that deals with a table $\mathrm{T}$ with $17$ rows and $1024$ columns, computing an average for each column and printing it to sc...
0 0 votes
1 1 answer
897
897 views
admin asked Jul 28, 2023
897 views
What is the output of following code?main () struct s1 { char * z; int i; struct s1 * p; } static struct s 1 a []}={ {"Nagpur", 1, a+1} {"Raipur', 2, a+2} {"Kanpur', 3, a...
0 0 votes
1 1 answer
426
426 views
admin asked Jul 28, 2023
426 views
What is the output of following code?main () { static float a[]=\{13.24,1.5,4.5,5.4,3.5} float * j, * k; j= a}; k= a + 4 j=j * 2; k = k / 2; printf ("% f % f",* j,*k); } ...