Square degree: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
No edit summary
en>Teemu Leisti
added a "See also" section, with a reference to article Steradian
 
Line 1: Line 1:
{{Refimprove|date=December 2009}}
The writer's title is Andera and she believes it sounds quite great. Some time in the past she chose to reside in Alaska and her parents reside nearby. Credit authorising is how she tends to make a living. Doing ballet is something she would by no means give up.<br><br>Also visit my page :: best psychic readings ([http://appin.co.kr/board_Zqtv22/688025 appin.co.kr])
In [[computer architecture]], '''cycles per instruction''' (aka '''clock cycles per instruction''', '''clocks per instruction''', or '''CPI''') is one aspect of a [[central processing unit|processor's]] performance: the average number of [[clock cycle]]s per [[Instruction (computer science)|instruction]] for a program or program fragment.<ref>{{cite book |title=Computer Organization and Design: The Hardware/Software Interface|first=David A.|last1=Patterson|first2=John L.|last2=Hennessy|}}</ref>  It is the [[multiplicative inverse]] of [[instructions per cycle]].
 
==Definition==
 
Cycles Per Instruction is defined by the following:
 
<math>
CPI = \frac{\Sigma (IIC)(CCI) }{IC}
</math>
 
Where '''IIC''' is the number of instructions for a given instruction type, '''CCI''' is the clock-cycles for a given instruction type, '''IC''' is the total instruction count. The summation sums over all instruction types for a given benchmarking process.
 
==Explanation==
Let us assume a [[classic RISC pipeline]], with the following 5 stages:
 
# Instruction fetch cycle (IF)
# Instruction decode/Register fetch cycle (ID)
# Execution/Effective address cycle (EX)
# Memory access (MEM)
# 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 pipeline stages 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]]) can achieve a CPI of 0.5 when two instructions are completing every clock cycle.
 
==Examples==
 
=== Example 1 ===
 
For the multi-cycle [[MIPS architecture|MIPS]], there are 5 types of instructions:
 
* Load (5 cycles)
* Store (4 cycles)
* [[MIPS architecture#MIPS assembly language|R-type]] (4 cycles)
* [[MIPS architecture#MIPS assembly language|Branch]] (3 cycles)
* [[MIPS architecture#MIPS assembly language|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:
 
<math>
\text{CPI} = \frac{4 \times 50 + 5 \times 15 + 4 \times 25 + 3 \times 8 + 3 \times 2}{100} = 4.05
</math>
 
===Example 2===
<ref>Advanced Computer Architecture by Kai Hwang, Chapter 1, Exercise Problem 1.1</ref> A 400-[[MHz]] processor was used to execute a [[benchmark program]] with the following [[instruction mix]] and [[clock cycle]] count:
 
{| class="wikitable"
|-
! 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, [[Instructions per second#Million instructions per second|MIPS]] rate, and execution time for this program.
 
: Total instruction count = 100000
 
<math>
\text{CPI} = \frac{45000 \times 1 + 32000 \times 2 + 15000 \times 2 + 8000 \times 2}{100000} = \frac{155000}{100000} = 1.55
</math>
 
<math>
\text{Effective processor performance} = \text{MIPS} = \frac{\text{clock frequency}}{\text{CPI} \times 1000000} = \frac{400 \times 1000000}{1.55 \times 1000000} = 258 \, \text{MIPS}
</math>
 
Therefore:
 
<math>
\text{Execution time}(T) = \text{CPI} \times \text{Instruction count} \times \text{clock time} = \frac{\text{CPI} \times \text{Instruction count}}{\text{frequency}} = \frac{1.55 \times 100000}{400 \times 1000000} = \frac{1.55}{4000} = 0.387 \, \text{ms}
</math>
 
==See also==
*[[MIPS]]
* [[Instructions per cycle]] (IPC)
* [[Instructions per second]] (IPS)
* [[Cycle per second]] ([[Hertz|Hz]])
* [[Megahertz myth]]
* The [[Benchmark (computing)|benchmark]] article provides a useful introduction to computer performance measurement for those readers interested in the topic.
 
==References==
{{Reflist}}
 
{{DEFAULTSORT:Cycles Per Instruction}}
[[Category:Instruction processing]]
[[Category:Clock signal]]

Latest revision as of 23:26, 8 June 2014

The writer's title is Andera and she believes it sounds quite great. Some time in the past she chose to reside in Alaska and her parents reside nearby. Credit authorising is how she tends to make a living. Doing ballet is something she would by no means give up.

Also visit my page :: best psychic readings (appin.co.kr)