Thursday, January 31, 2013
MICROPROCESSORS & MICROCONTROLLER 2 marks
COMPUTER
SCIENCE AND ENGINEERING
MICROPROCESSORS
& MICROCONTROLLER
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.
2. List few applications of microprocessor-based system.
It
is used:
i. For
measurements,
display and control
of
current,
voltage,
temperature, pressure,
etc.
ii. For traffic control
and industrial tool control. iii. For speed
control of machines.
3. What are the functions
of an
accumulator?
The accumulator is the register associated with the ALU operations
and
sometimes I/O operations. It is an integral part of ALU. It holds one of data to be processed by ALU. It also temporarily stores the result of the operation performed
by
the ALU.
4. List the 16
– bit registers of 8085
microprocessor.
Stack pointer (SP) and Program
counter (PC).
5. List the allowed register pairs
of 8085.
• B-C register pair
• D-E
register pair
• H-L register pair
6. Mention the purpose of SID and SOD
lines
SID
(Serial
input data line):
It is an input line through which the microprocessor accepts serial
data.
SOD (Serial
output data line):
It is an output line through which the microprocessor sends output serial data.
7. What is an Opcode?
The part
of the instruction
that specifies the
operation to be performed
is
called the
operation code or opcode.
8. What is the function of IO/M signal in the 8085?
It is a status signal. It is used to differentiate between memory locations
and I/O operations.
When this signal is low (IO/M = 0) it denotes the memory related operations. When this signal is high (IO/M = 1) it denotes
an
I/O operation.
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.
13. Explain the purpose of the I/O
instructions IN and OUT.
The IN
instruction
is
used to move data
from
an I/O
port into the
accumulator.
The OUT instruction is used to move data from the accumulator to an I/O
port.
The IN & OUT instructions are used only on microprocessor, which use a
separate address
space for interfacing.
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.
15. How many
address
lines
in a 4096 x 8 EPROM CHIP?
12 address lines.
16. Control
signals used for DMA
operation are
HOLD & HLDA.
17. What is meant by
Wait State?
This state is used
by
slow peripheral
devices. The peripheral devices
can
transfer the data to or from the microprocessor by using READY input line. The
microprocessor remains in wait state as long as READY line is low. During the
wait state, the contents of the address, address/data and control buses are held constant.
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
)
19. What is meant by
polling?
Polling or device polling
is a process which identifies the
device that has
interrupted
the microprocessor.
20. What is meant by
interrupt?
Interrupt
is an external
signal that causes a microprocessor
to jump to a
specific subroutine.
21. Explain priority
interrupts
of 8085.
The 8085 microprocessor has five interrupt
inputs. They are TRAP, RST
7.5, RST 6.5, RST 5.5, and INTR. These interrupts have a fixed priority of
interrupt service.
If two or more interrupts go
high
at the same time, the
8085 will service them on priority basis. The TRAP has the highest priority followed bye RST 7.5,
RST 6.5, RST 5.5. The priority of interrupts
in 8085 is shown in the table.
Interrupts
|
Priority
|
TRAP RST 7.5
RST 6.5
RST 5.5
INTR
|
1
2
3
4
5
|
22. What is a microcomputer?
A computer that is designed using a microprocessor as its CPU is called
microcomputer.
23. What is the signal classification of 8085
All the signals
of 8085 can be classified
into 6 groups
• Address
bus
• Data bus
• Control and
status signals
• Power supply and frequency signals
• Externally initiated
signals
• Serial I/O ports
24. What are operations performed on data
in 8085
The various
operations
performed are
• Store 8-bit data
• Perform
arithmetic and logical
operations
• Test
for
conditions
• Sequence the execution
of instructions
• Store data temporarily
during execution in the defined R/W
memory locations called the stack
25. Steps
involved to fetch a
byte in 8085
i. The PC places the
16-bit memory address
on the address bus
ii. The control unit sends the control signal RD to enable the memory
chip
iii. The byte from
the memory location is placed on the data bus
iv. The byte is placed in the instruction decoder of the microprocessor and
the task is carried
out according to the
instruction
26. How many
interrupts
does
8085 have, mention them
The 8085 has 5 interrupt signals; they are INTR, RST7.5, RST6.5,
RST5.5
and
TRAP
27. Basic concepts in memory interfacing
The primary function of memory interfacing is that the microprocessor
should be able to read from and write into a given register of a memory chip. To
perform these operations the microprocessor should
• Be able to select the
chip
• Identify the register
• Enable the appropriate buffer
28. Define instruction cycle, machine cycle and T-state
Instruction cycle is defined, as the time required completing the execution
of an instruction. Machine cycle is defined as the time required completing one operation of accessing memory, I/O or acknowledging an external request. T- cycle is defined
as one subdivision of the operation performed
in one clock period
29. What is an instruction?
An instruction is a binary pattern
entered
through an
input
device
to
command the
microprocessor to perform that
specific function
30. What is the use of ALE
The ALE is used to latch the lower order address so that
it can be available
in T2 and T3 and used for identifying the memory address. During T1 the ALE goes high, the latch is transparent ie, the output changes according to the input data, so the
output of the latch is the
lower order address. When ALE goes low the lower order address is latched
until the next ALE.
31. How many
machine cycles
does
8085 have, mention them
The 8085 have seven
machine cycles.
They
are
• Opcode fetch
• Memory read
• Memory write
• I/O read
• I/O write
• Interrupt
acknowledge
• Bus
idle
32. Explain the signals
HOLD,
READY and SID
HOLD indicates that a peripheral such as DMA controller is requesting
the use of address bus, data bus and control bus. READY is used to delay the
microprocessor read or write cycles until a slow responding peripheral is ready to send
or accept data. SID is
used to accept serial
data
bit by bit
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
|
34. Explain LDA, STA
and
DAA instructions
LDA copies the data byte into accumulator from the memory location
specified by the 16-bit address. STA copies the data byte from the accumulator in
the memory location specified by 16-bit address. DAA changes the contents of
the accumulator from binary to 4-bit
BCD
digits.
35. Explain the different instruction formats with examples
The instruction set
is grouped
into the following formats
• One byte instruction MOV C,A
• Two byte instruction MVI A,39H
• Three byte instruction JMP 2345H
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
37. What is the use of bi-directional buffers?
It is used to increase the driving capacity of the data bus. The data bus of a
microcomputer system is bi-directional, so it requires a buffer that allows the data to flow
in both directions.
38. Give the register organization of 8085
W(8)
Temp. Reg
|
Z(8)
Temp. Reg
|
B(8)
Register
|
C(8)
Register
|
D(8)
Register
|
E(8)
Register
|
H(8)
Register
|
L(8)
Register
|
Stack Pointer(16)
|
|
Program
Counter(16)
|
39. Define stack and explain stack related instructions
The stack is a group of memory locations
in the R/W memory that is used
for the temporary storage
of
binary information
during the
execution of the program. The
stack related instructions are PUSH &
POP
40. Why do we use XRA
A instruction
The XRA A instruction is used to clear the contents of the Accumulator
and store the value 00H.
41. Compare CALL and PUSH instructions
CALL
|
PUSH
|
When CALL is executed the
microprocessor automatically stores the
16-bit address of
the instruction
next to
CALL on
the stack
|
The programmer uses
the instruction PUSH
to save the contents
of the register
pair on the stack
|
When CALL is executed the stack
pointer
is decremented by two
|
When PUSH is executed the
stack
pointer register is
decremented by two
|
42. What is Microcontroller and Microcomputer
Microcontroller is a device that includes microprocessor; memory and I/O
signal lines on a single chip, fabricated using VLSI technology. Microcomputer is
a computer
that is designed using
microprocessor as
its
CPU. It
includes microprocessor,
memory and I/O.
43. Define Flags
The flags are used to reflect the data conditions in the accumulator. The 8085
flags are S-Sign flag, Z-Zero flag, AC-Auxiliary carry flag, P-Parity flag, CY-
Carry flag
D7 D6 D5 D4 D3 D2 D1 D0
S
|
Z
|
|
AC
|
|
P
|
|
CY
|
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.
45. Compare RET and POP
RET
|
POP
|
RET transfers the contents of the top two locations of the stack to the PC
|
POP transfers the contents of the top
two
locations of the stack to the specified register
pair
|
When RET is executed the SP is incremented
by two
|
When POP is executed the SP is incremented
by two
|
Has 8 conditional RETURN instructions
|
No conditional POP
instructions
|
46. 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.
47. 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.
48. 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.
49. Explain
ALIGN & ASSUME
The ALIGN directive forces the assembler to align the next segment at an address
divisible by specified divisor. The format is ALIGN number where number can be 2, 4,
8 or 16. Example ALIGN 8.
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
50. Explain
PTR & GROUP
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.
51. Explain
about MODEL
This directive provides short cuts in defining segments. It initializes memory model
before defining
any
segment.
The memory
model can
be
SMALL,
MEDIUM,
COMPACT or LARGE.
Model
|
Code segments
|
Data segments
|
Small
|
One
|
One
|
Medium
|
Multiple
|
One
|
Compact
|
One
|
Multiple
|
Large
|
Multiple
|
Multiple
|
52. Explain
PROC & ENDP
PROC directive defines the procedures in the program. The procedure name must be unique. After PROC the term NEAR or FAR are used to specify the type of procedure. Example FACT PROC FAR. ENDP is used along with PROC and defines the end of the
procedure.
53. Explain
SEGMENT & ENDS
An assembly program in .EXE format consists of one or more segments. The starts of
these segments are defined by SEGMENT and the end of the segment is indicated by
ENDS directive. Format Name SEGMENT
Name ENDS
54. Explain
TITLE & TYPE
The TITLE directive helps to
control the format of a listing of an assembled
program. It
causes a title for the program to print on line 2 of each page of the program listing.
Maximum 60 characters are allowed.
Format TITLE
text.
TYPE operator tells the assembler to determine the type of specified variable in bytes.
For bytes the assembler gives a value 1, for word 2 & double word 4.
55. Define SOP
The segment override prefix allows the programmer to deviate from the default segment
Eg : MOV CS : [BX] , AL
56. Define variable
A variable is an identifier that is associated with the first byte of data item. In
assembly language statement: COUNT DB 20H, COUNT is the variable.
57. What are procedures
Procedures are a group of instructions stored as a separate program in memory and it
is called from the main program whenever required. The type of procedure depends on
where the procedures are stored in memory. If it is in the same code segment as that of
the main program then
it
is a near procedure otherwise it is a far procedure.
58. Explain
the
linking process
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.
59. Explain
about passing
parameters using
registers with
example
Procedures
process some data
or address variable from
the main program, for
processing it is necessary to pass the address variables or data. This is called passing parameters to procedures. In passing parameters using registers the data to be passed is
stored in
registers & these registers are accessed
in
the procedure to process the data.
CODE SEGMENT MOV AL, DATA
CALL PRO1
PRO1 PROC NEAR MOV INPUT,
AL
RET
PRO1 ENDP CODE ENDS
60. What is recursive procedures
A recursive procedure is a procedure, which calls itself. Recursive procedures are
used to work with complex data structures called trees. If the procedure is called with
N=3, then the N is decremented by 1 after each procedure CALL and the procedure is called until N=0.
61. What are libraries
Library files are collection of procedures that can be used in other programs. These
procedures are assembled and compiled into a library file by the LIB program. The
library file is invoked when a program is linked with linker program. when a library file
is
linked only the required procedures are copied into the program. Use of library files increase s/w reusability & reduce s/w development time.
62. What are Macros
Macro is a group of instruction. The macro assembler generates the code in the program each time where the macro is called. Macros are defined by MACRO & ENDM
directives. Creating macro is similar to creating new opcodes
that can be used in the
program
INIT MACRO MOV AX,
data
MOV DS MOV ES,
AX ENDM
63. How do 8086
interrupts occur
An 8086 interrupt can come from any of the following three sources
• External signals
• Special instructions in the program
• Condition produced by instruction
64. What are the 8086 interrupt types
Dedicated interrupts
• Type 0: Divide by zero interrupt
• Type 1: Single step
interrupt
• Type 2:Non
maskable interrupt
• Type 3: Breakpoint
• Type 4: Overflow interrupt
Software interrupts
• Type 0-255
65. What is interrupt service routine
Interrupt means to break the sequence of operation. While the CPU is executing a
program an interrupt breaks the normal sequence of execution of instructions & diverts
its
execution to some other program. This program to which the control is transferred is called the interrupt service routine.
66. Define BIOS
The IBM PC has in its ROM a collection of routines, each of which performs some specific function such as reading a character from keyboard, writing character to CRT.
This collection of routines is referred to as Basic Input Output System or BIOS.
67. Explain
PUBLIC
For large programs several small modules are linked together. In order that the
modules link together correctly any variable name or label referred to in other modules
must be declared public in the module where it is defined. The PUBLIC directive is used
to tell the assembler that a specified name or label will be accessed from other modules.
Format PUBLIC Symbol.
68. Explain
DUP
The DUP directive can be used to initialize several locations & to assign values to
these locations.
Format Name Data_Type Num DUP (value)
Example TABLE DW 10 DUP (0). Reserves an array of 10 words of memory and
initializes all 10 words with 0.
array name is TABLE.
|
during program execution
|
to macro when defined
|
Machine code for instruction
is
put only once
in the memory
|
Machine code is generated for instruction
each time when macro is called
|
With procedures less memory is required
|
With macro
more memory is required
|
Parameters can
be passed in
registers,
memory locations or stack
|
Parameters passed as part of statement which
calls macro
|
70. What is the purpose of segment registers
in 8086?
There are 4
segment
registers present in 8086. They are
1. Code Segment
(CS ) register
2. Data Segment (DS ) register
3. Stack Segment
(SS ) register
4. Extra Segment (ES ) register
The code segment register gives the address of the current code segment. ie.
It will points out where 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.
71. Define pipelining?
In 8086, to speedup the execution of program, the instructions fetching and
execution of instructions are overlapped each other. This technique is known as
pipelining.
In pipelining, when the n th instruction is executed, the n+1 th instruction is fetched and
thus the processing speed
is increased.
72. Discuss the function of instruction queue in 8086?
In 8086, a 6-byte instruction queue is presented at the Bus Interface Unit
(BIU). It is used to prefetch and store at the maximum of 6 bytes of instruction
code from the memory. Due to this, overlapping instruction fetch with instruction execution
increases the processing speed.
73. 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.
74. What is the function of the signal in 8086?
BHE signal means Bus High Enable signal. The BHE signal is made low when
there is some read or write operation is carried out. ie . When ever the data bus of the system is busy i.e. whenever there is some data transfer then the BHE signal is
made low.
75.What are the predefined interrupts
in 8086?
The various predefined
interrupts are,
DIVISION BY ZERO (type 0) Interrupt. SINGLE STEP (type 1) Interrupt.
NONMASKABLE (type2) Interrupt. BREAK POINT (type 3) Interrupt.
OVER FLOW (type 4) Interrupt.
76. What are the different flag available in status
register of 8086?
There are 6
one
bit flags are present.
They
are,
AF - Auxiliary Carry Flag
CF - Carry Flag
OF - Overflow Flag
SF - Sign Flag PF - Parity Flag
ZF - Zero
Flag
77. List the various addressing
modes present in 8086?
There are 12 addressing modes
present in 8086. They are,
(a) Register and immediate addressing modes
Register addressing modes
Immediate addressing mode
(b) Memory addressing modes.
Direct addressing modes
Register indirect addressing modes
Based addressing modes
Indexed addressing modes
Based Indexed
addressing modes
String addressing modes
(c) I/O addressing modes
Direct addressing mode
Indirect addressing mode
(d) Relative addressing
mode
(e) Implied addressing mode
78. How single stepping can be done in 8086?
By setting the Trace Flag (TF) the 8086 goes to single-step mode. In this mode, after
the execution of each instruction s 8086 generates an internal interrupt and by writing some interrupt service routine we can display the content of desired registers and memory locations.
So it is useful for debugging the program.
79. State the significance of LOCK signal
in 8086?
If 8086 is working at maximum mode, there are multiprocessors are
present. If the system bus is given to a processor then the LOCK signal is made
low. That means the system bus is busy and it cannot be given of any other
processors. After the use of the system bus again the LOCK signal is made high. That
means it is ready to give the system
bus to any processor.
80. 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.
81. What is the clock frequency
of 8086?
|
8086
|
8086-2
|
8086-4
|
Internal clock
Frequency
External Clock Frequency
|
5 MHz
15MHZ
|
8MHz
24MHZ
|
4MHz
12MHZ
|
82. What are the two modes
of operations present in 8086?
i. Minimum
mode (or) Uniprocessor
system
ii. Maximum mode (or) Multiprocessor
system
84. Explain
the process control instructions
STC – It sets the carry flag & does not affect any other flag
CLC – it resets the carry flag to
zero
&does not affect any other flag
CMC – It complements the carry flag & does not affect any other flag
STD –
It
sets the direction flag to
1 so that SI and/or DI can be
decremented automatically after execution of string instruction &
does not affect other flags
CLD – It resets the direction
flag to
0 so
that SI and/or DI can be incremented
automatically after execution of string instruction &
does not affect other flags
STI – Sets the interrupt flag to 1. Enables INTR of 8086.
CLI – Resets the interrupt flagto0.
8086 will not respond
to INTR.
85. Explain
REPEAT-UNTIL statements
REPEAT-UNTIL statements allow executing a series of instructions repeatedly until some condition occurs. The REPEAT defines the start of the loop & UNTIL the end of
the loop. UNTIL
has a condition when the condition is true the loop is terminated
86. What is multiprogramming?
If more than one process is carried out at the same time, then it is know as multiprogramming.
Another definition
is
the
interleaving
of
CPU and
I/O operations
among several programs is called multiprogramming.
To improve the utilization of CPU and I/O devices, we
are designing to
process
a set of independent
programs concurrently by a single CPU.
This technique is known as multiprogramming
87. Differentiate between absolute and linear select decoding?
Absolute decoding
|
Linear decoding
|
All higher address
lines are defined
to select the
memory or I/O
device
|
Few
higher address
lines are
decoded to select the
memory or I/O
|
|
device
|
More h/w
is required to design
decoding logic
|
Hardware required
to design
decoding logic is
less
|
Higher cost for decoding
circuit
|
Less cost for decoding circuit
|
No multiple address
|
Has a
disadvantage of multiple
addressing
|
Used in large systems
|
Used in small systems
|
Subscribe to:
Posts (Atom)