Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please proof my work. Make needed corrections if necessary :) 2. Determine for the following code how many pages are transferred between disk and main

Please proof my work. Make needed corrections if necessary :)
image text in transcribed
image text in transcribed
2. Determine for the following code how many pages are transferred between disk and main memory, assuming each page has 2000 words, the active memory set size is 1000 (i. e., at any time no more than 1000 pages may be in main memory), and the replacement strategy is LRU (the Least Recently Used page is always replaced); also assume that all two- dimensional arrays are of size (1:2000, 1:2000), with each array element occupying one word, N=2000 for I := 1 to 4000 do for J :=1 to 4000 do { A[I,J] :=A[I,J) *B[I,J]; B[I,J] :=C(N-I+1,J) *B[I,J] } provided the arrays are mapped into the main memory space (a) in row-major order, (b) in column-major order. 2a) For A[I, JI ALIJ] *B[I, J], - there are 4 pulls and 4 writes to A for each t and 4 pils to Be FOR B[I, J] =CINI, J]* ALI, J] There are 4 writes to B , 4 polls to C and 4 pulls taken from A suce A is already in memory for every I. Hence; ( (3) 24 pulls)) + ((2) 84 writes). * 4000= 180,000 transfers 26) Since each now has 4000 transfers And each column has 4,000 pages. There are 3 reads and 2 wrtes. Hence, 4000 * 4,000 *5=180,000,000 transfers 2. Determine for the following code how many pages are transferred between disk and main memory, assuming each page has 2000 words, the active memory set size is 1000 (i. e., at any time no more than 1000 pages may be in main memory), and the replacement strategy is LRU (the Least Recently Used page is always replaced); also assume that all two- dimensional arrays are of size (1:2000, 1:2000), with each array element occupying one word, N=2000 for I := 1 to 4000 do for J :=1 to 4000 do { A[I,J] :=A[I,J) *B[I,J]; B[I,J] :=C(N-I+1,J) *B[I,J] } provided the arrays are mapped into the main memory space (a) in row-major order, (b) in column-major order. 2a) For A[I, JI ALIJ] *B[I, J], - there are 4 pulls and 4 writes to A for each t and 4 pils to Be FOR B[I, J] =CINI, J]* ALI, J] There are 4 writes to B , 4 polls to C and 4 pulls taken from A suce A is already in memory for every I. Hence; ( (3) 24 pulls)) + ((2) 84 writes). * 4000= 180,000 transfers 26) Since each now has 4000 transfers And each column has 4,000 pages. There are 3 reads and 2 wrtes. Hence, 4000 * 4,000 *5=180,000,000 transfers

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions