Question

In: Computer Science

Two computers have 7-stage fetch-execute cycles where branches are determined in stage 4. One computer is...

Two computers have 7-stage fetch-execute cycles where branches are determined in stage 4. One computer is not pipelined, and the other is pipelined. Assuming that tp = 1, answer the following questions when running a program with 50,000 instructions where 1,000 of the instructions are conditional branches and each branch, if taken, skips over 10 instructions.a.How much faster is the pipelined machine over the non-pipelined machine assuming that no branches are taken.b.How much faster is the pipelined machine over the non-pipelined machine assuming that all branches are taken.c.Bonus question: How many branches would the program have to have assuming every branch is taken (and every branch skips over 10 instructions) for the non-pipelined machine to execute the program in the same time as the pipelined machine?

Solutions

Expert Solution

Given there are 7 stages, k =7

Branches are determined in stage 4.

One computer is pipelined and other is non-pipelined.

Given Cycle time, tp = 1

Number of instructions in the program, n = 50000

Number of conditional branches =1000, if taken skips over 10 instructions.

a) speed up of pipelined over non-pipelined (no branches taken):

Time taken on pipelined processor = (k+n-1)tp = (7+50000-1)*1 = 50006

Time taken on non-pipelined processor = n*k*tp = 50000*7*1 = 350000

speed up of pipelined over non-pipelined = Execution time on non-pipelined / execution time on pipelined processor = 350000 / 50006 = 6.99

b) speed up of pipelined processor over non-pipelined if all branches taken:

Time taken on non-pipelined:

k and tp do not change.

But whenever condition branch instruction occurs and is taken then 10 instructions are skipped.hence n = 50000 - 1000 * 10 = 40000

Time taken on non-pipelined processor = 40000 * 7 * 1 = 280000

Time taken on pipelined:

k do not change.

But tp of conditional branches will have a delay as branch are determined at stage 4. so, Each branch instruction will have a delay of 3 cycles.

and n = 50000 - 1000*10 = 40000

Time taken on pipelined processor = (7+40000-1)*1 + 1000 * 3 (For the conditional branche 3 additional cycles needed) = 43006

Speed up of pipelined over non-pipelined = 280000 / 43006 = 6.51

c) Number of branch instructions needed to make performance of both processor equal:

Let there are b branch instructions.

Then time taken on non-pipelined processor = (50000 - b*10) * 7 * 1= 350000 - 70b

Time taken on pipelined processor = (7+(50000 - b*10))+b*3 = 50007 - 7b

Lets equate both to get b value:

350000 - 70b = 50007 - 7b

70b-7b = 350000 - 50007

63b = 299993

b = 4761.7 = 4762 (Approx.)

Hence if there are 4762 branch instructions then both processor will have equal performance.


Related Solutions

7. Design stage is Kellogg’s term for 3-4-year-olds’ drawings that: A. Consist of two or more...
7. Design stage is Kellogg’s term for 3-4-year-olds’ drawings that: A. Consist of two or more basic scribbles. B. Combine two basic shapes into more complex patterns. C. Combine complex designs to form basic shapes and scribbles. D. Consist of simple pictorial designs recognizable by adult. 27. Young children use language to plan, guide, and monitor their behavior. This use of language for self-regulation is called_________ speech. A. Inner B. Private C. Inherent D. Cognitive 32. Autism can usually be...
In Visual Basics 6.Two String returning functions to have nice looking output for numbers/money are? 7.Where...
In Visual Basics 6.Two String returning functions to have nice looking output for numbers/money are? 7.Where do we place a class-level variable declaration, and where is it accessible from? 8.Two forms of parameter passing: 9.FULLY define an array: 10.Show the VB code to declare an initialize an array called Ar1 of Integers to hold the value of 5, 10 and 15. 11. For Ar1above, Ar1.Count = ________ and legal index values are:_____ to ______. 12.Show the VB code to declare...
At the end of two consecutive investments you have $18,510.10. Investment one was 4% (SA) for...
At the end of two consecutive investments you have $18,510.10. Investment one was 4% (SA) for 30 months Investment two was 9% (Q) for 15 months What was the original amount deposited? Round to the nearest WHOLE dollar, NO dollar ($) signs, Use commas (,) when and where needed
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT