The procedure to calculate the execution time ET for an asse
Solution
Happy New Year 2017.
I could not get the datasheet with clock cycles you referred here.
So, I have assumed every instruction takes 1 clock cycle. Please go through the datasheet and calculate accordingly.
a) Given microcontroller frequency = 4MHz.
The Time period = 1/f = 1/(4MHz)
= 250ns.
b) Here CALLING PROGRAM has 3 instruction => 3 clock cycles. (Based on my assumption)
SUBROUTINE has 18 instructions => 18 clock cycles.
(I have not considered looping in the SUBROUTINE. If your want to do so, please do it)
Total instructions = 3 + 18 = 21.
c) Execution Time (ET) = T * C
= 250ns * 21
= 5250ns.
ns = nano seconds.
T value obtained from (a)
C value obtained from (b)
