0% found this document useful (0 votes)
40 views1 page

The of Delay 1 "Mov" + 200 "-2 Last Skipped" (1+ +1+3) 200 - 2

The document describes the timing calculations for a delay loop in an embedded system. It performs the following operations: 1) Initializes register R1 to 200 and loads 20000000 into R0. 2) Enters a nested loop that takes 3 NOP cycles plus 1 SUBS cycle to decrement R0, repeating until R0 is 0. 3) The outer loop repeats the nested loop 200 times, decrementing R1 each time, until R1 is 0. 4) The total time is calculated as 28000000599 cycles at 25ns per cycle, equalling 700.000015 seconds.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views1 page

The of Delay 1 "Mov" + 200 "-2 Last Skipped" (1+ +1+3) 200 - 2

The document describes the timing calculations for a delay loop in an embedded system. It performs the following operations: 1) Initializes register R1 to 200 and loads 20000000 into R0. 2) Enters a nested loop that takes 3 NOP cycles plus 1 SUBS cycle to decrement R0, repeating until R0 is 0. 3) The outer loop repeats the nested loop 200 times, decrementing R1 each time, until R1 is 0. 4) The total time is calculated as 28000000599 cycles at 25ns per cycle, equalling 700.000015 seconds.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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