Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Definition  





2 Explanation  





3 Examples  



3.1  Example 1  





3.2  Example 2  







4 See also  





5 References  














Cycles per instruction






Català
Español
Italiano
Português

 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


Incomputer architecture, cycles per instruction (aka clock cycles per instruction, clocks per instruction, or CPI) is one aspect of a processor's performance: the average number of clock cycles per instruction for a program or program fragment.[1] It is the multiplicative inverseofinstructions per cycle.

Definition[edit]

The average of Cycles Per Instruction in a given process (CPI) is defined by the following weighted average:

Where is the number of instructions for a given instruction type , is the clock-cycles for that instruction type and is the total instruction count. The summation sums over all instruction types for a given benchmarking process.

Explanation[edit]

Let us assume a classic RISC pipeline, with the following five stages:

  1. Instruction fetch cycle (IF).
  2. Instruction decode/Register fetch cycle (ID).
  3. Execution/Effective address 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, in a multi-cycle processor, a new instruction is fetched in stage 1 only after the previous instruction finishes at stage 5, therefore the number of clock cycles it takes to execute an instruction is five (CPI = 5 >1). In this case, the processor is said to be subscalar. With pipelining, a new instruction is fetched every clock cycle by exploiting instruction-level parallelism, therefore, since one could theoretically have five instructions in the five pipeline stages at once (one instruction per stage), a different instruction would complete stage 5 in every clock cycle and on average the number of clock cycles it takes to execute an instruction is 1 (CPI = 1). In this case, the processor is said to be scalar.

With a single-execution-unit processor, the best CPI attainable is 1. However, with a multiple-execution-unit processor, one may achieve even better CPI values (CPI <1). In this case, the processor is said to be superscalar. To get better CPI values without pipelining, the number of execution units must be greater than the number of stages. For example, with six executions units, six new instructions are fetched in stage 1 only after the six previous instructions finish at stage 5, therefore on average the number of clock cycles it takes to execute an instruction is 5/6 (CPI = 5/6 <1). To get better CPI values with pipelining, there must be at least two execution units. For example, with two executions units, two new instructions are fetched every clock cycle by exploiting instruction-level parallelism, therefore two different instructions would complete stage 5 in every clock cycle and on average the number of clock cycles it takes to execute an instruction is 1/2 (CPI = 1/2 <1).

Examples[edit]

Example 1[edit]

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

If a program has:

then, the CPI is:

Example 2[edit]

[2] A 400MHz processor was used to execute a benchmark program with the following instruction mix and clock cycle count:

Instruction TYPE Instruction count Clock cycle count
Integer Arithmetic 45000 1
Data transfer 32000 2
Floating point 15000 2
Control transfer 8000 2

Determine the effective CPI, MIPS (Millions of instructions per second) rate, and execution time for this program.

since: and

Therefore:

See also[edit]

References[edit]

  1. ^ Patterson, David A.; Hennessy, John L. (1994). Computer Organization and Design: The Hardware/Software Interface. ISBN 9781558602816.
  • ^ Advanced Computer Architecture by Kai Hwang, Chapter 1, Exercise Problem 1.1

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Cycles_per_instruction&oldid=1182877292"

    Categories: 
    Instruction processing
    Clock signal
    Rates
    Computer performance
    Hidden categories: 
    Articles with short description
    Short description matches Wikidata
    Articles needing additional references from December 2009
    All articles needing additional references
     



    This page was last edited on 31 October 2023, at 23:05 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki