A)
Given Information:
The definition for the code is mentioned below:
//Traverse through the grid
for (i =0; i < 16; i++)
{
for (j = 0; j < 16; j++)
{
//add values of x into grid
total_x += grid[i][j].x;
//add values of y into grid
total_y += grid[i][j].y;
}
}
B)
Given Information:
The definition for the code is mentioned below:
//Traverse through the grid
for (i =0; i < 16; i++)
{
for (j = 0; j < 16; j++)
{
//add values of x into grid
total_x += grid[i][j].x;
//add values of y into grid
total_y += grid[i][j].y;
}
}
C)
Explanation of Solution
Miss rate:
- The cache can only hold half of the elements in the array, so that means that a read to grid[8][0] will evict the block that was loaded when we read grid[0][0]. Since this block also contained grid[0][1], the first read of grid[0][1] will be a miss.
- Hence, each iteration will have one hit and one miss.
- This means one will have 128 hits and 128 misses.
Hence,
D)
Explanation of Solution
New Miss Rate:
If the cache were twice as big them also no change will be made to the mi...
Want to see the full answer?
Check out a sample textbook solutionChapter 6 Solutions
Computer Systems: A Programmer's Perspective Plus Mastering Engineering With Pearson Etext -- Access Card Package (3rd Edition)
- Problem Question 03 (CO3) [0.5 + 0.5 = 1]: Given below are the contents of several Intel 8086 registers and PHYSICAL memory addresses (ALL in hexadecimal): Registers: Memory Locations [Physical Address] = Contents [05000] = 3300 [06000] = 4444 [07000] = 5555 [95000] = 367A [96000] = 6666 [97000] = 10C5 DI = 3000 %3D BX = 3000 %3D ВР 3 С345 For the following instructions, determine the contents of AX after the each of the instruction has been executed: (а) MOV (b) MOV АХ, ВР АХ, [ВХ+DI] AX = AXarrow_forwardProblem 5. (C65. (5. s) Sort 3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5 using quicksort with median-of-three partitioning and a cutoff of 3.arrow_forward(a) (b) (c) 6.4 Given the following properties, draw trees that satisfy them: Number of nodes: 14 • Number of nodes with depth 2: 6 Height of the tree: 3 • Number of nodes: 12 • Number of leaf nodes: 6 Height of the tree: 6 Number of nodes: 23 Height of the tree: 3arrow_forward
- Problem #2: [35 pts] Parity Bit CheckerThe parity bit of a sequence of bits is 0 if the number of 1’s in the sequence is even and 1otherwise.Example: if the sequence of bits is 1 1 0 1, the parity bit should be 1 (total number of 1-bits is 3 whichis odd) if the sequence of bits is 1 0 1 0, the parity bit should be 0 (total number of 1-bits is 2 whichis even)Write a Java program that asks the user to enter the number of bits he has. The program thenreads the bits as separate integers. In the end, the program prints the parity bit on the screen. Ifthe use enters a bit value that is neither 0 nor 1, the entry should be discarded and a messagedisplayed as shown in the sample run.Sample run 1:How many bits do you have? 6Enter 6 bits: 1 1 0 0 1 0The parity bit is 1Sample run 2:How many bits do you have? 8Enter 8 bits: 1 1 1 0 0 0 0 1The parity bit is 0Sample run 3:How many bits do you have? 5Enter 5 bits: 1 1 3 0 1Incorrect bit value 3 is discarded.The parity bit is 1 java brogramarrow_forwardProblem 1.10: Simplify F(A, B,C, D) = ACD+ A'B + D'arrow_forwardPROBLEM 21 - 0517: Write a subroutine which computes the roots of the quadratic equation a,x2 + a,x + a, = 0 according to the quadratic formula: X12 = (-az/2a,) + V[(a,/2a,)2 – (a,/a,)) (= [{a, + v(a?, - 4a,a,)} / 2a,]) (START SUBROUTINE QUAD COMPUTE, DISCRIMINANT (DISC) DISCarrow_forwarda) A block-set associative cache memory consists of 128 blocks divided into four block sets. The main memory consists of 32,768 blocks and each block contains 512 eight-bit words (1) How many bits are required for addressing the main memory? (ii) How many bits are needed to represent the TAG SET and WORD fields? b) Write a program to code the equation X=(A+B)L| ((C+D) using one-address instructions. Please solve only the b partarrow_forwardProblem D. DNA Input file: Output file: Time limit: standard input standard output 1 second 256 megabytes Memory limit: As you know desoxyribonucleic acid consists of 4 mucleobases: adenine, guanine, cytosine, thymine. This nucleobases must form pairs: adenine with thymine and guanine with cytosine. You are given the sequence of nucleobases in the first part of DNA spiral. Please, find its second part. Input You are given the only string DNA. It is guaranteed that DNA consists only of uppercase letters 'A', "C', T', 'G'. Output Print the second part of DNA spiral. Examples standard input standard output ACTG TGÁC A GTA СATarrow_forward(15pt) Assume that instruction cache miss rate is 2%, data cache miss rate is 10%, CPI (clock cycle per instruction) is 2 without any memory stall, and miss penalty is 100 cycles. In addition, assume that the frequency of loads/stores is 30%. (a) Compute CPI with memory stall. (b) When CPI without any memory stall becomes 1, compute CPI with memory stall. (c) If the CPU clock rate is doubled with the same memory when CPI without memory stall is 2, compute CPI with memory stall.arrow_forwardQ2) Amdahl's law determines the speedup of a parallel program that has a sequential fraction 0 <= f<=1. Suppose we have f = 1/5 ( i.e. 20% of the program is sequential and cannot be parallelized ) and number of processors P = 6. 1. What is the speedup of this parallel program? 2. What is the parallel efficiency ?arrow_forward(3) (a) Consider the following interaction with Python: x= [1,2,34 ,5 ,6 , np.nan] y= (10,i,2,5, 'Missing',6.3) z= [0.1, 1.2 , np.nan , 4,5.1,0.5] df1=DataFrame ({'col1':Series (z),'co12':Series (y), 'col3': Series (x)}). df1.index= ['a','b','c', 'd','e','f'] Replace the NaN value in coll with -9, the Missing value in col2 with -99, and the NaN value in col3 with -999 with relevant functions. Name as dfl_replaced (b) Consider the following interaction with Python: df2=DataFrame (np. array ( [[1, np.nan ,3, 8], [np.nan , 2,3,5] , [10,2,3, np.nan], [10,2,3 , np.nan], [10,2,3,11]])) df2.columns = ['one', 'two', three', four '] df2. index= ['a','b','c 'd','e'] Remove the rows that have nan values from df2 and name as df2_row. Remove the columns that have nan values from df2 and name as df2_column. Use relevant functions.arrow_forwardPractice Problems (5) 1) Write a program to make a table of the physical properties for water in the range of temperatures from 273 to 323 K. The Density : The conductivity: K= 0.34 + 9.278 * 10* T The Specific heat: Cp= 0.015539 (T – 308.2)² + 4180.9 p= 1200.92 – 1.0056 T + 0.001084 Tarrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education