Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing all instances of multiplying a value x by

image text in transcribed

Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing all instances of multiplying a value x by 2 (multx.r,2) with a single add instruction (add xx.r) and by replacing all instances of multiplying by 4 (mult x.x,4) with a single shift instruction (s11 xx,2). The optimized program P' runs in 8.6 seconds on the same machine. If the CPI of mult is 4, and the CPI of each add and s11 is 2, how many multiplies (total- both multiplies by 2 and multiplies by 4) were replaced by the optimization? 1. Consider program P running on a 1-GHz machine M in 10 seconds. Someone optimizes P by replacing all instances of multiplying a value x by 2 (multx.r,2) with a single add instruction (add xx.r) and by replacing all instances of multiplying by 4 (mult x.x,4) with a single shift instruction (s11 xx,2). The optimized program P' runs in 8.6 seconds on the same machine. If the CPI of mult is 4, and the CPI of each add and s11 is 2, how many multiplies (total- both multiplies by 2 and multiplies by 4) were replaced by the optimization? 1

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What would it take to treat yourself like your best client?

Answered: 1 week ago

Question

IM LOOKING FOR AN EXPERT - VERIFIED TO ANSWER THIS QUESTION

Answered: 1 week ago