SlideShare a Scribd company logo
1 of 39
Unit I :
Introduction to
Microprocessor
Architecture of 8086 and 80386DX,
Register set, Flags, Physical address space
of 8086, Data types, Addressing Modes,
80386DX Instruction Set.
Mrs. K. H. Wanjale
VIIT,Pune
Basic 8086 Architecture
Mrs. K. H. Wanjale
VIIT,Pune
 Term “16-bit” means that its arithmetic logic unit, internal
registers, and most of its instructions are designed to
work 16-bit binary words.
 It has 16-bit data bus and 20-bit address bus.
 Words will be stored in two consecutive memory
locations.
 If the first byte of a word is at an even address, the 8086
can read the entire word in one operation.
 If the first byte of the word is at an odd address, the 8086
will read the first byte in one operation, and the second
byte in another operation.
Mrs. K. H. Wanjale
VIIT,Pune
 The 8086 CPU is divided into two independent
functional units:
 Bus Interface Unit (BIU)
 Execution Unit (EU)
 The Bus Interface Unit
 The BIU handles all data and addresses on the buses
for the execution unit such as it sends out addresses,
fetches instructions from memory, reads data from
ports and memory as well as writes data to ports and
memory.
Mrs. K. H. Wanjale
VIIT,Pune
 The function of BIU is to:
◦ Fetch the instruction or data from memory.
◦ Write the data to memory.
◦ Write the data to the port.
◦ Read data from the port.
Mrs. K. H. Wanjale
VIIT,Pune
Instruction Queue
 To increase the execution speed, BIU fetches as many
as six instruction bytes ahead to time from memory.
 The prefetched instruction bytes are held for the EU
in a first in first out group of registers called
a instruction queue.
 When the EU is ready for its next instruction, it
simply reads the instruction from this instruction
queue.
 This is much faster than sending out an address to the
system memory and to send back the next instruction
byte.
 Fetching the next instruction while the current
instruction executes is called pipelining.
Mrs. K. H. Wanjale
VIIT,Pune
Segment Registers
 The BIU contains four 16-bit segment registers. They
are:
◦ Extra segment (ES) register
◦ Code segment (CS) register
◦ Data segment (DS) register
◦ Stack segment (SS) register.
◦ These segment registers are used to hold the upper 16 bits
of the starting address for each of the segments. The part of
a segment starting address stored in a segment register is
often called the segment base.
Mrs. K. H. Wanjale
VIIT,Pune
 Code Segment (CS): The CS register is used for
addressing a memory location in the Code Segment
of the memory, where the executable program is
stored.
 Data Segment (DS): The DS contains most data used
by program. Data are accessed in the Data Segment
by an offset address or the content of other register
that holds the offset address.
 Stack Segment (SS): SS defined a section of
memory to store addresses and data while a
subprogram executes.
 Extra Segment (ES): ES is additional data segment
that is used by some of the string to hold the extra
destination data. Mrs. K. H. Wanjale
VIIT,Pune
Instruction Pointer (IP)
 In the BIU, the next register, below the segment
register is instruction pointer. The instruction pointer
(IP) holds the 16-bit address of the next code byte
within this code segment.
Mrs. K. H. Wanjale
VIIT,Pune
The Execution Unit
 The execution unit (EU) tells the BIU where to fetch
instructions or data from, decodes instructions, and
executes instructions.
 The functional parts of the execution unit are control
circuitry or system, instruction decoder, and
Arithmetic logic unit (ALU).
 Control circuitry to perform various internal
operations.
 A decoder in the EU translates instructions fetched
from memory to generate different internal or
external control signals that required performing the
operation.
Mrs. K. H. Wanjale
VIIT,Pune
The Execution Unit
 The EU has a 16-bit ALU, which can perform
arithmetic operations such as add, subtract etc. and
logical operations such as AND, OR, XOR,
increment, decrement etc.
 The functions of execution unit are:
◦ To tell BIU where to fetch the instructions or data from.
◦ To decode the instructions.
◦ To execute the instructions.
Mrs. K. H. Wanjale
VIIT,Pune
UNIVERSITY QUESTIONS on 8086
Q.1)Define microprocessor. Give some features of
8086 microprocessor. [3]
Q.2) Enlist difference between 8086 and 80386.[3]
Q.3) How many segment registers are used by
8086?Mention their use.[3]
Mrs. K. H. Wanjale
VIIT,Pune
Flag Registers of 8086
Flag Register of 8086
Mrs. K. H. Wanjale
VIIT,Pune
Flag Registers of 8086
 Flags Register determines the current state of the
processor.
 They are modified automatically by CPU after
mathematical operations, this allows to determine the
type of the result, and to determine conditions to
transfer control to other parts of the program.
 8086 has 9 flags and they are divided into two
categories:
◦ Conditional Flags
◦ Control Flags
Mrs. K. H. Wanjale
VIIT,Pune
1 ) Conditional Flags
 Conditional flags represent result of last arithmetic or
logical instruction executed. Conditional flags are as
follows:
 Carry Flag (CF): This flag indicates an overflow
condition for unsigned integer arithmetic. It is also
used in multiple-precision arithmetic.
 Auxiliary Flag (AF): If an operation performed in
ALU generates a carry/barrow from lower nibble
(i.e. D0 – D3) to upper nibble (i.e. D4 – D7), the AF
flag is set i.e. carry given by D3 bit to D4 is AF flag.
This is not a general-purpose flag, it is used
internally by the processor to perform Binary to BCD
conversion. Mrs. K. H. Wanjale
VIIT,Pune
 Parity Flag (PF): This flag is used to indicate the
parity of result. If lower order 8-bits of the result
contains even number of 1’s, the Parity Flag is set and
for odd number of 1’s, the Parity Flag is reset.
 Zero Flag (ZF): It is set; if the result of arithmetic or
logical operation is zero else it is reset.
 Sign Flag (SF): In sign magnitude format the sign of
number is indicated by MSB bit. If the result of
operation is negative, sign flag is set.
 Overflow Flag (OF): It occurs when signed numbers
are added or subtracted. An OF indicates that the
result has exceeded the capacity of machine.
Mrs. K. H. Wanjale
VIIT,Pune
Control Flags
Control flags are set or reset deliberately to control the
operations of the execution unit. Control flags are as follows:
 Trap Flag (TP):
◦ It is used for single step control.
◦ It allows user to execute one instruction of a program at a
time for debugging.
◦ When trap flag is set, program can be run in single step
mode.
 Interrupt Flag (IF):
◦ It is an interrupt enable/disable flag.
◦ If it is set, the maskable interrupt of 8086 is enabled and if it
is reset, the interrupt is disabled.
◦ It can be set by executing instruction sit and can be cleared
by executing CLI instruction.
Mrs. K. H. Wanjale
VIIT,Pune
Direction Flag (DF)
◦ It is used in string operation.
◦ If it is set, string bytes are accessed from
higher memory address to lower memory
address.
◦ When it is reset, the string bytes are accessed
from lower memory address to higher memory
address.
Mrs. K. H. Wanjale
VIIT,Pune
Sr. No. Parameters 8086 Microprocessor 80386 Microprocessor
1 Instruction Length Limit It has no instruction length
limit.
If it encounters instruction
length longer than 15 byte
it generates an exception
13.
2 Size of address bus Uses 20 bit address bus to
access 1MB of memory
Uses 32 bit address bus to
access 1MB of memory
3 Clock Counts Requires More clock cycles
to execute an instruction.
Requires Less clock cycles
to execute an instruction
4 Divide exception After divide exception, it
leaves the CS:IP value
pointing to the next
instruction.
After divide exception, it
leaves the CS:IP value
pointing to the failed
instruction.
5 IDIV exception An unsuccessful IDIV
instruction causes the 8086
to produce an exception.
An unsuccessful IDIV
instruction cause the 80386
to generate a largest
negative number as a
quotient.
6 Push SP 8086 pushes the SP value
after it has been
incremented.
80386 pushes the SP value
before it has been
incremented
Mrs. K. H. Wanjale
VIIT,Pune
FEATURES OF 80386:
Two versions of 80386 are commonly available:
1) 80386DX
2)80386SX
80386DX 80386SX
1) 32 bit address bus 1) 24 bit address bus 32bit
data bus 16 bit data bus
2) Packaged in 132 pin ceramic 2) 100 pin flat
pin grid array(PGA) package
3) Address 4GB of memory 3) 16 MB of
memory
Mrs. K. H. Wanjale
VIIT,Pune
80386SX was developed after the DX for application that didn’t
require the full 32-bit bus version.It is found in many PCs use
the same basic mother board design as the 80286.Most
application less than the 16MB of memory ,so the SX is
popular and less costly version of the 80386 microprocessor.
 The 80386 cpu supports 16k no:of segments and thus
total virtual memory space is 4GB *16 k=64 tera bytes
Memory management section supports
 Virtual memory
Paging
4 levels of protection
20-33 MHz frequency
Mrs. K. H. Wanjale
VIIT,Pune
Architecture of 80386
 The Internal Architecture of 80386 is divided into 3
sections.
◦ Central processing unit(CPU)
◦ Memory management unit(MMU)
◦ Bus interface unit(BIU)
 Central processing unit is further divided into
Execution unit(EU) and Instruction unit(IU)
 Execution unit has 8 General purpose and 8
Special purpose registers which are either used
for handling data or calculating offset addresses.
Mrs. K. H. Wanjale
VIIT,Pune
Mrs. K. H. Wanjale
VIIT,Pune
•The Instruction unit decodes the opcode bytes
received from the 16-byte instruction code queue and
arranges them in a 3- instruction decoded instruction
queue.
•After decoding them pass it to the control section for
deriving the necessary control signals. The barrel
shifter increases the speed of all shift and rotate
operations.
• The multiply / divide logic implements the bit-shift-
rotate algorithms to complete the operations in
minimum time.
•Even 32- bit multiplications can be executed within
one microsecond by the multiply / divide logic.
Mrs. K. H. Wanjale
VIIT,Pune
•The Memory management unit consists of
 Segmentation unit and
 Paging unit.
•Segmentation unit allows segments of size 4Gbytes at
max.
•The Paging unit organizes the physical memory in terms
of pages of 4kbytes size each.
•Paging unit works under the control of the segmentation
unit, i.e. each segment is further divided into pages. The
virtual memory is also organizes in terms of segments and
pages by the memory management unit.
Mrs. K. H. Wanjale
VIIT,Pune
•The Segmentation unit provides a 4 level protection
mechanism for protecting and isolating the system code
and data from those of the application program.
•Paging unit converts linear addresses into physical
addresses.
•The control and attribute PLA checks the privileges at
the page level. Each of the pages maintains the paging
information of the task. The limit and attribute PLA
checks segment limits and attributes at segment level to
avoid invalid accesses to code and data in the memory
segments.
•The Bus control unit has a prioritizer to resolve the
priority of the various bus requests.This controls the
access of the bus. The address driver drives the bus
enable and address signal A0 – A31. The pipeline and
dynamic bus sizing unit handle the related control
signals.
Mrs. K. H. Wanjale
VIIT,Pune
•The data buffers interface the internal data bus with
the system bus.
Register Organisation:
•The 80386 has eight 32 - bit general purpose
registers which may be used as either 8 bit or 16 bit
registers.
•A 32 - bit register known as an extended register, is
represented by the register name with prefix E.
•Example : A 32 bit register corresponding to AX is
EAX, similarly BX is EBX etc.
•The 16 bit registers BP, SP, SI and DI in 8086 are now
available with their extended size of 32 bit and are
names as EBP,ESP,ESI and EDI.
•AX represents the lower 16 bit of the 32 bit register
EAX.
Mrs. K. H. Wanjale
VIIT,Pune
• BP, SP, SI, DI represents the lower 16 bit of their 32 bit
counterparts, and can be used as independent 16 bit
registers.
•The six segment registers available in 80386 are CS,
SS, DS, ES, FS and GS.
•The CS and SS are the code and the stack segment
registers respectively, while DS, ES,FS, GS are 4 data
segment registers.
•A 16 bit instruction pointer IP is available along with 32
bit counterpart EIP.
Mrs. K. H. Wanjale
VIIT,Pune
Mrs. K. H. Wanjale
VIIT,Pune
•Flag Register of 80386: The Flag register of 80386 is a
32 bit register. Out of the 32 bits, Intel has reserved bits
D18 to D31, D5 and D3, while D1 is always set at 1.Two
extra new flags are added to the 80286 flag to derive the
flag register of 80386. They are VM and RF flags.
Mrs. K. H. Wanjale
VIIT,Pune
• VM - Virtual Mode Flag: If this flag is set, the
80386 enters the virtual 8086 mode within the protection
mode. This is to be set only when the 80386 is in protected
mode. In this mode, if any privileged instruction is
executed an exception 13 is generated. This bit can be set
using IRET instruction or any task switch operation only
in the protected mode.
•RF- Resume Flag: This flag is used with the
debug register breakpoints. It is checked at the starting of
every instruction cycle and if it is set, any debug fault is
ignored during the instruction cycle. The RF is
automatically reset after successful execution of every
instruction, except for IRET and POPF instructions.
Mrs. K. H. Wanjale
VIIT,Pune
•Segment Descriptor Registers: This registers are not
available for programmers, rather they are internally
used to store the descriptor information, like attributes,
limit and base addresses of segments.
•The six segment registers have corresponding six 73
bit descriptor registers. Each of them contains 32 bit
base address, 32 bit base limit and 9 bit attributes.
These are automatically loaded when the corresponding
segments are loaded with selectors.
•Control Registers: The 80386 has three 32 bit control
registers CR0, CR2 and CR3 to hold global machine
status independent of the executed task. Load and store
instructions are available to access these registers.
•System Address Registers: Four special registers are
defined to refer to the descriptor tables supported by
80386.
Mrs. K. H. Wanjale
VIIT,Pune
•Debug and Test Registers: Intel has provide a set of
8 debug registers for hardware debugging. Out of
these eight registers DR0 to DR7, two registers DR4
and DR5 are Intel reserved.
•The initial four registers DR0 to DR3 store four
program controllable breakpoint addresses, while
DR6 and DR7 respectively hold breakpoint status
and breakpoint control information.
•Two more test register are provided by 80386 for
page caching namely test control and test status
register.
Mrs. K. H. Wanjale
VIIT,Pune
Addressing Modes
MOV EAX, [EBX][ECX*4+6]
Segment Register
+
+
+
Base Register
Index Register
Displacement
Scale Factor
*
CS, DS, ES, FS, GS, SS
Effective Address
EAX, EBX, ECX, EDX, EBP, ESI, EDI, ESP
EAX, EBX, ECX, EDX, EBP, ESI, EDI
1, 2, 4, 8
Base Index Scale
Displacement
Mrs. K. H. Wanjale
VIIT,Pune
ADDRESSING MODES: The 80386 supports overall
eleven addressing modes to facilitate efficient
execution of higher level language programs.
•In case of all those modes, the 80386 can now have
32-bit immediate or 32- bit register operands or
displacements.
•The 80386 has a family of scaled modes. In case of
scaled modes, any of the index register values can be
multiplied by a valid scale factor to obtain the
displacement.
•The valid scale factor are 1, 2, 4 and 8.
•The different scaled modes are as follows.
•Scaled Indexed Mode: Contents of the an index
register are multiplied by a scale factor that may be
added further to get the operand offset.
Mrs. K. H. Wanjale
VIIT,Pune
•Based Scaled Indexed Mode: Contents of the an
index register are multiplied by a scale factor and
then added to base register to obtain the offset.
•Based Scaled Indexed Mode with Displacement:
The Contents of the an index register are
multiplied by a scaling factor and the result is
added to a base register and a displacement to get
the offset of an operand.
Mrs. K. H. Wanjale
VIIT,Pune
Real Address Mode of 80386
•After reset, the 80386 starts from memory location
FFFFFFF0H under the real address mode. In the real
mode, 80386 works as a fast 8086 with 32-bit
registers and data types.
•In real mode, the default operand size is 16 bit but
32- bit operands and addressing modes may be used
with the help of override prefixes.
•The segment size in real mode is 64k, hence the 32-
bit effective addressing must be less than
0000FFFFFH. The real mode initializes the 80386 and
prepares it for protected mode.
Mrs. K. H. Wanjale
VIIT,Pune
Mrs. K. H. Wanjale
VIIT,Pune
•Memory Addressing in Real Mode: In the real mode,
the 80386 can address at the most1Mbytes of
physical memory using address lines A0-A19.
•Paging unit is disabled in real addressing mode, and
hence the real addresses are the same as the
physical addresses.
•To form a physical memory address, appropriate
segment registers contents (16-bits) are shifted left
by four positions and then added to the 16-bit offset
address formed using one of the addressing modes,
in the same way as in the 80386 real address mode.
•The segment in 80386 real mode can be read, write
or executed, i.e. no protection is available.
•Any fetch or access past the end of the segment
limit generate exception 13 in real address mode.
Mrs. K. H. Wanjale
VIIT,Pune

More Related Content

Similar to Introduction to Microprocessor Architecture of 8086 and 80386DX

Similar to Introduction to Microprocessor Architecture of 8086 and 80386DX (20)

26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture
 
Architecture of 8086 microprocessor
Architecture of  8086 microprocessorArchitecture of  8086 microprocessor
Architecture of 8086 microprocessor
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01
 
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.pptMICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
MICROPROCESSORS AND ITS APPLICATIONS UNIT-I.ppt
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
8086ppt
8086ppt8086ppt
8086ppt
 
Arch 8086
Arch 8086Arch 8086
Arch 8086
 
Amp
AmpAmp
Amp
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
8086 archi notes final
8086 archi notes final8086 archi notes final
8086 archi notes final
 
8086 archi notes final
8086 archi notes final8086 archi notes final
8086 archi notes final
 
Register & Memory
Register & MemoryRegister & Memory
Register & Memory
 
8086
8086 8086
8086
 
8086 architecture and pin description
8086 architecture and pin description 8086 architecture and pin description
8086 architecture and pin description
 
Architecture OF 8085
Architecture OF 8085Architecture OF 8085
Architecture OF 8085
 
8085 microprocessor
8085 microprocessor8085 microprocessor
8085 microprocessor
 
8085
80858085
8085
 
8085
80858085
8085
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessor
 
EC 8691 Microprocessor and Microcontroller.pptx
EC 8691 Microprocessor and Microcontroller.pptxEC 8691 Microprocessor and Microcontroller.pptx
EC 8691 Microprocessor and Microcontroller.pptx
 

Recently uploaded

Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Delhi Call girls
 
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...nagunakhan
 
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...Suhani Kapoor
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵anilsa9823
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxjeswinjees
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Roomdivyansh0kumar0
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...Call Girls in Nagpur High Profile
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxjanettecruzeiro1
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation decktbatkhuu1
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceanilsa9823
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...babafaisel
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptxVanshNarang19
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxmirandajeremy200221
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130Suhani Kapoor
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...Suhani Kapoor
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...Suhani Kapoor
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...Call Girls in Nagpur High Profile
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
Best VIP Call Girls Noida Sector 47 Call Me: 8448380779
 
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
Nepali Escort Girl Gomti Nagar \ 9548273370 Indian Call Girls Service Lucknow...
 
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance  VVIP 🍎 SER...
Call Girls Service Mukherjee Nagar @9999965857 Delhi 🫦 No Advance VVIP 🍎 SER...
 
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
VIP Russian Call Girls in Saharanpur Deepika 8250192130 Independent Escort Se...
 
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service  🧵
CALL ON ➥8923113531 🔝Call Girls Kalyanpur Lucknow best Female service 🧵
 
Stark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptxStark Industries Marketing Plan (1).pptx
Stark Industries Marketing Plan (1).pptx
 
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130  Available With RoomVIP Kolkata Call Girl Gariahat 👉 8250192130  Available With Room
VIP Kolkata Call Girl Gariahat 👉 8250192130 Available With Room
 
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
VVIP Pune Call Girls Hadapsar (7001035870) Pune Escorts Nearby with Complete ...
 
SD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptxSD_The MATATAG Curriculum Training Design.pptx
SD_The MATATAG Curriculum Training Design.pptx
 
Peaches App development presentation deck
Peaches App development presentation deckPeaches App development presentation deck
Peaches App development presentation deck
 
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun serviceCALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
CALL ON ➥8923113531 🔝Call Girls Aminabad Lucknow best Night Fun service
 
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
Kala jadu for love marriage | Real amil baba | Famous amil baba | kala jadu n...
 
Fashion trends before and after covid.pptx
Fashion trends before and after covid.pptxFashion trends before and after covid.pptx
Fashion trends before and after covid.pptx
 
DragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptxDragonBall PowerPoint Template for demo.pptx
DragonBall PowerPoint Template for demo.pptx
 
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
VIP Call Girls Service Bhagyanagar Hyderabad Call +91-8250192130
 
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
VIP College Call Girls Gorakhpur Bhavna 8250192130 Independent Escort Service...
 
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
VIP Russian Call Girls in Gorakhpur Deepika 8250192130 Independent Escort Ser...
 
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...Booking open Available Pune Call Girls Nanded City  6297143586 Call Hot India...
Booking open Available Pune Call Girls Nanded City 6297143586 Call Hot India...
 
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
VIP Call Girls Service Mehdipatnam Hyderabad Call +91-8250192130
 
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
young call girls in Vivek Vihar🔝 9953056974 🔝 Delhi escort Service
 

Introduction to Microprocessor Architecture of 8086 and 80386DX

  • 1. Unit I : Introduction to Microprocessor Architecture of 8086 and 80386DX, Register set, Flags, Physical address space of 8086, Data types, Addressing Modes, 80386DX Instruction Set. Mrs. K. H. Wanjale VIIT,Pune
  • 2. Basic 8086 Architecture Mrs. K. H. Wanjale VIIT,Pune
  • 3.  Term “16-bit” means that its arithmetic logic unit, internal registers, and most of its instructions are designed to work 16-bit binary words.  It has 16-bit data bus and 20-bit address bus.  Words will be stored in two consecutive memory locations.  If the first byte of a word is at an even address, the 8086 can read the entire word in one operation.  If the first byte of the word is at an odd address, the 8086 will read the first byte in one operation, and the second byte in another operation. Mrs. K. H. Wanjale VIIT,Pune
  • 4.  The 8086 CPU is divided into two independent functional units:  Bus Interface Unit (BIU)  Execution Unit (EU)  The Bus Interface Unit  The BIU handles all data and addresses on the buses for the execution unit such as it sends out addresses, fetches instructions from memory, reads data from ports and memory as well as writes data to ports and memory. Mrs. K. H. Wanjale VIIT,Pune
  • 5.  The function of BIU is to: ◦ Fetch the instruction or data from memory. ◦ Write the data to memory. ◦ Write the data to the port. ◦ Read data from the port. Mrs. K. H. Wanjale VIIT,Pune
  • 6. Instruction Queue  To increase the execution speed, BIU fetches as many as six instruction bytes ahead to time from memory.  The prefetched instruction bytes are held for the EU in a first in first out group of registers called a instruction queue.  When the EU is ready for its next instruction, it simply reads the instruction from this instruction queue.  This is much faster than sending out an address to the system memory and to send back the next instruction byte.  Fetching the next instruction while the current instruction executes is called pipelining. Mrs. K. H. Wanjale VIIT,Pune
  • 7. Segment Registers  The BIU contains four 16-bit segment registers. They are: ◦ Extra segment (ES) register ◦ Code segment (CS) register ◦ Data segment (DS) register ◦ Stack segment (SS) register. ◦ These segment registers are used to hold the upper 16 bits of the starting address for each of the segments. The part of a segment starting address stored in a segment register is often called the segment base. Mrs. K. H. Wanjale VIIT,Pune
  • 8.  Code Segment (CS): The CS register is used for addressing a memory location in the Code Segment of the memory, where the executable program is stored.  Data Segment (DS): The DS contains most data used by program. Data are accessed in the Data Segment by an offset address or the content of other register that holds the offset address.  Stack Segment (SS): SS defined a section of memory to store addresses and data while a subprogram executes.  Extra Segment (ES): ES is additional data segment that is used by some of the string to hold the extra destination data. Mrs. K. H. Wanjale VIIT,Pune
  • 9. Instruction Pointer (IP)  In the BIU, the next register, below the segment register is instruction pointer. The instruction pointer (IP) holds the 16-bit address of the next code byte within this code segment. Mrs. K. H. Wanjale VIIT,Pune
  • 10. The Execution Unit  The execution unit (EU) tells the BIU where to fetch instructions or data from, decodes instructions, and executes instructions.  The functional parts of the execution unit are control circuitry or system, instruction decoder, and Arithmetic logic unit (ALU).  Control circuitry to perform various internal operations.  A decoder in the EU translates instructions fetched from memory to generate different internal or external control signals that required performing the operation. Mrs. K. H. Wanjale VIIT,Pune
  • 11. The Execution Unit  The EU has a 16-bit ALU, which can perform arithmetic operations such as add, subtract etc. and logical operations such as AND, OR, XOR, increment, decrement etc.  The functions of execution unit are: ◦ To tell BIU where to fetch the instructions or data from. ◦ To decode the instructions. ◦ To execute the instructions. Mrs. K. H. Wanjale VIIT,Pune
  • 12. UNIVERSITY QUESTIONS on 8086 Q.1)Define microprocessor. Give some features of 8086 microprocessor. [3] Q.2) Enlist difference between 8086 and 80386.[3] Q.3) How many segment registers are used by 8086?Mention their use.[3] Mrs. K. H. Wanjale VIIT,Pune
  • 13. Flag Registers of 8086 Flag Register of 8086 Mrs. K. H. Wanjale VIIT,Pune
  • 14. Flag Registers of 8086  Flags Register determines the current state of the processor.  They are modified automatically by CPU after mathematical operations, this allows to determine the type of the result, and to determine conditions to transfer control to other parts of the program.  8086 has 9 flags and they are divided into two categories: ◦ Conditional Flags ◦ Control Flags Mrs. K. H. Wanjale VIIT,Pune
  • 15. 1 ) Conditional Flags  Conditional flags represent result of last arithmetic or logical instruction executed. Conditional flags are as follows:  Carry Flag (CF): This flag indicates an overflow condition for unsigned integer arithmetic. It is also used in multiple-precision arithmetic.  Auxiliary Flag (AF): If an operation performed in ALU generates a carry/barrow from lower nibble (i.e. D0 – D3) to upper nibble (i.e. D4 – D7), the AF flag is set i.e. carry given by D3 bit to D4 is AF flag. This is not a general-purpose flag, it is used internally by the processor to perform Binary to BCD conversion. Mrs. K. H. Wanjale VIIT,Pune
  • 16.  Parity Flag (PF): This flag is used to indicate the parity of result. If lower order 8-bits of the result contains even number of 1’s, the Parity Flag is set and for odd number of 1’s, the Parity Flag is reset.  Zero Flag (ZF): It is set; if the result of arithmetic or logical operation is zero else it is reset.  Sign Flag (SF): In sign magnitude format the sign of number is indicated by MSB bit. If the result of operation is negative, sign flag is set.  Overflow Flag (OF): It occurs when signed numbers are added or subtracted. An OF indicates that the result has exceeded the capacity of machine. Mrs. K. H. Wanjale VIIT,Pune
  • 17. Control Flags Control flags are set or reset deliberately to control the operations of the execution unit. Control flags are as follows:  Trap Flag (TP): ◦ It is used for single step control. ◦ It allows user to execute one instruction of a program at a time for debugging. ◦ When trap flag is set, program can be run in single step mode.  Interrupt Flag (IF): ◦ It is an interrupt enable/disable flag. ◦ If it is set, the maskable interrupt of 8086 is enabled and if it is reset, the interrupt is disabled. ◦ It can be set by executing instruction sit and can be cleared by executing CLI instruction. Mrs. K. H. Wanjale VIIT,Pune
  • 18. Direction Flag (DF) ◦ It is used in string operation. ◦ If it is set, string bytes are accessed from higher memory address to lower memory address. ◦ When it is reset, the string bytes are accessed from lower memory address to higher memory address. Mrs. K. H. Wanjale VIIT,Pune
  • 19. Sr. No. Parameters 8086 Microprocessor 80386 Microprocessor 1 Instruction Length Limit It has no instruction length limit. If it encounters instruction length longer than 15 byte it generates an exception 13. 2 Size of address bus Uses 20 bit address bus to access 1MB of memory Uses 32 bit address bus to access 1MB of memory 3 Clock Counts Requires More clock cycles to execute an instruction. Requires Less clock cycles to execute an instruction 4 Divide exception After divide exception, it leaves the CS:IP value pointing to the next instruction. After divide exception, it leaves the CS:IP value pointing to the failed instruction. 5 IDIV exception An unsuccessful IDIV instruction causes the 8086 to produce an exception. An unsuccessful IDIV instruction cause the 80386 to generate a largest negative number as a quotient. 6 Push SP 8086 pushes the SP value after it has been incremented. 80386 pushes the SP value before it has been incremented Mrs. K. H. Wanjale VIIT,Pune
  • 20. FEATURES OF 80386: Two versions of 80386 are commonly available: 1) 80386DX 2)80386SX 80386DX 80386SX 1) 32 bit address bus 1) 24 bit address bus 32bit data bus 16 bit data bus 2) Packaged in 132 pin ceramic 2) 100 pin flat pin grid array(PGA) package 3) Address 4GB of memory 3) 16 MB of memory Mrs. K. H. Wanjale VIIT,Pune
  • 21. 80386SX was developed after the DX for application that didn’t require the full 32-bit bus version.It is found in many PCs use the same basic mother board design as the 80286.Most application less than the 16MB of memory ,so the SX is popular and less costly version of the 80386 microprocessor.  The 80386 cpu supports 16k no:of segments and thus total virtual memory space is 4GB *16 k=64 tera bytes Memory management section supports  Virtual memory Paging 4 levels of protection 20-33 MHz frequency Mrs. K. H. Wanjale VIIT,Pune
  • 22. Architecture of 80386  The Internal Architecture of 80386 is divided into 3 sections. ◦ Central processing unit(CPU) ◦ Memory management unit(MMU) ◦ Bus interface unit(BIU)  Central processing unit is further divided into Execution unit(EU) and Instruction unit(IU)  Execution unit has 8 General purpose and 8 Special purpose registers which are either used for handling data or calculating offset addresses. Mrs. K. H. Wanjale VIIT,Pune
  • 23. Mrs. K. H. Wanjale VIIT,Pune
  • 24. •The Instruction unit decodes the opcode bytes received from the 16-byte instruction code queue and arranges them in a 3- instruction decoded instruction queue. •After decoding them pass it to the control section for deriving the necessary control signals. The barrel shifter increases the speed of all shift and rotate operations. • The multiply / divide logic implements the bit-shift- rotate algorithms to complete the operations in minimum time. •Even 32- bit multiplications can be executed within one microsecond by the multiply / divide logic. Mrs. K. H. Wanjale VIIT,Pune
  • 25. •The Memory management unit consists of  Segmentation unit and  Paging unit. •Segmentation unit allows segments of size 4Gbytes at max. •The Paging unit organizes the physical memory in terms of pages of 4kbytes size each. •Paging unit works under the control of the segmentation unit, i.e. each segment is further divided into pages. The virtual memory is also organizes in terms of segments and pages by the memory management unit. Mrs. K. H. Wanjale VIIT,Pune
  • 26. •The Segmentation unit provides a 4 level protection mechanism for protecting and isolating the system code and data from those of the application program. •Paging unit converts linear addresses into physical addresses. •The control and attribute PLA checks the privileges at the page level. Each of the pages maintains the paging information of the task. The limit and attribute PLA checks segment limits and attributes at segment level to avoid invalid accesses to code and data in the memory segments. •The Bus control unit has a prioritizer to resolve the priority of the various bus requests.This controls the access of the bus. The address driver drives the bus enable and address signal A0 – A31. The pipeline and dynamic bus sizing unit handle the related control signals. Mrs. K. H. Wanjale VIIT,Pune
  • 27. •The data buffers interface the internal data bus with the system bus. Register Organisation: •The 80386 has eight 32 - bit general purpose registers which may be used as either 8 bit or 16 bit registers. •A 32 - bit register known as an extended register, is represented by the register name with prefix E. •Example : A 32 bit register corresponding to AX is EAX, similarly BX is EBX etc. •The 16 bit registers BP, SP, SI and DI in 8086 are now available with their extended size of 32 bit and are names as EBP,ESP,ESI and EDI. •AX represents the lower 16 bit of the 32 bit register EAX. Mrs. K. H. Wanjale VIIT,Pune
  • 28. • BP, SP, SI, DI represents the lower 16 bit of their 32 bit counterparts, and can be used as independent 16 bit registers. •The six segment registers available in 80386 are CS, SS, DS, ES, FS and GS. •The CS and SS are the code and the stack segment registers respectively, while DS, ES,FS, GS are 4 data segment registers. •A 16 bit instruction pointer IP is available along with 32 bit counterpart EIP. Mrs. K. H. Wanjale VIIT,Pune
  • 29. Mrs. K. H. Wanjale VIIT,Pune
  • 30. •Flag Register of 80386: The Flag register of 80386 is a 32 bit register. Out of the 32 bits, Intel has reserved bits D18 to D31, D5 and D3, while D1 is always set at 1.Two extra new flags are added to the 80286 flag to derive the flag register of 80386. They are VM and RF flags. Mrs. K. H. Wanjale VIIT,Pune
  • 31. • VM - Virtual Mode Flag: If this flag is set, the 80386 enters the virtual 8086 mode within the protection mode. This is to be set only when the 80386 is in protected mode. In this mode, if any privileged instruction is executed an exception 13 is generated. This bit can be set using IRET instruction or any task switch operation only in the protected mode. •RF- Resume Flag: This flag is used with the debug register breakpoints. It is checked at the starting of every instruction cycle and if it is set, any debug fault is ignored during the instruction cycle. The RF is automatically reset after successful execution of every instruction, except for IRET and POPF instructions. Mrs. K. H. Wanjale VIIT,Pune
  • 32. •Segment Descriptor Registers: This registers are not available for programmers, rather they are internally used to store the descriptor information, like attributes, limit and base addresses of segments. •The six segment registers have corresponding six 73 bit descriptor registers. Each of them contains 32 bit base address, 32 bit base limit and 9 bit attributes. These are automatically loaded when the corresponding segments are loaded with selectors. •Control Registers: The 80386 has three 32 bit control registers CR0, CR2 and CR3 to hold global machine status independent of the executed task. Load and store instructions are available to access these registers. •System Address Registers: Four special registers are defined to refer to the descriptor tables supported by 80386. Mrs. K. H. Wanjale VIIT,Pune
  • 33. •Debug and Test Registers: Intel has provide a set of 8 debug registers for hardware debugging. Out of these eight registers DR0 to DR7, two registers DR4 and DR5 are Intel reserved. •The initial four registers DR0 to DR3 store four program controllable breakpoint addresses, while DR6 and DR7 respectively hold breakpoint status and breakpoint control information. •Two more test register are provided by 80386 for page caching namely test control and test status register. Mrs. K. H. Wanjale VIIT,Pune
  • 34. Addressing Modes MOV EAX, [EBX][ECX*4+6] Segment Register + + + Base Register Index Register Displacement Scale Factor * CS, DS, ES, FS, GS, SS Effective Address EAX, EBX, ECX, EDX, EBP, ESI, EDI, ESP EAX, EBX, ECX, EDX, EBP, ESI, EDI 1, 2, 4, 8 Base Index Scale Displacement Mrs. K. H. Wanjale VIIT,Pune
  • 35. ADDRESSING MODES: The 80386 supports overall eleven addressing modes to facilitate efficient execution of higher level language programs. •In case of all those modes, the 80386 can now have 32-bit immediate or 32- bit register operands or displacements. •The 80386 has a family of scaled modes. In case of scaled modes, any of the index register values can be multiplied by a valid scale factor to obtain the displacement. •The valid scale factor are 1, 2, 4 and 8. •The different scaled modes are as follows. •Scaled Indexed Mode: Contents of the an index register are multiplied by a scale factor that may be added further to get the operand offset. Mrs. K. H. Wanjale VIIT,Pune
  • 36. •Based Scaled Indexed Mode: Contents of the an index register are multiplied by a scale factor and then added to base register to obtain the offset. •Based Scaled Indexed Mode with Displacement: The Contents of the an index register are multiplied by a scaling factor and the result is added to a base register and a displacement to get the offset of an operand. Mrs. K. H. Wanjale VIIT,Pune
  • 37. Real Address Mode of 80386 •After reset, the 80386 starts from memory location FFFFFFF0H under the real address mode. In the real mode, 80386 works as a fast 8086 with 32-bit registers and data types. •In real mode, the default operand size is 16 bit but 32- bit operands and addressing modes may be used with the help of override prefixes. •The segment size in real mode is 64k, hence the 32- bit effective addressing must be less than 0000FFFFFH. The real mode initializes the 80386 and prepares it for protected mode. Mrs. K. H. Wanjale VIIT,Pune
  • 38. Mrs. K. H. Wanjale VIIT,Pune
  • 39. •Memory Addressing in Real Mode: In the real mode, the 80386 can address at the most1Mbytes of physical memory using address lines A0-A19. •Paging unit is disabled in real addressing mode, and hence the real addresses are the same as the physical addresses. •To form a physical memory address, appropriate segment registers contents (16-bits) are shifted left by four positions and then added to the 16-bit offset address formed using one of the addressing modes, in the same way as in the 80386 real address mode. •The segment in 80386 real mode can be read, write or executed, i.e. no protection is available. •Any fetch or access past the end of the segment limit generate exception 13 in real address mode. Mrs. K. H. Wanjale VIIT,Pune