<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=72.68.105.254</id>
	<title>formulasearchengine - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=72.68.105.254"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/wiki/Special:Contributions/72.68.105.254"/>
	<updated>2026-07-22T04:09:37Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Square_degree&amp;diff=10764</id>
		<title>Square degree</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Square_degree&amp;diff=10764"/>
		<updated>2014-01-20T03:58:51Z</updated>

		<summary type="html">&lt;p&gt;72.68.105.254: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Refimprove|date=December 2009}}&lt;br /&gt;
In [[computer architecture]], &#039;&#039;&#039;cycles per instruction&#039;&#039;&#039; (aka &#039;&#039;&#039;clock cycles per instruction&#039;&#039;&#039;, &#039;&#039;&#039;clocks per instruction&#039;&#039;&#039;, or &#039;&#039;&#039;CPI&#039;&#039;&#039;) is one aspect of a [[central processing unit|processor&#039;s]] performance: the average number of [[clock cycle]]s per [[Instruction (computer science)|instruction]] for a program or program fragment.&amp;lt;ref&amp;gt;{{cite book |title=Computer Organization and Design: The Hardware/Software Interface|first=David A.|last1=Patterson|first2=John L.|last2=Hennessy|}}&amp;lt;/ref&amp;gt;  It is the [[multiplicative inverse]] of [[instructions per cycle]].&lt;br /&gt;
&lt;br /&gt;
==Definition==&lt;br /&gt;
&lt;br /&gt;
Cycles Per Instruction is defined by the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
CPI = \frac{\Sigma (IIC)(CCI) }{IC}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;&#039;IIC&#039;&#039;&#039; is the number of instructions for a given instruction type, &#039;&#039;&#039;CCI&#039;&#039;&#039; is the clock-cycles for a given instruction type, &#039;&#039;&#039;IC&#039;&#039;&#039; is the total instruction count. The summation sums over all instruction types for a given benchmarking process.&lt;br /&gt;
&lt;br /&gt;
==Explanation==&lt;br /&gt;
Let us assume a [[classic RISC pipeline]], with the following 5 stages:&lt;br /&gt;
&lt;br /&gt;
# Instruction fetch cycle (IF)&lt;br /&gt;
# Instruction decode/Register fetch cycle (ID)&lt;br /&gt;
# Execution/Effective address cycle (EX)&lt;br /&gt;
# Memory access (MEM)&lt;br /&gt;
# Write-back cycle (WB)&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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).&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
For the multi-cycle [[MIPS architecture|MIPS]], there are 5 types of instructions:&lt;br /&gt;
&lt;br /&gt;
* Load (5 cycles)&lt;br /&gt;
* Store (4 cycles)&lt;br /&gt;
* [[MIPS architecture#MIPS assembly language|R-type]] (4 cycles)&lt;br /&gt;
* [[MIPS architecture#MIPS assembly language|Branch]] (3 cycles)&lt;br /&gt;
* [[MIPS architecture#MIPS assembly language|Jump]] (3 cycles)&lt;br /&gt;
&lt;br /&gt;
If a program has:&lt;br /&gt;
&lt;br /&gt;
* 50% R-type instructions&lt;br /&gt;
* 15% load instructions&lt;br /&gt;
* 25% store instructions&lt;br /&gt;
* 8% branch instructions&lt;br /&gt;
* 2% jump instructions&lt;br /&gt;
&lt;br /&gt;
then, the CPI is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{CPI} = \frac{4 \times 50 + 5 \times 15 + 4 \times 25 + 3 \times 8 + 3 \times 2}{100} = 4.05&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Example 2===&lt;br /&gt;
&amp;lt;ref&amp;gt;Advanced Computer Architecture by Kai Hwang, Chapter 1, Exercise Problem 1.1&amp;lt;/ref&amp;gt; A 400-[[MHz]] processor was used to execute a [[benchmark program]] with the following [[instruction mix]] and [[clock cycle]] count:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Instruction type&lt;br /&gt;
! Instruction count &lt;br /&gt;
! Clock cycle count&lt;br /&gt;
     &lt;br /&gt;
|-&lt;br /&gt;
| Integer arithmetic            &lt;br /&gt;
| 45000   &lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| Data transfer  &lt;br /&gt;
| 32000&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| Floating point            &lt;br /&gt;
| 15000&lt;br /&gt;
| 2&lt;br /&gt;
|- &lt;br /&gt;
| Control transfer&lt;br /&gt;
| 8000                   &lt;br /&gt;
| 2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Determine the effective CPI, [[Instructions per second#Million instructions per second|MIPS]] rate, and execution time for this program.&lt;br /&gt;
&lt;br /&gt;
: Total instruction count = 100000&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\text{CPI} = \frac{45000 \times 1 + 32000 \times 2 + 15000 \times 2 + 8000 \times 2}{100000} = \frac{155000}{100000} = 1.55&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\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}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Therefore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;&lt;br /&gt;
\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}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[MIPS]] &lt;br /&gt;
* [[Instructions per cycle]] (IPC)&lt;br /&gt;
* [[Instructions per second]] (IPS)&lt;br /&gt;
* [[Cycle per second]] ([[Hertz|Hz]])&lt;br /&gt;
* [[Megahertz myth]]&lt;br /&gt;
* The [[Benchmark (computing)|benchmark]] article provides a useful introduction to computer performance measurement for those readers interested in the topic.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Cycles Per Instruction}}&lt;br /&gt;
[[Category:Instruction processing]]&lt;br /&gt;
[[Category:Clock signal]]&lt;/div&gt;</summary>
		<author><name>72.68.105.254</name></author>
	</entry>
</feed>