Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please solve. Answer in (ms). Determine how much total delayed time is consumed

ID: 1715592 • Letter: P

Question

Please solve. Answer in (ms).

Determine how much total delayed time is consumed by the program snippet below. Note that this INTEL based assembly is different than the AVR but the comments should make the calculations manifest. Regardless, double and triple check them as itis ripe for error! MOV R1, #0xC9 ace the hexadecimal number of C9h in register one taking 0.1 us MOV R2, #0x64 place the hexadecimal number of 64h in register two taking 0.1 us Loop: NOP do nothing and just absolutely waste time of 0.1 us MUL AB Rperform a wasted multiply operation that takes 0.4 us DJNZ R1, Loop decrement R1 & if result is not zero branch to the loop label taking 0.2 us DJNZ R2, Loop decrement R2 & if result is not zero branch to the loop label taking 0.2 us END

Explanation / Answer

delay of two MOV instruction is 0.1 + 0.1 = 0.2 us.

R1 has C9 h which is equal to 201 decimal

R2 has 64 h which is 100 in decimal

DJNZ R1,Loop has encountered for 201 times.

so statements NOP, MUL with DJNZ is executed 201 times.

NOP has a delay of 0.1 us

MUL has a delay of 0.4 us

and DJNZ has a delay os 0.2 us

total delay due to R1 is (0.1+0.4+0.2)*201 = 140.7 us

Now due to DJNZ R2,Loop statements NOP,MUL ,DJNZ R1,Loop and DJNZ R2,Loop are executed 100 times.

so delay due to R2 is

(NOP Delay + MUL delay + DJNZ delay + DJNz delay)*100

(0.1+0.4+0.2+0.2)*100 = 90 us

so total delay is 0.2 us + 140.7 us + 90 us

total delay is = 230.9 us

delay = 0.230 ms