Microprocessor and Applications (EC1303) - Question Bank
Microprocessor and Applications (EC1303) - Question Bank
Microprocessor and Applications (EC1303) - Question Bank
Unit I (8085):
1. What are machine language and assembly language programs?
The software developed using 1’s and 0’s are called machine language programs.
The software developed using mnemonics are called assembly language programs.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
When low byte address (A0-7 ) comes out of AD0-7 lines, the processor asserts HIGH in the
ALE pin, enabling the latch to separate the low byte address.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
18. What will be the outcome, in execution of instructions LXI H, 4600H and LHLD 4600H?
When LXI H,4600 is executed, the number 4600 will be loaded into HL register pair.
When LHLD 4600 is executed, the contents of memory location 4600H and 4601H will be
transferred into HL register pair.
Execution of an OUT instruction will transfer one byte of data from Accumulator of
microprocessor to an Output device.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
25. When the 8085 processor will disable the interrupt system?
The interrupts of 8085 except TRAP are disabled after anyone of the following operations
1. Executing EI instruction.
2. System or Processor reset.
3. After acceptance of an interrupt.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
In 8085, if the external clock frequency applied through X1 & X2 pins are 6 MHz; then the
internal clock frequency is 3 MHz (since, Fint = Fext / 2).Therefore, one T-State equals to T =
1/F = 1/3MHz = 0.333µs.
27. What is Processor (machine) cycle? List the various machine cycles with its T-states.
The machine cycles are the basic operations performed by the processor, while instructions
are executed. The time taken for performing each machine cycle is expressed in terms of T-
states.
The various machine cycles are
1. Opcode fetch …………….. - 4/6T
2. Memory Read ……………. - 3T
3. Memory Write ……………. - 3T
4. I/O Read ………………….. - 3T
5. I/O Write …………………. - 3T
6. Interrupt Acknowledge …… - 6 / 12 T
7. Bus Idle …………………… - 2/3T
29. Write an assembly language program to store the contents of the flag register in
memory location 2000H.
PUSH PSW - Stores the contents of Accumulator & Flag register in Stack
POP D - Restores the stored contents of stack to DE register pair
MOV A, E - Move the contents of E register to Accumulator
STA 2000H - Contents of Accumulator is now stored to memory location 2000H
HLT
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
30. List the various addressing modes in 8085 with two examples in each.
Addressing is the method of specifying the location of data in an instruction.
The different types of addressing modes in 8085 are
a) Direct:
The data is stored in memory and 16 bit address of data in memory location is specified
in the instruction. Eg.: LDA 4500, LHLD 4200
b) Immediate:
The required data for processing is given next to the Opcode, in the instruction itself.
Eg.: MVI A, 55 CPI 64, ADI 0A
c) Register:
The data is placed in a register and the register name is given in the instruction to access
the data. Eg.: MOV A,B ADD B, SUB C
d) Register Indirect:
The data is stored in memory and the 16-bit address of the data location in memory is placed in a
register pair. This register pair holding the 16-bit address is given in the instruction to access the
data. Eg.: LXI, H 4250 MOV A, M
e) Implied:
The data location & the operation to be performed is given in the instruction itself.
Eg.: CMA, RAR, XCHG
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
JMP Instruction
Execution of a JMP instruction will transfer the program control from one location to
another location within the same program. Time taken for its execution is 7 / 10 T
Main _________
_________
_________
JMP addr16
_________
_________
addr16:_________
_________
32. Write an ALP for time delay using a register pair available in 8085.
Main _________ Delay: LXI D, Data16
_________ loop: NOP ………………………. 4T
_________ NOP ………………………. 4T
NOP ………………………. 4T
CALL Delay DCX D ……………………. 6T
_________ JNZ loop ………………….. 10T
_________ RET
------
The register pair used is DE. 28T
The total time delay made is as follows.
One T-state = 1 / Finternal
Total T-States for delay = Delay time (in µs) / Time period for 1 T-state
T–states (in execution of loop – one time) = 4T + 4T + 4T + 6T + 10T = 28T
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
The counter is an arrangement to keep track of a process. This consists of three operations
which are a) count initialization b) decrement count value and c) check whether count value
has reached zero.
The count operation can be either Up-count or Down-count. A Counter is used for repeated
processing, time delay generation, counting of events.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
36. Write an 8085 program to generate a time delay of 0.4sec; assuming crystal frequency
as 5MHz.
Internal frequency = 5MHz/2 = 2.5MHZ.
Time for one T-state = 1/ 2.5MHz = 0.4msec.
Number of T-states required for delay = Delay time / Time for 1T-state
= 0.4sec / 0.4msec
= 1 x 106 T-states
Delay program:
LXI B, Count ……………..….… 10T
Loop : MOV A, C …………….............. 4T
ORA B ……………………….… 4T
DCX B …………………….…… 6T
JNZ Loop …………………….… 10T
37. Identify the no. of address lines needed for interfacing 8KB memory.
Where, N is number of address lines. ∴The no. of address lines for 8 KB is equal to 13.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
In handshake input operation, the input device will check whether the port is empty or not. If the
port is empty, then the data is loaded into the port. When the port receives the data, it will
inform the processor for read operation. Once the data have been read by the processor, the port
will signal the input device that it is empty. Now the input device can load another data to port
and the above process is repeated.
In handshake output operation, the processor will load a data to port. When the port receives the
data, it will inform the output device to collect the data. Once the output device accepts the data,
the port will inform the processor that it is empty. Now the processor can load another data to
port and the above process is repeated.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
8. Draw the control word format for BSR (Bit Set Reset) Mode.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
8251 – USART:
10. What is USART? What are the functions performed by INTEL 8251A?
The device which can be programmed to perform Synchronous or Asynchronous serial
communication is called USART (Universal Synchronous Asynchronous Receiver Transmitter).
The INTEL 8251A is an example of USART.
The INTEL 825lA is used for serial data transmission or reception either asynchronously or
synchronously. The 8251A can be used to interface MODEM for serial communication through
telephone lines.
Data is sent continuously in blocks either without any time interval or in fixed time intervals.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
13. What are the control words of 8251A and what are its functions?
The control words of 8251A are Mode word and Command word. The mode word informs 8251
about the baud rate, character length, parity and stop bits. The command word can be send to
enable the data transmission and reception.
15. What is the information that can be obtained from the status word of 8251?
The status word can be read by the CPU to check the readiness of the transmitter or receiver and
to check the character synchronization in synchronous reception. It also provides information
regarding various errors in the data received. The various error conditions that can be checked
from the status word are parity error, overrun error and framing error.
16. What are the different types of errors that can occur in asynchronous serial
communication?
1. Framming Error
2. Over run Error
3. Parity Error
_
17. What is the significance of C/D signal in 8251?
This pin is used to select either Control register for configuring or Data bus buffer for read /
write operations.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
20. What is the difference in programming the 8279 for encoded scan and decoded scan?
If the 8279 is programmed for decoded scan then the output of scan lines will be decoded output
and if it is programmed for, encoded scan then the output of scan lines will be binary count. In
encoded mode, an external decoder should be used to decode the scan lines.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
ADC / DAC:
32. How the RS -232C serial bus is interfaced to TTL logic device?
The RS-232C signal voltage levels are not compatible with TTL logic levels. Hence for
interfacing TTL devices to RS-232C serial bus, level converters are used. The popularly used
level converters are MC 1488 & MC 1489 or MAX 232.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
Unit-III (8086)
3. How clock signal is generated in 8086? What is the maximum internal clock frequency of
8086?
The 8086 does not have on-chip clock generation circuit. Hence the clock generator chip, 8284
is connected to the CLK pin of8086. The clock signal supplied by 8284 is divided by three for
internal use. The maximum internal clock frequency of8086 is 5MHz.
7. What is the difference between segment register and general purpose register?
The segment registers are used to store 16 bit segment base address of the four memory
segments. The general purpose registers are used as the source or destination register during
data transfer and computation, as pointers to memory and as counters.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
9. Write the special functions carried by the general purpose registers of 8086.
The special functions carried by the registers of 8086 are the following.
12. Describe the difference between the instructions MOV AX, 2437H and MOV AX,[2437H].
Difference between the instructions MOV AX, 2437H and MOV AX,[2437H] are former
instruction takes 2437 as 16-bit data and latter instruction takes 2437 as 16-bit address.
15. In 8086 processor the code segment contains 4000H and instruction pointer contains
9F20H. Find the memory location addressed by the processor.
The LOCK prefix allows a microprocessor to make sure that another processor does not take
control of the system bus while it is in the middle of a critical instruction which uses the system
bus.
ESCAPE:
This instruction is used to pass instructions to a coprocessor such as the 8087 math coprocessor
which shares the address and data bus with an 8086.
18.Give the contents of the flag register after execution of following addition.
0110 0101 1101 0001
+ 0010 0011 0101 1001
---------------------------
1000 1001 0010 1010
-----------------------------------
SF = 1, ZF = 0, PF = 1, CF = 0, AF = 0, OF=1.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
24. What is the operation performed when TEST input pin is low?
If the TEST input goes low, execution will continue, else, the processor remains in an idle state.
The input is synchronized internally during each clock cycle on leading edge of clock.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
___
28. What is the significance of MX/MN pin in 8086?
The above said pin is used for selecting the mode of the operation of the processor. HIGH in
that pin declares that the system comprises of uni-processor (Minimum Mode) and LOW
declares that the system comprises of multi-processor (Maximum Mode).
29. What are the differences between maximum mode and minimum mode?
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
34. Give the advantage of loosely coupled system over the tightly coupled system.
The loosely coupled system has the following advantage over the tightly coupled system,
• More number of CPUs can be added in a loosely coupled system to improve the system
performance.
• The system structure is modular and hence easy to maintain and troubleshoot.
• A fault in a single module does not lead to a complete system breakdown.
• Due to the independent processing modules used in the system, it is more fault -tolerant.
• More suitable to parallel applications due to its modular organization.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
This can also be used as two numbers of 8-bit data pointer namely DPH and DPL. The 8-bit data
pointers are used for accessing internal RAM and SFR.
The contents of data pointer are programmable using instructions.
__
4. What is the significance of EA pin?
EA stands for External Access. By applying LOW to this pin, makes 8051 to omit internal 4KB
on-chip ROM and use only external memory for program storage. By applying HIGH to this
pin, makes 8051 to use internal 4KB on-chip ROM along with external memory for program
storage.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
Hence MORE instructions are made Hence LESS instructions are available
available for data transfer with for data transfer with external memory.
external memory.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
The PSW consists of four math flags and two register bank select bits. The math flags are Carry,
Auxiliary Carry, and Overflow and Parity flags.
The register bank select bits RS1 and RS0 are used to select any one of the four register banks
of the internal RAM. At any instant, the microcontroller can work with (or access) only one
register bank, which is selected by these bits.
12. State the function of RS1 and RS0 bits in the flag register of 8051.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
15. Explain why SJMP instruction is used in the place of HLT in 8051?
As we use microcontroller for a dedicated and repetitive application, there will not be a
situation in which the microcontroller is switched ‘ON’ and no program running in it. Hence,
there is no necessity to have HLT instruction in the instruction set of microcontroller.
At the same time, when we want to terminate the execution of a program in 8051, we use
SJMP to make the program execution remain in the same instruction.
Eg. Here: SJMP Here HLT
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
This instruction compares two 8-bit numbers and the program control branches to a specific
location if the numbers are not equal. The branching is done by relative addressing.
This instruction decrements a 8-bit number stored in a register / memory location, and the
program control branches to a specific location if the resultant number after decrement is not
zero. The branching is done by relative addressing.
18. Justify why the crystal oscillator frequency in 8051 is chosen as 11.0592Mhz.
When an 8051 microcontroller based system is connected to an external device for serial
communication between them, the speed at which the data transfer should take place must be in
standard baud rates such as 4800, 9600, etc.
Only XTAL of 11.0592 Mhz can provide such standard baud rates, after down scaling by 12, by
32 at UART and by a factor set in timer register.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
The modes of timer in 8051 are chosen with the help of two bits, viz., M0 & M1, in TMOD
register. The different modes of timer are as follows.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
In this mode, the timer register is used to generate the time delay using the clock signal applied
to the processor. An initial count is loaded in the timer register. When the timer is started, the
timer register content gets incremented after every machine cycle. When the timer register
crosses (i.e., overflows) the count FFFFH and goes to 0000H, the timer overflow flag in TCON
register becomes set.
Hence, by loading appropriate value in the timer register, a specific time delay can be generated
using timer. One machine cycle consists of 12 clock signal periods and the delay is equal to
count value loaded * time period of one machine cycle.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
Out of all modes, Mode-1 is commonly used mode for serial data transfer in 8051.
HIGH in that bit indicates Counter operation and LOW in that bit indicates Timer operation.
0 Timer operation
1 Counter operation
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
32. Explain how baud rate is set in 8051 for serial data transfer using timer register?
Based on the baud rate needed for serial communication, the timer register TH1 is loaded with
values as per the following calculation.
External XTAL oscillator frequency is chosen as 11.0592 MHz is to make the UART output as
28800 Hz, so that the various baud rates are obtained by dividing this common frequency 28800
Hz with different values set in TH1 register.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
Following are the sample values loaded in TH1 register for different baud rates.
General Expression for setting variable baud rates using TH1 register is given below.
|
|
|
33. Write a program using 8051 assembly language to change the data 55H stored in the
lower byte of the data pointer register to AAH using rotate instruction.
34. Specify the single instruction, which clears the most significant bit of B register of 8051,
without affecting the remaining bits.
Single instruction, which clears the most significant bit of B register of 8051, without affecting
the remaining bits, is CLR B.7
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
Part-B Questions:
UNIT-I
2. Draw the Pin Diagram of 8085 and explain the function of various signals.
-Pin Diagram
-Explanation about all signals
5. Draw and explain the timing diagram for each machine cycle.
7. Programming Exercises.
-Example: a) Write a program to multiply two 8-bit numbers.
b) Write a program to sort an array in ascending order.
-Also refer to the exercises given in chapter 8 of book authored by Ramesh N. Goankar
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
UNIT - II
3. With neat sketch explain the operation of Keyboard and display controller 8279.
-List the functions of the IC 8279.
-Signal flow diagram with pin description
-Internal architecture block diagram
-Explain the working of 8279
-List the eight command words and shortly brief them.
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
UNIT - III
2. Draw the Pin Diagram of 8086 and explain the function of various signals.
-Pin Diagram
-Explanation about all signals
© NSS, 2008
EC1303 – Microprocessor & Applications Question Bank
UNIT – IV & V:
2. Draw the Pin Diagram of 8051 and explain the function of various signals.
-Pin Diagram
-Explanation about all signals
10. With neat sketch, explain the interfacing of 8051 with external memory.
11. With neat sketch, explain the interfacing of 8051 with Stepper motor.
12. With neat sketch, explain the interfacing of 8051 with LCD display.
13. With neat sketch, explain the interfacing of 8051 with ADC.
14. With neat sketch, explain the interfacing of 8051 with DAC.
© NSS, 2008