OA. free
Free
IBM Core Computer Science Core Computer Science Medium

In a 5-stage pipeline system with clock speed of 50 MHz, what is the CPU execution time if...

IBM technical mcq question, verified with a worked answer. Free to practise - no sign-up.

In a 5-stage pipeline system with clock speed of 50 MHz, what is the CPU execution time if 16 instructions are executed.

Assume each instruction takes 1 cycle per stage.

Pick ONE option

Choose one option.
Show answer & explanation
Answer: B. 320 nanoseconds

In a 5-stage pipeline, the first instruction takes 5 cycles to complete (one per stage). Subsequent instructions complete one per cycle after steady state is reached. For 16 instructions: total cycles = 5 + (16 - 1) = 20 cycles. With a 50 MHz clock, the cycle time is 1/(50 × 10^6) = 20 nanoseconds. Total execution time = 20 cycles × 20 ns = 320 nanoseconds.

Step-by-step Derivation:
Step 1: Calculate clock period.
Clock speed = 50 MHz = 50 × 10^6 Hz
Clock period = 1 / (50 × 10^6) = 20 nanoseconds

Step 2: Calculate total pipeline cycles.
Pipeline stages = 5
Instructions = 16
In a pipeline, the first instruction takes 5 cycles (fills all stages).
Remaining 15 instructions each take 1 cycle (steady state).
Total cycles = 5 + 15 = 20 cycles
Alternatively: Total cycles = stages + (instructions - 1) = 5 + 16 - 1 = 20

Step 3: Calculate execution time.
Execution time = Total cycles × Clock period
Execution time = 20 × 20 ns = 320 nanoseconds