CISC 221 Assignment 6 Final Draft PDF PDF

Title CISC 221 Assignment 6 Final Draft PDF
Author Benjamin Hui
Course Computer Architecture
Institution Queen's University
Pages 4
File Size 116.3 KB
File Type PDF
Total Downloads 50
Total Views 137

Summary

CISC 221 Assignment 6 Final Draft With Answers...


Description

Submitted by: Benjamin Hui (20148554)

Instruction Execution Estimation Worksheet Function: Before Optimization One-time executions per function call = (a) 9 (for reference only. Not used in calculations) [ Outer loop instructions per iteration = 9 X (i)* #iterations: 200= (b) 1800 ] * Note: if there is only one loop, i = 0 and (b) = 0 in the calculation of (d) below. Inner loop ( or only loop) instructions per iteration = 21 X #iterations: 100= (c) 2100 Total # instructions per function call = ( [ (i) * ] X (c) ) + (b) = (d)421800 # function calls (see C program main function) = (e) 13500 Total # instructions executed by program = (d) X (e) = 5694300000 (copy to Function Summary Report) After Optimization One-time executions per function call = (a) 15 (for reference only. Not used in calculations) [Outer loop instructions per iteration = 9 X (i) *#iterations: 200 = (b) 1800 ] * Note: if there is only one loop, i = 0 and (b) = 0 in the calculation of (d) below. Inner loop (or only loop) instructions per iteration = 20 X #iterations: 100= (c) 2000 Total # instructions per function call = ( [ (i) *] X (c) ) + (b) = (d) 401800 # function calls (see C program main function) = (e)13500 Total # instructions executed by program = (d) X (e) = 5424300000 (copy to Function Summary Report)

Function Summary Report Function:

Prepared by: Before Optimization C code : #include int arr[200][100];

After Optimization C Code : #include int arr[200][100];

void as6(int *a,int rows,int cols){ int i,j; for ( i = 0; i < rows;i++){ for (j=0;j...


Similar Free PDFs