Question:

A 24 MHz microcontroller executes one instruction per clock cycle. If an interrupt service routine consumes 120 cycles, then the time taken by the ISR to execute is:

Show Hint

To solve execution time problems quickly, use the direct formula:
\(\text{Time} = \frac{\text{Total Cycles}}{\text{Frequency}}\). Substituting the values here yields \(\frac{120}{24 \times 10^6} = 5 \times 10^{-6}\text{ s} = 5\ \mu\text{s}\).
Updated On: Jun 23, 2026
  • \(10\ \mu\text{s}\)
  • \(5\ \mu\text{s}\)
  • \(20\ \mu\text{s}\)
  • \(1\ \mu\text{s}\)
Show Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

Concept: The execution speed of a microcontroller depends directly on its operating clock frequency. The clock frequency specifies the number of clock pulses generated per second. The duration of a single clock cycle (\(T_{\text{cyc}}\)), which represents the smallest time increment for execution, is the reciprocal of this operating frequency: \[ T_{\text{cyc}} = \frac{1}{f} \] If a processor architecture is designed to execute exactly one instruction per clock cycle, the total time (\(t\)) required to execute a specific software routine is simply the total number of clock cycles consumed multiplied by the duration of one individual cycle: \[ t = \text{Total Clock Cycles} \times T_{\text{cyc}} \]

Step 1: Computing the time period of a single clock cycle.

We are given that the microcontroller operates at a clock frequency of: \[ f = 24\text{ MHz} = 24 \times 10^6\text{ Hz} \] Substituting this value into our time period formula: \[ T_{\text{cyc}} = \frac{1}{24 \times 10^6\text{ Hz}} \text{ seconds} \] Isolating the metric prefix component (\(10^{-6}\) seconds \(= 1\ \mu\text{s}\)): \[ T_{\text{cyc}} = \frac{1}{24} \times 10^{-6}\text{ s} = \frac{1}{24}\ \mu\text{s} \]

Step 2: Calculating the total execution time for the ISR.

The problem states that the Interrupt Service Routine (ISR) requires a total of 120 cycles to execute completely. Using our total time formula: \[ t = 120 \times T_{\text{cyc}} \] Substitute the calculated single cycle time duration from
Step 1: \[ t = 120 \times \left( \frac{1}{24}\ \mu\text{s} \right) \] Simplifying the fraction: \[ t = \frac{120}{24}\ \mu\text{s} \] Dividing 120 by 24 gives: \[ t = 5\ \mu\text{s} \] The total execution time for the ISR is exactly \(5\ \mu\text{s}\), matching Option (B).
Was this answer helpful?
0
0