Consider two processors \(P_1\) and \(P_2\) executing the same instruction…

20142015

Consider two processors \(P_1\) and \(P_2\) executing the same instruction set. Assume that under identical conditions, for the same input, a program running on \(P_2\) takes 25% less time but incurs 20% more CPI (clock cycles per instruction) as compared to the program running on \(P_1\). If the clock frequency of \(P_1\) is 1GHZ, then the clock frequency of \(P_2\) (in GHz) is ______.

Attempted by 75 students.

Show answer & explanation

Correct answer: 1.6

Key formula: Execution time = (Instruction count × CPI) / clock frequency.

  • Let the CPI of the first processor be c and its clock frequency be 1 GHz. The second processor has CPI = 1.2c and its execution time is 25% less, so time2 = 0.75 × time1.

  • Using time = (CPI × instruction count) / frequency and cancelling the common instruction count, we get: 1.2c / f2 = 0.75 × (c / f1). Cancelling c gives 1.2 / f2 = 0.75 / f1.

  • Solve for f2: f2 = (1.2 / 0.75) × f1 = 1.6 × f1. With f1 = 1 GHz, f2 = 1.6 GHz.

Answer: 1.6 GHz

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir