Warning: foreach() argument must be of type array|object, bool given in /var/www/html/web/app/themes/studypress-core-theme/template-parts/header/mobile-offcanvas.php on line 20

Assume that for a given program 70% of the executed instructions are arithmetic, 10% are load/store, and 20% are branch.

2.47.1 [5] <§2.19> Given this instruction mix and the assumption that an

arithmetic instruction requires 2 cycles, a load/store instruction takes 6 cycles, and a branch instruction takes 3 cycles, find the average CPI.

2.47.2 [5] <§2.19> For a 25% improvement in performance, how many cycles, on average, may an arithmetic instruction take if load/store and branch instructions are not improved at all?

2.47.3 [5] <§2.19> For a 50% improvement in performance, how many cycles, on average, may an arithmetic instruction take if load/store and branch instructions are not improved at all?

Short Answer

Expert verified

2.47.1

The average cycle per instruction is 2.6.

2.47.2

There are 1.95 cycles on average.

2.47.3

There are 1.3 cycles on average.

Step by step solution

01

Define the concept.

2.47.1

TheaverageCPI=[(Numberofrequiredcycleforthearitmeticinstruction×thepercentageoftheexecutedarithmeticinstructions)+(Numberofrequiredcycleforloadorstoreinstruction×thepercentageoftheexecutedloadorstoreinstructions)+(Numberofrequiredcycleforthebranchinstruction×thepercentageoftheexecutedbranchinstructions)]

2.47.2

TheaverageCPI=CPIprevious×(100-thepercentageofimprovementinperformance100)

2.47.3

TheaverageCPI=CPIprevious×(100-thepercentageofimprovementinperformance100)

02

Determine the calculation.

2.47.1

Given, the percentage of the executed arithmetic instructions is 70%,10% for the load or store, and 20% for the branch.

Also given that,

2 cycles are required for the arithmetic instruction.

6 cycles are required for the load/store instruction.

And 3 cycles are required for the branch instruction.

HencetheaverageCPI=(2×0.7)+(6×0.1)+(3×0.2)=1.4+0.6+0.6=2.6

2.47.2

Given that the percentage of improvement in performance is 25%.

The previous average CPI is 2.6.

So, the average CPI = 2.6 x 0.75 = 1.95

Hence, there are 1.95 cycles on average.

2.47.3

Given that the percentage of improvement in performance is 50%.

The previous average CPI is 2.6.

So, the average CPI = 2.6 x 0.50 = 1.3

Hence, there are 1.3 cycles on average

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with Vaia!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Translate function f into MIPS assembly language. If you need to use registers \(t0 through \)t7, use the lower-numbered registers first. Assume the function declaration for func is “int f(int a, int b);”. The code for function f is as follows:

int f(int a, int b, int c, int d)

returnfunc(funca,b,c+d);

If the current value of the PC is 0x00000600, can you use a single jump instruction to get to the PC address as shown in Exercise 2.39?

Question: The table below shows 32-bit values of an array stored in memory.

2.6.1 For the memory locations in the table above, write C code to sort the data from lowest to highest, placing the lowest value in the smallest memory location shown in the figure. Assume that the data shown represents the C variable called Array, which is an array of type int, and that the first number in the array shown is the first element in the array. Assume that this particular machine is a byte-addressable machine and a word consists of four bytes.

2.6.2 For the memory locations in the table above, write MIPS code to sort the data from lowest to highest, placing the lowest value in the smallest memory location. Use a minimum number of MIPS instructions. Assume the base address of Array is stored in register $s6.

For the following C statement, write a minimal sequence of MIPS assembly instructions that does the identical operation. Assume \(t1=A, \)t2=B and $s1 is the base address of C.

A=C04;

Question: Right before your function f from Exercise 2.34 returns, what do we know about contents of registers \(t5, \)s3, \(ra, and \)sp? Keep in mind that we know what the entire function f looks like, but for function func, we only know its declaration.

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.

Sign-up for free