Confusion of number of times and number of cycles
Almost, but not quite. The duration of a cycle does not depend on the instruction being executed. If the MCU clock frequency is 2MHz, one cycle is 500ns exactly, regardless of what instruction is being executed. If some instruction takes 3 cycles to execute, that instruction will take 1500ns to complete. The cycle times stays the same.

To answer your specific questions:


  (1) Does "number of times" mean frequency?


No, in this context, "number of times" is just telling you how many times the djnz instruction was executed. The only frequency that is relevant here is the MCU clock frequency, which we already know is 2MHz.


  Why does # ln 2 use djnz's execution time multiplied by djnz's frequency?


It's not djnz's frequency. It's just the number of times the djnz instruction was executed. Since we know the djnz instruction takes 3 cycles and it was executed 1000 times, we then know that 1000*3 = 3000 cycles of time was consumed by the MCU executing djnz instructions.

The djnz is just a decrementor. It takes a value in memory, subtracts one, and then looks at it. If the new value is not equal to zero, it jumps to a specified address in the code.

If you're familiar with C, the equivalent code from this example would be:

while(1)
{
    for(i=1000;i&gt;0;i--){} //this entire loop takes 1.5ms to finish
    LED = LED^1;
}


Here, the for-loop is executing 1000 times, decrementing i with every loop (that's where the djnz comes in). If it takes 3 cycles, or 1500ns, to decrement i each time, then the entire for-loop will take 1500ns * 1000 = 1.5ms. The LED gets toggled and the loop starts again. So, the LED will appear to blink once every 1.5ms. If something blinks every 1.5ms, it will blink 666.67 times per second.