You are on page 1of 1

MOV R1,#200 ; 1 cycle

BACK LDR R0,#20000000 ; 1 cycle "LDR"

Here NOP ; Nop 1 cycle

NOP ; Nop 1 cycle

NOP ; Nop 1 cycle

SUBS R0,R0,#1 ; 1 cycle

BNE Here;
SUBS R1,R1,#1

BNE BACK

The total time of delay = 1 mov + Back to Back


( Here to Here + 1 -> SUBS After Here to Here + 3
Back to Back = 1 -> LDR before Here +

BNE)* 200 -2 last skipped

Back to Back= (1+Here+1+3)*200 2


Here to Here >> (1+1+1)>Nop + 1 >SUBS+ 3->B*20000000 -2 last skip

Here = ( 1+1+1+1+3)* 20000000 ) 2 = 139999998


Then Back will be >>

Back to Back= (1+139999998 +1+3)*200 2 = 28000000598 cycles


total time in cycles = Back to Back + 1 MOV = 28000000599 cycles
The time period = 1 / f = 1 / (40*10^6) = 25 ns
total time in seconds = 28000000599 * 25 * 10 ^ - 9 =
700.000015 seconds

You might also like