1 / 11

Instruction Flow

Instruction Flow. CDA 3101 Discussion Session. Problem1. Show the path of the following program through the MIPS subset showing major functional units 68 loop : ADD $r1, $r2, $r3 72 LD $r1, 0($r2) 76 SW $r3, 8($r1) 80 BNZ $r3 loop Let initial values are $r1 = 0

gemma-lyons
Download Presentation

Instruction Flow

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Instruction Flow CDA 3101 Discussion Session

  2. Problem1 Show the path of the following program through the MIPS subsetshowing major functionalunits 68 loop: ADD $r1, $r2, $r3 72 LD $r1, 0($r2) 76 SW $r3, 8($r1) 80 BNZ $r3 loop Let initial values are $r1 = 0 $r2 = 128 $r3 = 132 2

  3. Problem1 68 loop: ADD $r1, $r2, $r3 72 LD $r1, 0($r2) 76 SW $r3, 8($r1) 80 BNZ $r3 loop 72 260 68 68 $r1 128 ADD $r1, $r2, $r3 132 $r2 $r3 3

  4. Problem1 68 loop: ADD $r1, $r2, $r3 72 LD $r1, 0($r2) 76 SW $r3, 8($r1) 80 BNZ $r3 loop 76 23 72 72 $r1 LD $r1, 0($r2) 128 $r2 0 4 M[128] = 23

  5. Problem1 68 loop: ADD $r1, $r2, $r3 72 LD $r1, 0($r2) 76 SW $r3, 8($r1) 80 BNZ $r3 loop 80 76 76 $r3 SW $r3, 8($r1) 31 $r1 132 8 5

  6. Problem1 68 loop: ADD $r1, $r2, $r3 72 LD $r1, 0($r2) 76 SW $r3, 8($r1) 80 BNZ $r3 loop 68 80 80 $r3 BNZ $r3 loop 6

  7. Problem2 Suppose we have two implementations of the same ISA. Computer A has clock cycle time of 200ps and a CPI of 1.5, while for computer B the corresponding values are 150ps and 2.5 respectively. Which of the two machines is faster and by how much? 7

  8. Problem2 Let the number of instructions be I for the program. CPUA = I X 200 X 1.5 = 300 X I CPUB = I X 150 X 2.5 = 375 X I Therefore, A is faster Speedup = 375/300 = 1.25 8

  9. Problem3 • The FPU of an unit performs 40% of the total computation, and it is being accelerated to twice the performance • What is the eventual speedup? • Amdahl’s Law 9

  10. Problem3 Fraction Accelerated = 0.4 Improvement = 2 Speedup = 1/{(1-0.4)+0.4/2} = 1/0.8 = 1.25 10

  11. Problem3 cont. • The FPU of an unit performs 40% of the total computation, and it is being accelerated to twice the performance; • The ALU performs 40% of the total computation and is being accelerated by three times; • What is the eventual speedup? • Speedup = 1/{(1-0.4-0.4)+0.4/2+0.4/3} 11

More Related