Question

In: Computer Science

Microprocessor question Q1: Write a delay loop which produces a delay of 500 Microseconds on an8086...

Microprocessor question

Q1:

Write a delay loop which produces a delay of 500 Microseconds on an8086 with a 5-MHz clock.?

Solutions

Expert Solution

Solution ;

Number of clock cycles for execution of the loop once (m) = 2 + 3 + 16 = 21

Time required for the execution of loop once = m X T = 21 X 1/(5 X 10^6) = 4.2 microseconds

Count = td/(m X T) = 500 X 10^-3 /(4.2 X 10^-6)
= 119048
By loading 119048 in BX, the time taken to execute the delay program is approximately 500ms. The NOP included in the delay program is to increase the execution time of the loop. To get more delay, the number of NOP instructions in the delay loop can be increased.

The MOV BX, Count & RET instructions in the delay program are executed only once. The JNZ instruction takes 16 T-states when the condition is satisfied (i.e. Z = 0) and four T - states when the condition is not satisfied, which occurs only once.

Exact delay = [4 x 0.1 + (2+3) x 119048 x 0.1 + 16 x 119047 x0.1 + 4 X 0.1 + 8 X 0.1 ] micro seconds
= 0.4 + 28571.5 + 91427.2 + 0.4 + 0.8
= 250000.8 micro seconds
= 250.0008 ms
The error in the previous calculation is very less as the exact delay is also very close to 500ms. When 16-bit count register is used in the delay program, the maximum count value that can be loaded in it is FFFFh. This may put a limitation on the maximum time delay that can be generated using the above delay subroutine.


Related Solutions

Write a python code which prints triangle of stars using a loop ( for loop )...
Write a python code which prints triangle of stars using a loop ( for loop ) Remember what 5 * "*" does The number of lines of output should be determined by the user. For example, if the user enters 3, your output should be: * ** *** If the user enters 6, the output should be: * ** *** **** ***** ****** You do NOT need to check for valid input in this program. You may assume the user...
Q1: Write a paragraph about the advantages and disadvantages of online shopping write 500 words.
Q1: Write a paragraph about the advantages and disadvantages of online shopping write 500 words.
Question: How to delay this code from 1 second delay to 0.5 second delay? org 0000h;...
Question: How to delay this code from 1 second delay to 0.5 second delay? org 0000h; ljmp main; org 0050h; main:      mov dptr,#SMG_DUAN ;     mov r0,#00h;     mov r1,#0ah; lin1:mov a,r0;     movc a,@a+dptr; get first indexed data in rom to accumolator a     mov p1,a; move data in a to port 1     lcall delay; subroutine call for the delay     inc r0; increase r0 by one to get to the next index     djnz r1,lin1; repeat...
This is from "Microeconomics " subject write 250 to 500 words Q1. WHAT ARE THE 3...
This is from "Microeconomics " subject write 250 to 500 words Q1. WHAT ARE THE 3 MAIN SECTORS OF THE ECONOMY? Q2. WHAT IS A LABOUR INTENSIVE AND CAPITAL INTENSIVE PROCESS? IF YOU WERE A MANAGER OR HAD YOUR OWN BUSINESS WHICH ONE WOULD YOU CHOOSE?
Q1:Write a Java program to find Fibonacci Series using 1) using for loop 2) using while...
Q1:Write a Java program to find Fibonacci Series using 1) using for loop 2) using while loop To Understand what the Fibonacci series is: The Fibonacci sequence is a series of numbers where a number is the sum of the previous two numbers. Starting with 0 and 1, the sequence goes 0, 1, 1, 2, 3, 5, 8, 13, 21, and so on. Q2: Write a Java program to find the Factorial of a number using a while loop. To...
QUESTION Write the main while loop for a Java program that processes a set of data...
QUESTION Write the main while loop for a Java program that processes a set of data as follows: Each line of the input consists of 2 numbers representing a quantity and price. Your loop should: 1. Read in the input 2. Calculate the tax. Tax will be 8.875% of price and will only be applicable if price is more than 110. Calculate the new price which is the price plus tax. 3. Calculate the final price by multiplying quantity by...
Question 1 Please, write a loop to print even members of an array a with pointers....
Question 1 Please, write a loop to print even members of an array a with pointers. You can use a variable “size” for array size Example Input: 1,2,5,6,8,9 Output : 2,6,8 Question 6 Please, write a loop to print odd numbers an array a with pointers backwards. You can use a variable “size” for array size Example Input: 1,2,5,6,8,9 Output : 9,5, Question2 1 LINKED LIST QUESTIONS For the following two questions you need to provide a code in C...
write a for loop that uses the loop control variable to take on the values 0...
write a for loop that uses the loop control variable to take on the values 0 through 10. In the body of the loop, multiply the value of the loop control variable by 2 and by 10. Execute the program by clicking the Run button at the bottom of the screen. Is the output the same?
Do the following lab by while or Do-while loop. question: Write a c++ program that asks...
Do the following lab by while or Do-while loop. question: Write a c++ program that asks students to enter 3 valid grades and then calculate the average and print it. if the user enters the invalid grade you should print the error message and get the new grade. Hint1: each time your program ask the following question: "Do you want to calculate another average?" and if the answer to this question is "Y" or "y" then you should continue. Hint2:...
Using loop statements, write a C++ program which takes the number of items that a shopper...
Using loop statements, write a C++ program which takes the number of items that a shopper wants to buy, and then takes the price of each item, and at the end tells the shopper how much she must pay. This is a sample of the output: How many items do you have in your basket? 3 Enter the price in dollar? 10.25 Enter the price in dollar? 20.75 Enter the price in dollar? 67.5 You must pay 98.5 $ today.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT