BookRags.com Literature Guides Literature
Guides
Criticism & Essays Criticism &
Essays
Questions & Answers Questions &
Answers
Lesson Plans Lesson
Plans
My Bibliography Periodic Table U.S. Presidents Shakespeare Sonnet Shake-Up
Research Anything:        
History | Encyclopedias | Films | News | Create a Bibliography | More... Login | Register | Help
Not What You Meant?  There are 21 definitions for CPI.

Cycles Per Instruction

Print-Friendly
About 1 pages (376 words)

Bookmark and Share Questions on this topic? Just ask!

In computer architecture, Cycles per instruction (clock cycles per instruction or clocks per instruction or CPI) is a term used to describe one aspect of a processor's performance: the number of clock cycles that happen when an instruction is being executed. It is the multiplicative inverse of Instructions Per Cycle.


Let us assume a Classic RISC pipeline, with the following 5 stages:

1) Instruction fetch cycle (IF)
2) Instruction decode cycle (ID)
3) Execution cycle (EX)
4) Memory access (MEM)
5) Write-back cycle (WB)

Each stage requires one clock cycle and an instruction passes through the stages sequentially. Without Pipelining, a new instruction is fetched in stage 1 only after the previous instruction finishes at stage 5. Therefore without pipelining the number of cycles it takes to execute an instruction is 5. This is the definition of CPI. With pipelining we can improve the CPI by exploiting Instruction level parallelism. For example, what if an instruction is fetched every cycle? We could theoretically have 5 instructions in the 5 stage pipeline at once (one instruction per stage). In this case, a different instruction would complete stage 5 in every clock cycle, and therefore on average we have one clock cycle per instruction (CPI = 1). With a single issue processor, the best CPI attainable is 1. However with multiple issue processors, we may achieve even better CPI values. For example a processor that issues two instruction per clock clock (see Superscalar processors) can achieve a CPI of 0.5 when two instructions are completing every clock cycle.

Calculation

For the multi-cycle MIPS, there are 5 types of instructions:

  • Load (5 cycles)
  • Store (4 cycles)
  • R-type (4 cycles)
  • Branch (3 cycles)
  • Jump (3 cycles)

If a program has

  • 50% R-type instructions
  • 10% Load instructions
  • 20% Store instructions
  • 8% Branch instructions
  • 2% Jump instructions

Then, the CPI is: CPI = (4 x 50 + 5 x 10 + 4 x 20 + 3 x 8 + 3 x 2) / 100 = 3.6

See also

External links

View More Summaries on Cycles Per Instruction
 
Ask any question on Cycles Per Instruction and get it answered FAST!
Answer questions in BookRags Q&A and earn points toward
discounted or even FREE Study Guides and other BookRags products!
Learn more about BookRags Q&A
Copyrights
Cycles Per Instruction from Wíkipedia. ©2006 by Wíkipedia. Licensed under the GNU Free Documentation License. View a list of authors or edit this article.

Article Navigation
Join BookRagslearn moreJoin BookRags




About BookRags | Customer Service | Report an Error | Terms of Use | Privacy Policy