1 / 2

Quiz1 - Answer 1

Quiz1 - Answer 1. The CPI (Cycles Per Instruction) for the first program is the sum of the frequency of each instruction type multiplied by the instruction type: 0.17*7 + 0.63*4 + 0.10*12 + 0.10*3 = 5.21 For the second program the CPI is 1 as each and every instruction takes 1 cycle.

nailah
Télécharger la présentation

Quiz1 - Answer 1

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. Quiz1 - Answer 1 • The CPI (Cycles Per Instruction) for the first program is the sum of the frequency of each instruction type multiplied by the instruction type:0.17*7 + 0.63*4 + 0.10*12 + 0.10*3 = 5.21 • For the second program the CPI is 1 as each and every instruction takes 1 cycle. • The 1st instructions completes in 8ns, the 2nd in 10ns, the 3rd in 12ns, and the 4th in 14ns. So the speedup is:28ns/14ns = 2.0 • 1000 instructions complete in: 8ns + 999*2ns = 2006nsThe speedup is 7000ns/2006ns ~ 3.5 Quiz1 - Answer 2

  2. Quiz1 - Answer 3 • The instruction after beq can’t be fetched until the result of the comparison is known. It might be add or it might be subi. This is called a controlhazard. • A solution is to stall the pipeline (not fetch more instructions) until the branch is resolved. Another solution is to predict the branch is taken and fetch the subi instruction. If the prediction is wrong ... • The control line PCsrc, which controls which is the next instruction to fetch is dependent on: • The opcode of the instruction. • The value of the ALU zero line (if a branch is being performed) • The value of the Interrupt line. Quiz1 - Answer 4

More Related