Professional Documents
Culture Documents
The buses are group of lines that carries data ,address or control signals.
The CPU has multiplexed lines. i.e same line is used to carry different signals
(i.e both data and address) are called system bus. All the slaves in the system
are connected to the same system bus. At any time instant communication takes
place between the master and one of the slaves. the processor selects a slave by
sending an address. When a slave selected it comes to the normal logic and
communicate with the processor.
CPU:- The cpu of 8086 is capable in performing ARITHEMATIC &
LOGICAL and making decision during program execution. this can be divided
in to three sections as arithmetic/logic unit (ALU),register unit and control unit.
Input :- the input unit is required to get data and instructions in binary form
from the outside to the microprocessor.(EX-Keyboard, video unit, a card reader,
a/d converters etc…)
Output:-- The output unit transfer the processed data from the microprocessor
to the out put devices such as LED, CRT’s, VEDIO MONITER,PRINTERS
etc……..
Memory:- Memory devices stores the program and data, and provides that
information to the microprocessor whenever necessary.
1MB,which was 16 times more memory than 8085.One another feature found in
8086 was a small 6-byte instruction queue, that prefetched a few instructions
before they were executed. Note that these types of microprocessors were called
CISC (Complex Instruction Set Computers) because of the number and
complexity of instructions. The popularity of the Intel family was ensured in
1981, when IBM Corporation decided to use the 8088 microprocessor in its
Personal Computer.
In 1983, Intel introduced the 80286 microprocessor; an updated version
of 8086.It is also a 16-bit microprocessor. It was almost identical to the 8086
and 8088, except memory size. The memory size of 80286 is 16MB.
In 1986, Intel released 80386 microprocessor keeping in mind faster
microprocessor speeds, more memory size and wider data paths. It is 32-bit
microprocessor. So, it contained 32-bit data bus. The memory size is 4GB (32-
bit address bus). Some of the advanced processors developed by Intel
Corporation are 80486, Pentium, PentiumII, PentiumII Xeaon, Pentium III,
Pentium-4, etc.
BUS INTERFACING UNIT: The bus interfacing unit in 8086 provides the
interface to the outside world. The BIU in responsible for all memory access
and I/O access by the 8086. And BIU communicates with devices outside the
microprocessors like fetches instructions from memory, reads data from ports
and memory, and writes data to ports and memory. It contains the following
blocks:
Instruction Byte Queue
Segment Registers
Adder (Physical Address Generation)
Instruction Pointer
THE QUEUE: To speed up program execution, the BIU fetches six instruction
bytes ahead of time from the memory. The BIU stores these perfected bytes in a
first-in-first-out register set called a queue. When the EU is ready for its next
instruction, it simply reads the instruction byte for the instruction from the
queue in the BIU. This is much faster than sending out an address to the system
memory and waiting for memory to send back the next instruction byte or bytes.
The process is analogous to the way a bricklayer’s assistant fetches bricks
ahead of time and keeps a queue of bricks lined up so that the brick layer can
GOGA SUBRAMANYAM Page 6
7|Page
just reach out and grab a brick when necessary. Except in the cases of JMP and
CALL instructions, where the queue must be damped and then reloaded starting
from a new address. So, the queue operates on the principle first in first out
(FIFO).So that the execution unit gets the instructions for execution in the order
they are fetched. This prefetch-and-queue scheme greatly speeds up processing.
Fetches the next instruction while the current instruction executes is called
pipelining.
Instruction pointer:( IP) is a 16-bit register, Instruction pointer points(store the
adders) to be fetched and executed next instruction .
Segment Pointer or Segment Registers:- Most of the registers contain
data/instruction offsets within 64 KB memory segment. There are four different
64 KB segments for instructions, stack, data and extra data. To specify where in
1 MB of processor memory these 4 segments are located the processor uses four
segment registers:
Code segment (CS) is a 16-bit register containing address of 64 KB segment
with processor instructions. The processor uses CS segment for all accesses to
instructions referenced by instruction pointer (IP) register.
Stack segment (SS) is a 16-bit register containing address of 64KB segment
with program stack. It holds the stack information hence stack is a portion of
memory set aside to store address and data when the program is processed.
Data segment (DS) is a 16-bit register containing address of 64KB segment
with program data. By default, the processor assumes that all data referenced by
general registers (AX, BX, CX, DX) and index register (SI, DI) is located in the
data segment.
Extra segment (ES) is a 16-bit register containing address of 64KB segment,
usually with program data. By default, the processor assumes that the DI
register references the ES segment in string manipulation instructions.
EXECUTION UNIT(E.U):-The execution unit is responsible for executing the
instruction fetched by the BIU it performs four kinds of operations .
These are fetching, decode, execute and write operation
The functional parts of EU:-
General purpose registers
Pointer and index registers
Arithmetic and logic unit (ALU)
Flag register
Control unit.
Base register(BX) consists of two 8-bit registers BL and BH, which can be
combined together and used as a 16-bit register BX. BL in this case contains the
low-order byte of the word, and BH contains the high-order byte. BX register
usually contains a data pointer used for based, based indexed or register indirect
addressing.
Count register(CX) consists of two 8-bit registers CL and CH, which can be
combined together and used as a 16-bit register CX. When combined, CL
register contains the low-order byte of the word, and CH contains the high-order
byte. Count register can be used in Loop, shift/rotate instructions and as a
counter in string manipulation,
Data register(DX) consists of two 8-bit registers DL and DH, which can be
combined together and used as a 16-bit register DX. When combined, DL
register contains the low-order byte of the word, and DH contains the high-
order byte. Data register can be used as a port number in I/O
operations. In integer 32-bit multiply and divide instruction the DX register
contains high-order word of the initial or resulting number
Pointer and index registers:- 8086 has two pointer registers (SP,BP),these
are used for storing the offset-address of data elements that are stored in stack.
It has two index registers (SI,DI). These are used in array processing and
string operations.
Stack Pointer (SP) is a 16-bit register and it pointing (storing address) to the
top stack.
Base Pointer (BP) is a 16-bit register pointing to data in stack segment. BP
register is usually used for based, based indexed or register indirect addressing.
Source Index (SI) is a 16-bit register. SI is used for indexed, based indexed and
register indirect addressing, as well as a source data address in string
manipulation instructions. Thus this register is useful in accessing contiguous
memory locations.
Destination Index (DI) is a 16-bit register. DI is used for indexed, based
indexed and register indirect addressing, as well as a destination data address in
string manipulation instructions.
Flags is a 16-bit register containing 9 1-bit flags:
Types Of Segmentation –
1. Overlapping Segment – A segment starts at a particular address and its
maximum size can go up to 64kilobytes. But if another segment starts along this
64kilobytes location of the first segment, then the two are said to
be Overlapping Segment.
2. Non-Overlapped Segment – A segment starts at a particular address and its
maximum size can go up to 64kilobytes. But if another segment starts before
this 64kilobytes location of the first segment, then the two segments are said to
be Non-Overlapped Segment.
Advantages of the Segmentation The main advantages of segmentation are as
follows:
It provides a powerful memory management mechanism.
Data related or stack related operations can be performed in different
segments.
Code related operation can be done in separate code segments.
It allows to processes to easily share data.
It allows to extend the address ability of the processor, i.e. segmentation
allows the use of 16 bit registers to give an addressing capability of 1
Megabytes. Without segmentation, it would require 20 bit registers.
It is possible to enhance the memory size of code data or stack segments
beyond 64 KB by allotting more than one segment for each area.
Pin(1 &20):- The 8086 is a 40 pin DIP (Dual Inline Package) in that
these are two ground pis
Pin 40(Vcc): The 8086 is a 40 pin DIP require a single +5v power
supply.
AD0 to AD15(Pin no: 2 to 16 & 39): These are the time multiplexed
memory I/O address and data lines. Address remains on the lines during
T1 state, while the data is available on the data bus during T2, T3, Tw
and T4. i.e., provision for relocation is done. to be time
NMI (NON-MASKABLE INTERRUPT)(pin 17): This is a edge
triggered input and hardware interrupt pin which causes Type 2 interrupt.
Whenever an external device activates this pin the microprocessor will
interrupt the present program execution and execute the interrupt service
routine. And it can’t mask-able with any instruction.
INTR(Interrupt)(pin 18): This is a level triggered input and hardware
interrupt pin . This interrupt is mask-able (Enable by some instruction i.e
STI (set interrupt flag) & CLI(clear interrupt flag)),and is non vectored.
CLK(pin 19): for timing purpose microprocessor needs a clock .the 8086
comes in different clock speeds, with no change in internal architecture.
8086-1 works at 10MHz
8086-2 works at 8MHz
8086 works at 5MHz
RESET(pin 21) causes the processor to immediately terminate its present
activity. The signal must be active HIGH for at least four clock cycles. It
restarts execution
Code segment contents will be FFFFH
IP registers contents 0000H
DS,ES,SS will be initialized to 0000H
Flag registers contents 0000H
also the processor gets into disable interrupt state(Except NMI).
3.LOCK(pin 29). This output pin indicates that other system bus
master will be prevented from gaining the system bus, while the
LOCK signal is low. The LOCK signal is activated by the ‘LOCK’
prefix instruction and remains active until the completion of the
next instruction. When the CPU is executing a critical instruction
GOGA SUBRAMANYAM Page 13
14 | P a g e
which requires the system bus, the LOCK prefix instruction ensures
that other processors connected in the system will not gain the
control of the bus.
4.RQ0/GT0 and RQ1/GT1(pin 30 & 31)
/grant) these pins are used by other local bus master in maximum
mode to force the processor to release the local bus at the end of the
processor‘s current bus cycle. Each of the pin is pin is bi-
directional.
Q)What is the use of operating 8086 in minimum mode? Explain.
Usually, EPROM is used for monitor storage, while RAM for user’s
program storage. A system may contain I/O devices.
Q)What is the use of operating 8086 in maximum mode? Expain?
MN/MX
pin to +5v power supply.
In this mode all the control signals are given out by 8086 it self. Control
signals are memory or I/O read ,write , ALE ,DEN and DT/R.
There is a single microprocessor in the minimum mode is called
MASTER, the remaining components in the system are Latch,
Tranreceivers, Clock generator, memory and I/O devices are SLAVES.
The Latches are generally buffered output (like D-Flip flop).used for
separating the valid address from the multiplexed address/data signals
and are controlled by ALE signal generated by 8086 CPU.
Tranreceiver are the bi-directional buffers some time called as data
amplifiers. They are controlled by two signals namely DEN(data
enable),DT/R(data transmit /receive) generated by 8086 CPU.
Usually EPROMS are used for program (O.S) storage, while RAM for
users data storage. A system may contain I/O devices for communication
with processor as well as some special purpose I/O devices.
Timing Diagrams for Memory-Read bus-cycle of 8086 system
During T1 or the 1st clock pulse, the read bus cycle starts and valid
address is latched together with setting minimum and maximum mode,
input output or memory interface, data transmit and receive mode of
buffer IC.
During T2 , the Read control signals are issued and data enable signal is
asserted. Note that during this state the READY signal is also checked to
insert wait status, if needed
During T3 , the data from the memory is read by sampling the data bus at
the end of T3
During T4 , all bus signals are deactivated in preparation for the next
clock cycle.
ground(vss)
In multi processor system it operate in maximum mode , in that more than
one microprocessor is used for master . Remaining Latch, Memory
devices (ROM & RAM)and I/O devices are slaves.
In ths mode the processor drives the status signals S2,S1,S0.another chip
(IC8288)called bus controller drives the control signals using status
information. those control signals are RD and WR(for memory and I/O
devices), DEN,DT/R ALE , etc..
GOGA SUBRAMANYAM Page 17
18 | P a g e
The outputs of the bus controller are the Control Signals, namely DEN,
DT/R*, IORC*, IOWTC*, MWTC*, MRDC*, ALE etc
The pins in 8086 are RQ0/GT0 ,RQ1/GT1 and LOCK are used for
multi processing purpose. When other master requires a bus 8086 will
suspend the process and grant the system bus to the other master.
Timing Diagrams for Memory-Read bus-cycle of 8086 system
During T1 or the 1st clock pulse, the master sets status signals on
s0,s1,s2 according that signals bus controller will generate control
signals .the read bus cycle starts and valid address is latched together
with setting minimum and maximum mode, input output or memory
interface, data transmit and receive mode of buffer IC.
During T2 , the Read control signals are issued and data enable signal is
asserted. Note that during this state the READY signal is also checked to
insert wait status, if needed
During T3 , the data from the memory is read by sampling the data bus at
the end of T3
During T4 , all bus signals are deactivated in preparation for the next
clock cycle.
The lowest five types are dedicated to specific interrupts, such as the
divide-by-zero interrupt, the single step interrupt and the nonmaskable interrupt.
Later in this chapter we explain the operation of these interrupts in detail.
Interrupt types 5 to 31 are reserved by Intel for use in more complex
microprocessors such as the 80286, 80386, and 80486. In a later chapter we
discuss some of these interrupt types. The upper 224 interrupt types, from 32 to
255, are available for you to use for hardware or software interrupts.
(a) Type 0 interrupt (or Divide-by-zero interrupt)
If the quotient resulting from a DIV (divide) instruction or an IDIV
(integer divide) instruction is too large such that it cannot be accommodated in
the destination register, a divide error occurs. Then 8086 perform a Type 0
interrupt. This then passes the control to a service subroutine at addresses
corresponding to IP0 and CS0 at 0000 H and 0002 H respectively in the pointer
table.
(b) Type 1 interrupt (Single Step interrupt)
The single step interrupt will be enabled only if the trap flag (TF) bit is
set (= 1). The TF bit can be set/reset by software.Single step control is used for
debugging in assembly language. In this mode the processor executes one
instruction and then stops. The contents of various registers and memory
locations can be examined. If the results are found to be ok, then a command
can be inserted for execution of the next instruction. Trap flag cannot be set
directly. This is done by pushing the flags on the stack, changes are made and
then they are popped.
(c) Type 2 interrupt (non-maskable NMI interrupt)
Type 2 interrupt is the non-maskable NMI interrupt and is used for some
emergency situations like power failure. When power fails, an external circuit
detects this and sends an interrupt signal via NMI pin of 8086. The DC supply
remains on for atleast 50 ms via capacitor banks so that the program and data
remaining in RAM locations can be saved, which were being executed at the
time of power failure.
(d) Type 3 interrupt (break point interrupt)
Type 3 interrupt is a break point interrupt. The program runs up to the
break point when the interrupt occurs. This is achieved by inserting INT 3 at the
point the break is desired. The ISS corresponding to Type 3 interrupt saves the
register contents in the stack and can also be displayed on CRT and the control
is returned to the user. This is used as a software debugging tool, like single
stepping method.
(e) Type 4 interrupt (overflow interrupt)
The software instruction INTO (interrupt on overflow) is inserted in a
program immediately after an arithmetic operation is performed. Insertion of
INTO implements a Type 4 interrupt. When the signed result of an arithmetic
operation on two signed numbers is too large to be stored in the destination
register or else in a memory location, an overflow occurs and the OF (overflow
flag) is set. This initiates INT4 instruction and the program control moves over
to the starting address of the ISS, which corresponds to IP4 and CS4. These two
are stored at address locations 0010 H and 0012 H respectively.
1.12 MEMORY ADDRESSING MECHANISM:
The 8086 based system will have two sets of memory ic‘s one set for even bank
another set for odd bank. The data lines D0-D7 are connected to even bank and
the data lines D8 –D15 are connected to odd bank. The even bank and odd bank
are selected by using control signals ‗BHE‘ and ‗A‘. The memory banks are
selected when these signals are low. Any memory location in the memory is
selected by the address line A1 to A19.
Accessing a Byte-data in a 8086-based Memory System(LOW BANK):
The two bank memory module of 8086 based storage system requires
one bus-cycle to read/write a data-byte.
To access a Byte of data in Low-bank, valid address is provided via
address pins A1 to A19 together with A0=’0’ and BHE=’1’.