100% found this document useful (1 vote)
2K views

COA Numerical:: Performance: Q1

The document provides details on the performance of two processors, A and B, running two different programs. It includes calculations of execution time, cycles per instruction (CPI), and which processor is faster. For program 1, processor A takes 30 microseconds while processor B takes 292 microseconds, making processor A around 1.29 times faster. For a second program with 200,000 instructions running on a 40 MHz processor, the average CPI is calculated to be 2.24 cycles, resulting in a MIPS rate of 17.86.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

COA Numerical:: Performance: Q1

The document provides details on the performance of two processors, A and B, running two different programs. It includes calculations of execution time, cycles per instruction (CPI), and which processor is faster. For program 1, processor A takes 30 microseconds while processor B takes 292 microseconds, making processor A around 1.29 times faster. For a second program with 200,000 instructions running on a 40 MHz processor, the average CPI is calculated to be 2.24 cycles, resulting in a MIPS rate of 17.86.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

COA Numerical:

Performance:
Q1.
1. A program consist of 5,000 floating point instructions and 25,000 integer
instructions. Processor A has a clock rate of 2.0 GHz. Floating point
instruction take 7 cycles and integer instruction take 1 cycle. How long does
it take for this processor to run a program?
Ans: Cyclefp = 7(5000) = 35,000
Cycleint = 1(25,000)= 25,000
Total Cycles = 35000+25000 = 60,000 cycles
Cycle time = 1/ f = 1/ 2*109Hz = 500 ps
Time = 60000* 500 = 30 microseconds.
2. What is average CPI for this processor for the given program?
Ans: 60000 cycles/30000 inst. = 2 cycle/inst.

3. Processor A runs a program 2 consisting of 1000,00 floating point


instruction and 50,000 integer instructions. What is the average CPI for this
program?
Ans: 700,000 fp cycle + 50, 000 inst. Cycle
= 750000 cycles
150,000 inst
= 750000/150000
= 5 cycles/ instr

4. Processor B has an average CPI for program 2 of 3.5 . Its clock rate is 1.8
GHz. How much time does it take to execute the program?
Ans: = Inst.* CPI * Cycle time
= 150000*3.5* 1/1.8 *109
= 292 microseconds

5. Which processor is faster and by how much?


Ans: Time A: 150000*5*1/2*109
= 375 microsecond
6. Processor B is how much faster than processor A
Ans: 375/292
= 1.29 times

Q2. Consider the execution of an object code with 2,00000 instruction on a 40


MHz processor. The program consist of 4 major types of instructions. The
instruction mix and the number of cycles (CPI) needed for each instruction
type are given below based on a result of a program.
Inst. Type CPI Inst. Mix
Arithmatic logic 1 60%
Load/Store with cache hit 2 18%
Branch 4 12%
Memory reference with cache miss 8 10%

a) Calculate the average CPI when the program is executed on a uniprocessor


with the above trace result.
b) Calculate the corresponding MIPS rate based on the CPI obtained in part (a)

Ans: Given,
Ic = 200000 , f= 40 MHz = 40* 106 Hz
Number of cycles needed to executed arithmetic and logic instruction
= 1*60/100 *(200000) = 1,20000
No. of cycles needed to execute load/store = 2*18/100 *(200000)
= 72000
No. of branch inst.---
= 4* 12/100 *(200000) = 96000
No. of cycles. -----
= 8* 10/100 *(200000) = 160000

Total no. of cycles needed to execute a program


C= 120000 + 72000 + 96000 + 160000
= 448000
a) CPI = C/Ic =448000/200000 = 2.24
b) MIPS rate= f/ CPI*106 =40*106/ 2.24*106
= 17.86

You might also like