f=4MHz LD B, 250 LOOP: DEC B JP NZ, LOOP Calculate the delay time or the program
ID: 3606143 • Letter: F
Question
f=4MHz LD B, 250 LOOP: DEC B JP NZ, LOOP Calculate the delay time or the program above (answer in uSec). QUESTION 2 If the counter in program #1 is loaded with o instead of 250, the delay loop would be executed times. (5 Points) QUE STION 3 In the program shown below, calculate COUNT, so that the delay time is 250 mSec (clock frequency is 2 MHz) (20 Points). LD DE, COUNT NEXT: DEC DE LD A, E OR D JP NZ, NEXT QUE STION 4 In Problem 2, the purpose of the LD A, E and OR D instructions are? (5 Points) OA. To add T-States to the delay loop. O B. To affect flags. C. To test for D and E0. D. Both B and CExplanation / Answer
1) Here f = 4 MHz,
It means, time to execute each instruction = (1/ 4*10^6) ;
and the delay is caused by the loop .
Loop executed 250 times (because B is loaded with value 250). i.e. 2*250 instructions.
Therefore , time delay = (2*250*(1/4*10^6));
time delay = 125 micro seconds
2) Here, the value of B = 0 which a loop control varibale
Therefore, When the first time control reaches the lable LOOP, it will decrease the value of B from 0 to -1.
Hence, the value of B will never be zero.
Ans = The delay loop would execute infinite times or when the value of B becomes zero. one possible answer can be "zero times " if we do not decrease the value of B before going to jump instruction.
3) clock frequency = 2 MHz = 2*10^6.
time taken to execute each instruction = 1/(2*10^6)
total delay = total instructions * (1/(2*10^6))
250 * (10^-3) = COUNT*4 *(1/(2*10^6))
(250 * 2 * 10^6)/ (4 * 10^3) = COUNT
COUNT = 125000
4) These instructions are only adding delay to the loop therefore option (A) is right.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.