Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CSE 560 – Practice Problem Set 1 Solutions

1.    Of the three factors in the fundamental performance equation:

Execution Time =

instructions program

 

x

seconds

 

x

cycles

instruction

cycle

Which is most influenced by:

(a)  The technology

seconds/cycle

(b)  The compiler

instructions/program

(c)  The computer architect

cycles/instruction

2.   When running an integer benchmark on a RISC machine, the average instruction mix was as

follows:

Instructions

Average Frequency

Load

26%

Store

9%

Arithmetic

14%

Compare

13%

Conditional Branch

16%

Unconditional Branch

1%

Call/Return

2%

Shift

4%

Logical

9%

Misc.

6%

The following measurements of average CPI (cycles per instruction) for individual instruction categories were made:

Instruction type

Average CPI (clock cycles)

All ALU instructions

1.0

Load-store

1.4

Conditional branches:

 

Taken

2.0

Not Taken

1.5

Jumps

1.2

Assume that 60% of the conditional branches are taken and that all instructions in the Misc. category are ALU instructions. What is the CPI of the benchmark on this RISC machine?

We are given the Average CPI for different instruction types in the second table.  To solve for the CPI of the Integer benchmark, we can use a weighted average.  We therefore must determine     the weights.  The weights will be the percentage of each instruction type executed in the              benchmark.

First we have to add up the instructions in the first table into the instruction types (i.e., categories) in the second table:

All ALU instructions = Arithmetic + Compare + Shift + Logical + Misc. = 14 + 13 + 4 + 9 + 6 = 46% Load-store = Load + Store = 26 + 9 = 35%

Taken Conditional branches = 60% of 16% = (.6)(16) = 9.6%

Not Taken Conditional branches = 40% of 16% = (.4)(16) = 6.4%

Jumps = Unconditional branches + Call/Return = 1 + 2 = 3%

Note: the above puts the Call/Return instructions in the Jump type, under the assumption that the return address is stored in a register.  If the Call/Return instructions reference memory, it  might be more appropriate to include them in the Load-store type.

Once we have the fraction of each instruction type, we use that to form a weighted average of CPI:

Avg. CPI = (.46)(1.0) + (.35)(1.4) + (.096)(2.0) + (.064)(1.5) + (.03)(1.2) = 1.274