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 2000
do for J :=1 to 2000
do { A[I, J]:=A[I,J] *B[I,J]; B[I,J]:=C(N-I+1,3]*B[I,J] } provided
the arrays are mapped into the main memory space:
Provide solutions in:
(a) in row-major order,
(b) in column-major order.
2. Determine for the following code how many pages are transferred between disk and main memory,...
Please help answer the following questions on how operating systems handle memory allocation in Main Memory. Suppose page size = 2^11 and the logical address is 15 bits. How many pages can a process have at most? Convert the logical address of 18723 to a <page#, offset> format. Assume the page size from the question 1. Suppose the logical address 18723 is located in frame 5. What is the physical address that the logical address is mapped to?
Q1. Consider the following reference string and the frame size is 3 (3 pages can be in main memory at a time) 10 2 3 4 1 2 3 0 3 2 1 4 1 1 0 3 4 1 2 Apply the following page replacement algorithms and find the page faults: a. FIFO b. Optimal LRU
Assume you have: 32-bit addresses, 4KB Page size, 4MB Physical Memory Space, 4KB Cache with 4-way set associative and LRU replacement, 32 Byte Cache block size, 4-entry fully associative TLB. A program to be run on this machine begins as follows: double A[1024]; int i, j; double sum = 0; for( i = 0; i < 1024; i++ ) // first loop A[i] = i; for( j = 0; j < 1024; j += 16 ) // second loop ...
1. Given that main memory is composed of only three page frames for public use and that a seven-page program (with pages a, b, c, d, e, f, g) that requests pages in the following order: a, c, a, b, a, d, a, c, b, d, e, f a. Using the FIFO page removal algorithm, indicate the movement of the pages into and out of the available page frames (called a page trace analysis) indicating each page fault with an...
Q1. Suppose we have a virtual memory of size 2 Terabytes (2048GB, or 241 bytes), where pages are 8KB (213 bytes) each, and the machine has 4GB (232 bytes) of physical memory. a) Compute the number of page table entries needed if all the pages are being used. b) Compute the size of the page table if each page table entry also required 4 additional bits (valid, protection, dirty, use). Q2. For this problem, you are given a...
QUESTION 1 Virtual Memory is a technique that makes excellent use of available space on a hard drive, to temporarily store data that would otherwise require massive amounts of main memory (RAM). True False 2 points QUESTION 2 Which of these allocation schemes require the entire program to be loaded before execution can begin? I. Segmented/Demand paged II. Paged III. Segmented IV. Demand paged 2 points QUESTION 3 Select the advantages of the First-In First-Out page replacement policy...
1. Consider the following well-known sorting algorithm, which is studied later in the book, with a counter inserted to count the number of key comparisons. ALGORITHM SortAnalysis(A[0..n − 1]) //Input: An array A[0..n − 1] of n orderable elements //Output: The total number of key comparisons made count ←0 for i ←1 to n − 1 do v ←A[i] j ←i − 1 while j ≥ 0 and A[j ]> v do count ←count + 1 A[j + 1]←A[j ]...
1) Write a script(in Bash shell) that characterizes the application performance. Specifically, your script should automatically test both algorithms of the matrix math program for each of the array sizes shown in Table. Also, extend your script to automatically parse the output of the program. Table (Array Sizes in Test Suite) Algorithm 1 Algorithm 2 256 256 512 512 768 768 1024 1024 1280 1280 1536 1536 1792 1792 2048 2048 C source file // Adapted from https://gustavus.edu/+max/courses/F2011/MCS-284/labs/lab3/ // Max...
whats the answers
How many total integers elements are in an array with 4 rows and 7 columns? 07 28 11 What is the resulting array contents, assuming that itemList is an array of size 4 having contents -55, -1, 0, 9? for (i = 0; i < 4; ++i) { itemsList[i] - i; -54,0, 1, 10 O 0, 1, 2, 3 O 1, 2, 3, 4 O-55,-1, 0,9 Given an integer array myVals of size N_SIZE (i.e. int[] myVals...
The following C++ code contains an incomplete program that should be able to calculate the distance between a series of geocoded locations. Two parts of the program need to be completed: 1. The portion of the main() function that calculates the distances between each of the hard-coded 5 locations, and stores it in a two-dimensional array declared as distances. 2. A portion of the calculateDistanceBetweenLocations(l1, l2) function; omitted code spaces are designed with a // TODO: comment. The code is properly...