Cycles Per Instruction

Cycles Per Instruction

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.

Explanation

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 instructions per clock cycle (see Superscalar processors) can achieve a CPI of 0.5 when two instructions are completing every clock cycle.

Calculations

Multi-cycle Example

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
* 15% Load instructions
* 25% Store instructions
* 8% Branch instructions
* 2% Jump instructions

Then, the CPI is:CPI = (4 x 50 + 5 x 15 + 4 x 25 + 3 x 8 + 3 x 2) / 100 = 4.05

Example

40-MHz processor was used to execute a benchmark program with the following instruction mix and clock cycle count:

Determine the effective CPI, MIPS rate, and execution time for this program.

total instruction count = 100000

CPI = (45000*1 + 32000*2 + 15000*2 + 8000*2)/100000 = 1550000/100000 = 1.55

MIPS = clock frequency/(CPI*1000000) = (40*1000000)/(1.55*1000000) = 25.8

Execution time (T) = CPI*Instruction count*clock time = CPI*Instruction count/frequency = 1.55*100000/40000000 = 1.55/400 = 3.87 ms Ans.

ee also

* Instructions Per Cycle


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Cycles per instruction — In computer architecture, cycles per instruction (aka clock cycles per instruction, 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… …   Wikipedia

  • Instruction level parallelism — (ILP) is a measure of how many of the operations in a computer program can be performed simultaneously. Consider the following program: 1. e = a + b 2. f = c + d 3. g = e * fOperation 3 depends on the results of operations 1 and 2, so it cannot… …   Wikipedia

  • Instructions Per Cycle — In computer architecture, Instructions Per Clock (Instruction Per Cycle or IPC) is a term used to describe one aspect of a processor s performance: the average number of instructions executed for each clock cycle. It is the multiplicative inverse …   Wikipedia

  • Instructions per cycle — Die Maßeinheit Instructions per Cycle (IPC) bezeichnet die Anzahl der von einem Prozessor in einem Taktzyklus ausführbaren Befehle. Es handelt sich in der Regel um einen Mittelwert, da die Anzahl der ausgeführten Befehle pro Taktzyklus bei den… …   Deutsch Wikipedia

  • Instructions per second — (IPS) is a measure of a computer s processor speed. Many reported IPS values have represented peak execution rates on artificial instruction sequences with few branches, whereas realistic workloads typically lead to significantly lower IPS values …   Wikipedia

  • Complex instruction set computing — A complex instruction set computer (CISC) (  /ˈsɪs …   Wikipedia

  • Reduced instruction set computer — The acronym RISC (pronounced risk ), for reduced instruction set computing, represents a CPU design strategy emphasizing the insight that simplified instructions which do less may still provide for higher performance if this simplicity can be… …   Wikipedia

  • Tandem Computers — A Tandem Computers promotional mug Tandem Computers, Inc. was the dominant manufacturer of fault tolerant computer systems for ATM networks, banks, stock exchanges, telephone switching centers, and other similar commercial transaction processing… …   Wikipedia

  • Branch predictor — In computer architecture, a branch predictor is the part of a processor that determines whether a conditional branch in the instruction flow of a program is likely to be taken or not. This is called branch prediction. Branch predictors are… …   Wikipedia

  • O/c — Surfréquençage Le Surfréquençage, ou Overclocking en anglais, également nommé surcadencement (puisqu on parle de machine cadencée à x, y GHz), a pour but d augmenter la fréquence de travail (mesurée en Hz) d un processeur. Cette opération n est… …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”