Solutions To Computer Engineering Textbooks/Computer Organization and Design: The Hardware-Software Interface (5th Edition) (9780124077263)/Chapter 1

From Wikibooks, open books for an open world
Jump to navigation Jump to search


  1. Personal computer.
  2. Server.
  3. Supercomputer.
  4. Embedded computer.


Idea from other field Idea from computer architecture
a Performance via Pipelining
b Dependability via Redundancy
c Performance via Prediction
d Make the Common Case Fast
e Hierarchy of Memories
f Performance via Parallelism
g Design for Moore’s Law
h Use Abstraction to Simplify Design


  1. A special kind of program called a compiler reads the high-level source code and translates it into a program in assembly language.
  2. Another program called an assembler transforms the program in assembly language into a program in machine language, which is what a computer understands and can execute directly.

Some compilers "cut the middleman" and produce machine code directly.




Processor Instructions per second

Thus, processor 2 has the highest performance in instructions per second.


Processor Number of cycles Number of instructions


Let be the number of instructions executed, then a reduction in execution time of 30% can be expressed by the following formula.

Thus, . This represents a 71% increase in clock rate.


In order to find which implementation of the hypothetical Instruction Set Architecture is faster we need to find the execution time of the program under each processor. The execution time of the program can be calculated as follows:

Since we know the clock rates of each processor, we need to find out how many clock cycles it takes each processor to execute the program. This number is given by:

In the above formula, and are the CPI and instruction count, respectively, for each instruction class (A, B, C or D). From the problem description, we know that the program executes instructions of class A, instructions of class B, instructions of class C and instructions of class D.

Thus, for processor P1 we have:

And for processor P2 we have:

Hence, the execution times for each processor are:

Therefore, processor P2 is faster.


Remembering that CPI refers to the average number of clock cycles per instruction for a program (or program segment), we can find the CPI for each processor by diving the total number of clock cycles needed to execute the program by the number of instructions.


As calculated before, , and .



To calculate the CPI generated by each compiler, we use the formula .


Let's assume processor 1 is running compiler A's code and processor 2 is running compiler B's code. Applying the formula for the execution time of a program we get:

Since we know the execution times are equal, we can equate both sides and rearrange terms to get the following equation:

Thus, the clock of processor 1 which is running compiler A's code is actually about 36% slower than the clock of processor 2.


Let C be the new compiler. Then the execution time for compiler C's code will be:


The amount by which compiler C's code is faster is given by the ratio of the execution times:

Thus, compiler C's code is about 1.67 times faster than compiler's A code. Likewise, it is about 2.27 times faster that compiler B's code.



The text explains that dynamic power is the one that depends on the overall capacitive load of each transistor. However, it only gives proportional formulas. Thus, we will use the following approximation, where is the dynamic power, is the capacitive load, is the voltage and is the switch frequency.

Rearranging, we have that the average capacitive load for the Pentium 4 Prescott processor is:

Notes on units:

  • A watt can be expressed as the product of current (in amperes) and voltage (V).
  • The ampere (A) is a unit of electrical current, given as a coulomb of charge per second.
  • A Farad (F) is a unit of electrical capacitance, expressed as a coulomb of charge per voltage.

Similarly, the average capacitive load for the Core i5 Ivy Bridge is:


Processor % of static power Ratio of static to dynamic power
Pentium P4 Prescott
Core i5 Iv Bridge


First, we can consider the total power consumption as the sum of the static and dynamic power components:

Since static energy consumption is caused by leakage current, we can determine the latter through the following formula, where is the leakage current:

Hence, for the Pentium 4 Presctott is equal to:

We want an overall reduction of 10% in power consumption, which means the reduction must be from both the static and dynamic components. Thus, we need to find the new voltage such that the following equation holds:

This boils down to the following quadratic equation:

We calculated the value of the capacitive load in a previous step. For the Pentium 4 Prescott . Also since the leakage current is to remain the same, we have all the necessary information to solve the quadratic:

Choosing the positive solution of the quadratic equation, we find that , which represents a reduction of about 5.4% over the original 1.25 volts. Following similar operations for the Core i5 Ivy Bridge, we find that , a reduction of ~6.51%.



We can again use the following formula for the execution time of the program:

For one processor, the number of clock cycles required to process the program is given by the summation of the different instruction classes, as explained in the answer to exercise 1.6:

For more than one processor (), the number of cycles is given by:

Number of processors 1 2 4 8
Execution time 9.6 s 7.04 s 3.84 s 2.24 s
Relative speed-up over 1 processor 1 1.36 2.5 4.29


If the CPI for the arithmetic operations was doubled, then the new clock cycle counts would be:

, for .

Number of processors 1 2 4 8
New execution time 10.88 s 7.95 s 4.30 s 2.47 s
Relative slow-down 1.13 1.13 1.12 1.10


Since the clock rates are the same we can compare the number of clock cycles directly. Thus, we need to find a value of such that the following equation is satisfied:

Hence, the new value of should be:



In order to use the yield equation we first obtain the approximate die areas.

We can now plug these values into the yield equation:


Since we have the yields, we can apply the formula for cost per die immediately:


For the first wafer:

For the second wafer:


Since the die area is 2 square centimeters, we find that the yield is given by:

Solving for the defect rate we find

Thus, the previous defect rate was

And the new one is









The change in CPI cannot be explained by the increase in clock rate alone. Since the clock rate increased 33% and the number of instructions decreased 15%, we would have expected a reduction in execution time of approximately , but the execution time only decreased 6.67%. Therefore, the CPI must have increased as well.





We assume the additional reduction in execution time is over the time obtained in exercise 1.11.9, and thus use those parameters:


Defining Clock rate





clock cycle = ( 50 x 10^ 6 x 1 + 110 x 10^ 6 x 1 + 8 0 x 10^6 x 4 + 16 x 10^6 x 2 ) = 512 x 10^6

execution time = ( 512 x 10^6 ) / (2 x 10^9 ) = 256 x 10 -3 = 0.256 s

If we divide the clock cycle by 2 to make the program twice as fast,

clock cycle / 2 = 256 x 10^ 6 = 50 x 10 ^6 x CPI FP + 11 0 x 10^ 6 x 1 + 8 0 x 10^ 6 x 4 + 16 x 10^ 6 x 2

CPI FP = (256 x 10 ^6 - 462 x 10^ 6 ) / ( 50 x 10^ 6 )

CPI FP can not be improved because negative numbers appear.

execution time improved = execution time * 1/2 = 128 x 10^ -3 = 25 x 10^ -3 + 231 x 10^ -3

CPI L / S (improved) = 0.2


Clock Cycle = 256 x 10^ 6 = 50 x 10^ 6 x 1 + 11 0 x 10^ 6 x 1 + 8 0 x 10^ 6 x 4 x CPI L / S + 16 x 10^ 6 x 2 CPI L / S = (256-192) x 10^ 6 / ( 8 0 x 10^ 6 x 4) CPI L / S = 64 x 10^6 / 80 x 10^6 CPI L / S = 4 / .8 CPI L / S = 5

execution time (improved) = 0.1712s (It is 0.0848s faster than the original execution time (0.256s))