A program repeatedly executes a loop that has 120 iterations. Each iteration tak
ID: 3793761 • Letter: A
Question
A program repeatedly executes a loop that has 120 iterations. Each iteration takes 10,000
cycles. On a multiprocessor system, 50,000 cycles are required to synchronize the processors
once all iterations of the loop have been completed:
a. What is the execution time of each loop on a uniprocessor system?
b. What is the execution time of each loop on a 2-processor system, and what is the speedup
over the uniprocessor system?
c. What is the execution time of each loop on a 4-processor system, and what is the speedup
over the uniprocessor system?
Explanation / Answer
Given no. of iterations = 120
Let no. of instruction count is I and clock rate is 'n'.
We know, execution time = CPI * instruction count * clock rate
a,) For a uni-processor system, no. of cycles required = 120*10,000 = 12,00,000
Execution time = 12,00,000 * I * n
b.) For 2-processor system, no. of cycles required = 12,00,000 + 50,000 = 12,50,000
Execution time = (12,50,000/2) * I *n
Speedup = (Execution time for uni-processor)/(Execution time for 2-processor)
= (12,00,000 * I *n) / {(12,50,000/2) * I *n}
= 24,00,000/ 12,50,000 = 1.92
c.) For 2-processor system, no. of cycles required = 12,00,000 + 50,000 = 12,50,000
Execution time = (12,50,000/4) * I *n
Speedup = (Execution time for uni-processor)/(Execution time for 4-processor)
= (12,00,000 * I *n) / {(12,50,000/4) * I *n}
= 48,00,000/ 12,50,000 = 3.84
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.