unit 4 notes micro processor
unit 4 notes micro processor
Features of Microprocessor
It is a 16-bit Microprocessor (μp).It has 16 bits ALU
It has 20 bit address bus can access up to 2 = 1 MB memory locations.
It has a 16bit data bus. It can read or write data to a memory/port either 16bits or 8 bit
at a time. It can support up to 64K I/O ports.
It provides 14, 16 -bit registers.
Frequency range of 8086 is 6-10 MHz
It has multiplexed address and data bus AD0- AD15 and A16 – A19.
It requires single phase clock with 33% duty cycle to provide internal timing.
It can prefetch up to 6 instruction bytes from memory and queues them in order to
speed up instruction execution.
It requires +5V power supply.
A 40 pin dual in line package.
8086 is designed to operate in two modes, Minimum mode and Maximum mode.
The minimum mode is selected by applying logic 1 to the MN / MX# input pin. This
is a single microprocessor configuration.
The maximum mode is selected by applying logic 0 to the MN / MX# input pin. This
is a multi-microprocessors configuration.
Intel 8086 is a 16 bit processor. It has 16-bit data bus and 20-bit address bus. The internal
architecture of Intel 8086 is divided into two units,
Memory Interface: The Bus Interface Unit (BIU) generates the 20-bit physical memory
address and provides the interface with external memory (ROM/RAM). 8086 has a single
memory interface.
Instruction Byte queue: To speed up the execution, 6-bytes of instruction are fetched in
advance and kept in a 6- byte Instruction Queue while other instructions are being executed
in the Execution Unit (EU).
Segment registers: There are four 16-bit segment registers, viz., the code segment (CS), the
stack segment (SS), the extra segment (ES), and the data segment (DS). The processor uses
CS segment for all accesses to instructions referenced by instruction pointer (IP) register.
Adder: 8086's BIU produces the 20-bit physical memory address by combining a 16-bit
segment address with a 16-bit offset address using the adder circuit.
Execution Unit:
Control unit: The instructions fetched by BIU in the instruction byte queue are decoded
under the control of timing and control signals.
Arithmetic and Logic Unit (ALU): Execution unit has a 16 bit ALU, which performs
arithmetic & logic operations.
General purpose register unit: All general registers of the 8086 microprocessor can be used
for arithmetic and logic operations. The general registers are: Accumulator register AL (8
bit), AX (AL & AH for 16 bit), Base register, Count register, Data register , Stack Pointer
(SP), Base Pointer (BP), Source Index (SI), Destination Index (DI).
Flags: It is a 16-bit register containing 9 1-bit flags: Overflow Flag (OF), Direction Flag
(DF), Interrupt-enable Flag (IF), Single-step Flag (TF), Sign Flag (SF), Zero Flag (ZF),
Auxiliary carry Flag (AF), Parity Flag (PF), Carry Flag (CF).
FLAG REGISTER
Flag Register contains a group of status bits called flags that indicate the status of the CPU or
the result of arithmetic operations.
There are two types of flags:
1. The status flags which reflect the result of executing an instruction. The programmer
cannot set/reset these flags directly.
2. The control flags enable or disable certain CPU operations. The programmer can set/reset
these bits to control the CPU's operation.
Control Flags: There are three control flags
1. The Direction Flag (D): This is directional flag. This is used in string related operations.
D = 1, then the string will be accessed from higher memory address to lower memory
address, and if D = 0, it will do the reverse.
2. The Interrupt Flag (I): This is interrupt flag. If I = 1, then Microprocessor unit will
recognize the interrupts from peripherals. For I = 0, the interrupts will be ignored
3. The Trap Flag (T): This trap flag is used for on-chip debugging. When T = 1, it will work
in a single step mode. After each instruction, one internal interrupt is generated. It helps to
execute some program instruction by instruction.
Status Flags: There are six status flags
1. The Carry Flag (C): This is carry bit. If some operations are generating carry after the
operation this flag is set to 1
2. The Overflow Flag (O): The overflow flag is set to 1 when the result of a signed
operation is too large to fit.
3. The Sign Flag (S): After any operation if the MSB is 1, then it indicates that the number is
negative. And this flag is set to 1
4. The Zero Flag (Z): If the total register is zero, then only the Z flag is set
5. The Auxiliary Carry Flag (A): When some arithmetic operations generates carry after
the lower half and sends it to upper half, the AC will be 1
6. The Parity Flag (P): This is even parity flag. When result has even number of 1, it will be
set to 1, otherwise 0 for odd number of 1s
0 0 No operation
S0, S1, S2
These are the status signals that provide the status of operation, which is used by the Bus
Controller 8288 to generate memory & I/O control signals. These are available at pin 26, 27,
and 28. Following is the table showing their status –
S2 S1 S0 Status
0 0 0 Interrupt acknowledgement
0 0 1 I/O Read
0 1 0 I/O Write
0 1 1 Halt
1 0 0 Opcode fetch
1 0 1 Memory read
1 1 0 Memory write
1 1 1 Passive
LOCK
When this signal is active, it indicates to the other processors not to ask the CPU to leave the
system bus. It is activated using the LOCK prefix on any instruction and is available at pin
29.
RQ/GT1 and RQ/GT0
These are the Request/Grant signals used by the other processors requesting the CPU to
release the system bus. When the signal is received by CPU, then it sends acknowledgment.
RQ/GT0 has a higher priority than RQ/GT1.
PIPELINING in 8086
Performing different task simultaneously by different unit where output of one unit
will become the input of the next unit.
In pipelined processor, fetch, decode and execute operation are performed
simultaneously or in parallel. When first instruction is being decoded, same time code
of the next instruction is fetched.
When first instruction is getting executed, second one’s is decoded and third
instruction code is fetched from memory. This process is known as pipelining. It
improves speed of operation to great extent.
Advantage of Microprocessor
High-speed processing
Brings intelligence to the system
Is flexible in nature
Has a compact size
Is easy to maintain
Disadvantage of Microprocessor
Application of Microprocessor
Mobile phones
Automobiles
CD/DVD players
Washing machines
Cameras
Security alarms
Keyboard controllers
Microwave oven
Watches
Mp3 players
Evolution of Microprocessor
Microproce Year Instructio Pins Clock
ssor n per frequency
second
8288 bus controller- Address form the address bus is latched into 8282 (8-
bit latch). Three such latches are required because address bus is 20 bit.
The data bus is operated through 8286 8-bit transceiver. Two such
transceivers are required, because data bus is 16-bit. The transceivers are
enabled the DEN signal, while the direction of data is controlled by the
DT/R signal. DEN is connected to OE’ and DT/ R’ is connected to T. Both
DEN and DT/ R’ are given by 8288 bus controller.
Control signals for all operations are generated by decoding S’2, S’1 and
S’0 using 8288 bus controller.
S’2 S’1 S’0 output
0 0 0 Interrupt Acknowledge INTA’
0 0 1 Read I/O port IORC’
0 1 0 Write I/O port IOWC’ and AIOWC’
0 1 1 Halt
1 0 0 Instruction Fetch MRDC’
1 0 1 Memory read MRDC’
Bus request is done using RQ’ / GT’ lines interfaced with 8086.
RQ0/GT0 has more priority than RQ1/GT1.
INTA’ is given by 8288, in response to an interrupt on INTR line of 8086.
In max mode, the advanced write signals get enabled one T-state in advance
as compared to normal write signals. This gives slower devices more time to
get ready to accept the data, therefore it reduces the number of cycles.
In minimum mode, 8086 is the only processor in the system which provides
all the control signals which are needed for memory operations and I/O
interfacing.
Here the circuit is simple but it does not support multiprocessing.
The other components which are transceivers, latches, 8284 clock generator,
74138 decoder, memory and I/O devices are also present in the system.
Clock is provided by 8284 clock generator.
8288 bus controller- Address form the address bus is latched into 8282 (8-
bit latch). Three such latches are required because address bus is 20 bit.
They are used to separate the valid address from the multiplexed
Address/data bus by using the control signal ALE, which is connected to
strobe (STB) of 8282. The ALE is active high signal.
(TWO MARK)
Physical Address: The address given by BIU is 20 bit called as physical address.
It is the actual address of the memory location accessed by the microprocessor. It is
calculated as
Effective Address: Effective address or the offset address is the offset for a
memory operand. It is an unassigned 16 bit number that gives the operand's
distance in bytes from the beginning of the segment. It is calculated as
The 8086 addresses a segmented memory. The complete physical address which is
20-bits long is generated using segment and offset registers each of the size 16-
bit.The content of a segment register also called as segment address, and content of
an offset register also called as offset address. To get total physical address, put the
lower nibble 0H to segment address and add offset address. The figure shows
formation of 20-bit physical address.
For Eg: Calculate the physical address for the given CS=3420H, IP=689AH.
PA=Segment address*10H+offset address
= 3420*10H+689A
=3AA9A