Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A designer has to optimize the performance of a compiler on a given machine. The hardware designers provide the following documentation: Instruction class CPI for

A designer has to optimize the performance of a compiler on a given machine. The hardware

designers provide the following documentation:

Instruction class CPI for this class of instruction

A 10

B 12

C 15

D 30

The compiler designer has to decide between two different code sequences for a certain high

level statement. The table below gives the number of times each instruction class is used in each

code sequence:

Code sequence Instruction counts for instruction class

A B C D

Code 1 5 6 6 2

Code 2 6 8 8 1

(a) Find out the total numbers of clock cycles used for each code sequence. (5 points)

(b) Find out the average CPI for each code sequence. (5 points)

(c) Find out the execution time considering that the CPU is a 400 MHz machine. (Assume all the

CPU time is dedicated to executing these instructions) Which code will give better

performance? (10 points)

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

What is the preferred personality?

Answered: 1 week ago

Question

What is the relationship between humans?

Answered: 1 week ago