Microprocessor and Microcontroller
Microprocessor and Microcontroller
Microprocessor and Microcontroller
DEPARTMENT OF ECE
TWO MARK
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
UNIT I
THE 8085 AND 8086 MICROPROCESSORS
PART A (2 MARKS)
1. What is Microprocessor? Give the power supply & clock frequency of 8085
A microprocessor is a multipurpose, programmable logic device that reads binary instructions
from a storage device called memory accepts binary data as input and processes data according
to those instructions and provides result as output. The power supply of 8085 is +5V and clock
frequency in 3MHz.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
7. What is an Opcode?
The part of the instruction that specifies the operation to be performed is called the operation
code or opcode.
9. What is an Operand?
The data on which the operation is to be performed is called as an Operand.
10. How many operations are there in the instruction set of 8085 microprocessor?
There are 74 operations in the 8085 microprocessor.
11. List out the five categories of the 8085 instructions. Give examples of the instructions
for each group.
• Data transfer group – MOV, MVI, LXI.
• Arithmetic group – ADD, SUB, INR.
• Logical group –ANA, XRA, CMP.
• Branch group – JMP, JNZ, CALL.
• Stack I/O and Machine control group – PUSH, POP, IN, HLT.
12. Explain the difference between a JMP instruction and CALL instruction.
A JMP instruction permanently changes the program counter. A CALL instruction leaves
information on the stack so that the original program execution sequence can be resumed.
14. What is the difference between the shift and rotate instructions?
A rotate instruction is a closed loop instruction. That is, the data moved out at one end is put
back in at the other end. The shift instruction loses the data that is moved out of the last bit
locations.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
18. List the four instructions which control the interrupt structure of the 8085
microprocessor.
• DI (Disable Interrupts)
• EI (Enable Interrupts)
• RIM (Read Interrupt Masks)
• SIM (Set Interrupt Masks)
Interrupts Priority
TRAP 1
RST 7.5 2
RST 6.5 3
RST 5.5 4
INTR 5
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
31. How many machine cycles does 8085 have, mention them
The 8085 have seven machine cycles. They are
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
• Opcode fetch
• Memory read
• Memory write
• I/O read
• I/O write
• Interrupt acknowledge
• Bus idle
33. Mention the categories of instruction and give two examples for each category
The instructions of 8085 can be categorized into the following five
• Data transfer MOV Rd, Rs STA 16-bit
• Arithmetic ADD R DCR M
• Logical XRI 8-bit RAR
• Branching JNZ CALL 16-bit
• Machine control HLT NOP
36. What is the use of addressing modes, mention the different types
The various formats of specifying the operands are called addressing modes, it is used to access
the operands or data. The different types are as follows
• Immediate addressing
• Register addressing
• Direct addressing
• Indirect addressing
• Implicit addressing
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
44. How does the microprocessor differentiate between data and instruction?
When the first m/c code of an instruction is fetched and decoded in the instruction register, the
microprocessor recognizes the number of bytes required to fetch the entire instruction. For
example MVI A, Data, the second byte is always considered as data. If the data byte is omitted
by mistake whatever is in that memory location will be considered as data & the byte after the
“data” will be treated as the next instruction.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
16 Marks
1. Explain the architecture of Intel 8085 with the help of a block diagram? (16)
2. a. Write an assembly language program to add two 2-digits BCD Number? (6)
b. Explain the addressing modes of 8085 (10)
4. a. Explain the similarities and differences between subtract and compare instructions in 8085?
(4)
b. With neat block diagram explain the architecture of 8085? (12)
5. a. List out the maskable and non maskable interrupts available in 8085? (6)
b. How do the instructions of 8085 is classified based on their function and word length?
Give an example? (10)
9. (i) Explain the various logical and arithmetic instructions available in 8085 microprocessor.
(10)
(ii) Explain the function of various flags of 8085 microprocessor (6)
10. (i) Differentiate between I/O mapped I/O and memory mapped I/O. (6)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
(ii) Write an 8085 assembly language program to convert 8 bit binary to ASCII code. (10)
UNIT II
8086 SOFTWARE ASPECTS
PART A (2 MARKS)
1. What is assembler?
The assembler translates the assembly language program text which is given as input to the
assembler to their binary equivalents known as object code. The time required to translate the
assembly code to object code is called access time. The assembler checks for syntax errors &
displays them before giving the object code.
2. What is loader?
The loader copies the program into the computer’s main memory at load time and begins the
program execution at execution time.
3. What is linker?
A linker is a program used to join together several object files into one large object file. For large
programs it is more efficient to divide the large program modules into smaller modules. Each
module is individually written, tested & debugged. When all the modules work they are linked
together to form a large functioning program.
The ASSUME directive assigns a logical segment to a physical segment at any given time. It
tells the assembler what address will be in the segment registers at execution time.
Example: ASSUME CS: code, DS: data, SS: stack
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
A program may contain several segments of the same type. The GROUP directive collects them
under a single name so they can reside in a single segment, usually a data segment. The format is
Name GROUP Seg-name, Seg-name PTR is used to assign a specific type to a variable or a
label. It is also used to override the declared type of a variable.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
A linker is a program used to join together several object files into one large object file. The
linker produces a link file which contains the binary codes for all the combined modules. It also
produces a link map which contains the address information about the link files. The linker does
not assign absolute addresses but only relative address starting from zero, so the programs are
relocatable & can be put anywhere in memory to be run.
CALL PRO1
PRO1 ENDP
CODE ENDS
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
An 8086 interrupt can come from any of the following three sources
• External signals
• Special instructions in the program
• Condition produced by instruction
Software interrupts
• Type 0-255
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
The code segment register gives the address of the current code segment. ie. It will points out
here the instructions, to be executed, are stored in the memory.
The data segment register points out where the operands are stored in the memory.
The stack segment registers points out the address of the current stack, which is used to store the
temporary results.
If the amount of data used is more the Extra segment register points out where the large amount
of data is stored in the memory.
28. What is the maximum memory size that can be addressed by 8086?
In 8086, an memory location is addressed by 20 bit address and the address bus is 20 bit address
and the address bus is 20 bits. So it can address up to one mega byte (2^20) of memory space.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
31. What are the conditional and control flags available in status register of 8086?
Conditional Flags:
CF - Carry Flag
PF - Parity Flag
AF - Auxiliary Carry Flag
ZF - Zero Flag SF - Sign Flag
OF - Overflow Flag
Control Flags:
TF – Single step Trap Flag
IF – Interrupt Enable Flag
DF – String Direction Flag
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
U U U U OF DF IF TF SF ZF U AF U PF U CF
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
service routine we can display the content of desired registers and memory locations. So it is
useful for debugging the program.
36. What are the functions of bus interface unit (BIU) in 8086?
(a) Fetch instructions from memory.
(b) Fetch data from memory and I/O ports.
(c) Write data to memory and I/O ports.
(d) To communicate with outside world.
(e) Provide external bus operations and bus control signals.
S4 S3
0 0 --I/O from extra segment
0 1 --I/O from Stack Segment
1 0 --I/O from Code segment
1 1 --I/O from Data segment
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
16 Marks
1. i). Explain the addressing modes of 8086 with the help of examples? (12)
ii). Write short notes on macro? (4)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
3. i). Explain the addressing modes of 8086 with the help of example? (12)
ii). Describe the action taken by 8086 when NMI pin is activated? (4)
5. a. With the neat sketch explain the architecture of 8086 processor? (12)
b. Give the significance of ‘O’ flag,’T’flag,’I’ flag &’D’flag of 8086? (4)
8. (i). Explain on detail about the various addressing modes used in 8086 processor ? give an
example. (12)
(ii) Name the various segment registers and their usage in 8086 processor. (4)
10. Draw the pin diagram of 8086 and explain the signals (16)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
UNIT III
MULTIPROCESSOR CONFIGURATIONS
PART A (2 MARKS)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
6. What is Coprocessor?
The coprocessor is a processor which specially designed for processor to work under the
control of the processor and support special processing capabilities. Example : 8087 which has
numeric processing capability and works under 8086.
8. Draw the block diagram of communication between host CPU and IOP in closed coupled
configuration.
11. Write the advantages of loosely coupled system over tightly coupled systems?
1. More number of CPUs can be added in a loosely coupled system to improve the
system performance
2. The system structure is modular and hence easy to maintain and troubleshoot.
3. A fault in a single module does not lead to a complete system breakdown.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
12. What are the schemes for establishing priority in order to resolve bus arbitration
problem?
There are three basic bus access control and arbitration schemes
1. Daisy Chaining
2. Independent Request
3. Polling
17. What are the three memory reference options in 8087 instruction?
1. Not reference memory.
2. Load an operand word from memory into 8087.
3. Store an operand word from 8087 to memory.
S2 S1 S0 STATUS
0 X X unused
1 0 0 unused
1 0 1 READ memory
1 1 0 WRITE memory
1 1 1 Passive
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
The priority can be dynamically changed by altering the polling sequence stored in the
controller.
16 Marks
1. Explain the architecture of 8087.
2. Explain the architecture of 8089.
3. Explain in detail about closely coupled and loosely coupled configuration. What are the
relative advantages and disadvantages?
4. Explain the architecture of math coprocessor.
5. Explain the architecture of I/O processor.
6. Discuss the communication between IOP 8089 and CPU 8086.
7. What are the different types of exceptions which may be generated by 8087?
8. What are the different data types supported by 8087?
9. Describe the signals of 8087.
10. Discuss about the following (a) Status word format
(b) Exception handling
(c) Addressing modes.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
UNIT IV
I/O INTERFACING
PART A (2 MARKS)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
Two groups – group A and group B are available for strobed data transfer.
1. Each group contains one 8-bit data I/O port and one 4-bit control/data port.
2. The 8-bit data port can be either used as input or output port. The inputs and outputs both are
latched.
3. Out of 8-bit port C, PC0-PC2 is used to generate control signals for port B and PC3=PC5 are
used to generate control signals for port A. The lines PC6, PC7 may be used as independent data
lines.
4. What are the signals used in input control signal & output control signal?
Input control signal
STB (Strobe input)
IBF (Input buffer full)
INTR (Interrupt request)
Output control signal
OBF (Output buffer full)
ACK (Acknowledge input)
INTR (Interrupt request)
The control word register accepts data from the data buffer and initializes the counters, as
required. The control word register contents are used for
(a) Initializing the operating modes (mode 0-mode4)
(b) Selection of counters (counter 0- counter 2)
(c) Choosing binary /BCD counters
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
The mode control register is a write only register and the CPU cannot read its contents.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
In the left entry mode, the data is entered from the left side of the display unit.
2. Right Entry Mode
In the right entry mode, the first entry to be displayed is entered on the rightmost display.
16. What are the different types of methods used for data transmission?
The data transmission between two points involves unidirectional or bi-directional transmission
of meaningful digital data through a medium. There are basically there modes of data
transmission
(a) Simplex
(b) Duplex
(c) Half Duplex
In simplex mode, data is transmitted only in one direction over a single communication channel.
For example, a computer (CPU) may transmit data for a CRT display unit in this mode.
In duplex mode, data may be transferred between two transceivers in both directions
simultaneously.
In half duplex mode, on the other hand, data transmission may take pace in either direction, but
at a time data may be transmitted only in one direction. For example, a computer may
communicate with a terminal in this mode. When the terminal sends data (i.e. terminal is sender).
The message is received by the computer (i.e the computer is receiver). However, it is not
possible to transmit data from the computer to terminal and from terminal to the computer
simultaneously.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
20. What are the functional types used in control words of 8251a?
The control words of 8251A are divided into two functional types.
1. Mode Instruction control word
2. Command Instruction control word
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
28. What is the purpose of control word written to control register in 8255?
The control words written to control register specify an I/O function for each I.O port. The bit
D7 of the control word determines either the I/O function of the BSR function.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
16 Marks
1. Draw the Block diagram and explain the operations of 8251 serial communication Interface.
(16)
2. Draw the Block diagram of 8279 and explain the functions of each block. (16)
3. Draw the block diagram of programmable interrupt controller and explain its operations. (16)
4. Discuss in detail about the operation of timer along with its various modes. (16)
5. Draw the Block diagram of DMA controller and explain its operations. (16)
6. Explain the various modes of operation of programmable Peripheral Interface. (16)
7. Explain the 8085 based temperature control system with neat diagram. (16)
8. Draw and Explain how stepper motor can be controlled using 8085. (16)
9. Explain the mode1 and mode 2 operation of 8255.(16)
10. Draw the Block diagram and explain the operations of USART (16)
UNIT V
MICROCONTROLLERS
PART A (2 MARKS)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
5. State the function of RS1 and RS0 bits in the flag register of Intel 8051 microcontroller?
RS1 RS0 Bank Selection
0 0 Bank 0
0 1 Bank 1
1 0 Bank 2
1 1 Bank 3
RS, RS0 – Register bank select bits
6. Write a program using 8051 assembly language to change the date 55H stored in the
lower byte of the data pointer register to AAH using rotate instruction.
MOV DPL, #55H
MOV A, DPL
RL A
Label: SJMP label
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
8. 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 bit is CLR B.7.
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
17. Explain the contents of the accumulator after the execution of the following program
segments:
MOV A, #3CH
MOV R4, #66H
ANL A, R4
A = 3C
R4 = 66
A = 24
18. Write a program to load accumulator A, DPH and DPL with 30H.
MOV A, #30
MOV DPH, A
MOV DPL, A
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
19. Write a program to subtract the contents of R1 of Bank0 from the contents of R0 of
Bank2.
MOV PSW, #10
MOV A, R0
MOV PSW, #00
SUBB A, R1
20. How the RS -232C serial bus is interfaced to 1TL 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.
21. List some of the features of 8096 microcontroller.
a. The 8096 is a 16-bit microcontroller.
b. The 8096 is designed to use in applications which require high speed calculations and
fast I/O operations.
c. The high speed I/O section of an 8096 includes a 16-bit timer, a 16-bit counter, a 4
input programmable edge detector, 4 software timers and a 6-output programmable event
generator.
d. It has 100 instructions, which can operate on bit, byte, word, and double words.
e. The bit operations are possible and these can be performed on any bit in the register
file or in the special function register.
24. List the 8051 instructions that affect the overflow flag.
ADD, ADDC, DIV, MUL, SUBB
25. List the 8051 instructions that always clear the carry flag.
CLR C, DIV, MUL
26. List the 8051 instructions that affect all the flags.
ADD, ADDC and SUBB
16 Marks
1. Describe the architecture of 8051 with a neat diagram. (16)
SCT-DEPARTMENT OF ECE
Microprocessor And Microcontroller
SCT-DEPARTMENT OF ECE