Buy Answer Now 2085

Posted: December 15th, 2023

You are given the following code to analyze:
1. int x[2][128];2. int i, sum = 0;3. for (i = 0; i < 128; i )4. sum = x[0][i] * x[1][i];Assume the code is executed under the following conditions:• sizeof(int) = 4• Array x begins at mem. addr. 0x0 and is stored in row-major order.• Cache initially empty• Only mem. accesses are to elements of x. Rest of the variables are in registers.(a) Case 1: Assume cache is 512 bytes, direct-mapped, with 16 byte blocks. Whatis the miss rate? Explain.(b) Case 2: What is the miss rate if the cache size is doubled (becomes 1024 bytes).Explain.(c) Case 3: If the cache were to be a 512 byte, two-way set-associative cache usingan LRU replacement policy, with 16 byte cache blocks. What is the cache missrate? Explain.(d) For case 3, will a larger cache size help reduce the miss rate? Why or whynot?(e) For case 3, will a larger block size help reduce the miss rate? Why or whynot?(2) 3M decides to make Post-its by printing yellow squares on white pieces of paper. Aspart of the printing process, they need to set the CMYK (cyan, magenta, yellow,black) value for every point in the square. 3M hires you to determine the efficiency ofthe following algorithms on a machine with a 2,048-byte direct-mapped data cachewith 32-byte blocks. You are given the following definitions:1 struct point color {2 int c;3 int m;4 int y;5 int k;6 };78 struct point color square[16][16];9 int i, j;1

Get your paper done on time by an expert in your field.
plagiarism free

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00