The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
10 views

Consider the following extract from a program, written in a C-like language, that computes the transpose of a matrix.

for (i=0; i<N; i++)
    for (j=0; j<N; j++)
        B[i,j]=A[i,j];

$A$ and $B$ are $N \times N$ matrices with floating point etries that are stored in memory in row-major order as shown in the example below:

A[0,0] A[0,1] A[0,2] ... A[0,N-1] A[1,0] A[1,1] ... A[N-1,N-1]

This program runs uder an OS that uses demand-paging. Considering ONLY memory references to the matrix entries, and using the information given below, compute the page fault rate for the matrix transposition code given above.

  • Page size: $2^{10} bytes
  • Number of frames allocated to the program: 8
  • Page replacement policy: LRU
  • $N=2^{16}$
  • Size of each matrix entry: 8 bytes
  • Each of $A$ and $B$ is stored starting from the beginning of a page
  • None of the pages allocated to $A$ and $B$ are initially in memory.
asked in Others by Veteran (112k points) | 10 views

Please log in or register to answer this question.

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,317 questions
49,814 answers
164,546 comments
65,866 users