1 / 17

# Computer Organization - PowerPoint PPT Presentation

Computer Organization. Lab 1 Soufiane berouel. Formulas to Remember. CPU Time = CPU Clock Cycles x Clock Cycle Time CPU Clock Cycles = Instruction Count x Cycles per Instruction Clock Cycle Time = 1 / Clock Cycle Rate Amdahl’s Law

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' Computer Organization' - gefjun

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

### Computer Organization

Lab 1

Soufiane berouel

• CPU Time = CPU ClockCycles x ClockCycle Time

• CPU Clock Cycles = Instruction Count x Cycles per Instruction

• Clock Cycle Time = 1 / Clock Cycle Rate

• Amdahl’s Law

• Overall Speedup= 1 / [(1 – ∑ FEi) + ∑ (FEi/ SEi)]

• FE is the proportion affected, SE is the speed up for the specific proportion

• For a color display using 8 bits for each primary color (R, G, B) per pixel and with a resolution of 1280 x 800 pixels, what should be the size (in bytes) of the frame buffer to store a frame?

• Each frame requires 1280 x 800 x 3 = 3072000 ~ 3 Mbytes

• Consider 3 processors P1, P2 and P3 with clock rates and CPI given below, are running the same program:

clock rate CPI

P1 2 GHz 1.5

P2 1.5 GHz 1.0

P3 3 GHz 2.5

• Which processor will have the best performance?

• Suppose the program has N instructions.

• Time taken to execute on P1 is = 1.5 N / (2 x 109) = 0.75 N x 10-9

• Time taken to execute on P2 is = N/ (1.5 x 109) = 0.66 N x 10-9

• Time taken to execute on P3 is = 2.5 N/ (3 x 109) = 0.83 N x 10-9

• P2 has the best performance (since it takes the least time to execute).

• Consider 3 processors P1, P2 and P3 with same instruction set with clock rates and CPI given below:

clock rate CPI

P1 2 GHz 1.5

P2 1.5 GHz 1.0

P3 3 GHz 2.5

• If the processors each execute a program in 10 seconds, find the number of cycles and the number of instructions.

• For P1

• 10 (execution time) = 1.5 (CPI) x N1/ (2 x 109)

• So N1 (number of instructions) = 1.33 x 1010

• Number of Cycles = 1.5 x N1 = 2 x 1010

• …Do the same for P2 and P3

• Given below are the number of instructions of a program:

500 50 100 50

• Assuming the instructions take 1, 5, 5 and 2 cycles, what is the execution time in a 2 GHz processor?

• Execution time = cycle time x CPI x no. of inst

• Cycle time = 1/(2 x 109)

• CPI = (500 x 1 + 50 x 5 + 100 x 5 + 50 x 2) / (500 + 50 + 100 + 50)

• Thus, Execution Time = 1350 / 700 x 700 / (2 x 10-9)

• So the Execution time = 675 x 10-9 sec

• Compilers have a profound impact on the performance of an application on a given processor. This problem will explore the impact compilers have on execution time:

compiler A compiler B

no instructions exec. Time no. instructions exec. Time

a) 1.0 x 109 1 s 1.2 x 109 1.4 s

b) 1.4 x 109 0.8 s 1.2 x 109 0.7 s

• Find the average CPI for programs a and b, on different compilers, given that the processor has a cycle time of 1 ns.

• Execution Time = CPI x cycle time x no. of inst

• cycle time = 1ns = 10-9 s

• For program a on Compiler A

• CPI = 1 / (10-9 x 109 ) = 1

• For program a on Compiler B

• CPI = 1.4 / (10-9 x 1.2 x 109 ) = 1.667

• Do the same for program b…

• Three enhancements with the following speedups are proposed for a new architecture:

Speedup1 = 30

Speedup2 = 20

Speedup3 = 10

• Only one enhancement is usable at a time.

a. If enhancements 1 and 2 are each usable for 30% of the time, what fraction of the time must enhancement 3 be used to achieve an overall speedup of 10?

• By applying Amdahl’s Law to three enhancements we find

Overall Speedup= 1 / [(1 – ∑ FEi) + ∑ (FEi/ SEi)]

= 1 / [1 – (FE1 + FE2 + FE3) + ((FE1/SE1) + (FE2/SE2) + (FE3/SE3))]

• By replacing every known variable by its value in the equation, we get:

10 = 1 / [1 – (0.3 + 0.3 + FE3) + ((0.3/30) + (0.3/20) + (FE3/10))]

• Solving for FE3 we get

1 = 10 x (1 - 0.3 - 0.3 + 0.3/30 + 0.3/20 - FE3 + FE3/10) = 4.25 – 9FE3

• Which means FE3 = 3.25 / 9 = 0.361111…

• Thus, Enhancement 3 must be used around 36% of the time.

b. Assume for some benchmark, the fraction of use is 15% for each of enhancements 1 and 2 and 70% for enhancement 3. We want to maximize performance. If only one enhancement can be implemented, which should it be? If two enhancements can be implemented, which should be chosen?

• When we can choose between enhancements, we pick the one or combination that offers the highest speedup. Following that logic, and if we can pick only one enhancement,

SpeedupE1= 1 / [(1 – FE1) + (FE1/SE1)] = 1 / [(1 – 0.15) + (0.15/30))] = 1.169

SpeedupE2= 1 / [(1 – FE2) + (FE2/SE2)] = 1 / [(1 – 0.15) + (0.15/20))] = 1.166

SpeedupE3= 1 / [(1 – FE3) + (FE3/SE3)] = 1 / [(1 – 0.70) + (0.70/10))] = 2.703

• Since the Speedup provided by enhancement 3 is the highest, we choose it.

• But if two enhancements can be implemented, we will need to find the best combination which means finding the speedup for all combinations and comparing them

SpeedupE1 and E2 = 1 / [(1 – FE1 – FE2) + (FE1/SE1 + FE2/SE2)]

= 1 / [(1 – 0.15 – 0.15) + (0.15/30 + 0.15/20))] = 1.403

SpeedupE1 and E3 = 1 / [(1 – FE1 – FE3) + (FE1/SE1 + FE3/SE3)]

= 1 / [(1 – 0.15 – 0.70) + (0.15/30 + 0.70/10))] = 4.444

SpeedupE2 and E3 = 1 / [(1 – FE2 – FE3) + (FE2/SE2 + FE3/SE3)]

= 1 / [(1 – 0.15 – 0.70) + (0.15/20 + 0.70/10))] = 4.396

• Since the Speedup provided by the combination of enhancements 1 and 3 is the highest, we choose them.