SlideShare a Scribd company logo
Lecture 2
The 8086 Microprocessor
Architecture
[Register level organization]
Zelalem Birhanu, AAiT 1
In this lecture
• The 8086 internal architecture
The Execution Unit
The Bus Interface Unit
Physical Address Generation
Zelalem Birhanu, AAiT 2
The Basic Arch.
The simplest microprocessor at least contains:
 Program and data address bus (separate or unified)
 Address decoder and generator
 Instruction decoder
 Arithmetic and Logic Unit (ALU)
 A set of basic registers
Program Counter (PC)
Instruction Register (IR)
 Accumulator or Working Register (AC)
Flag register (FR)
Input and output registers
General purpose (temporary)registers (GPRs)
Zelalem Birhanu, AAiT 3
The 8086 Internal Architecture
Zelalem Birhanu, AAiT 4
8086
• 40 pins
• 16-bit architecture
• Clock Rate : 10MHz max
Zelalem Birhanu, AAiT 5
IBM PC
IBM PC (1981) was based on 8088 which is
identical to 8086 except the data bus
• Memory: 16kB – 256 kB
• CPU: Intel 8088 @ 4.77MHz
• $3000 at the time
Zelalem Birhanu, AAiT 6
8086 Internal Arch.
Zelalem Birhanu, AAiT 7
8086 Internal Arch….cntd
Two functional parts
Execution Unit (EU)
Bus Interface Unit (BIU)
Zelalem Birhanu, AAiT 8
The Execution Unit (EU)
The EU contains :
• Control Circuitry: Directs internal operations
• A Decoder : Translates instructions fetched from
memory into a series of actions which the EU carries out
• 16-bit Arithmetic Logic Unit (ALU) : Does arithmetic and
logic operations (add, subtract, multiply, OR, AND,…)
• Registers : General purpose, flag
Zelalem Birhanu, AAiT 9
Flag register
• Consists of bits that show the status of the CPU
or control the operation of the CPU
Zelalem Birhanu, AAiT 10
Status Flags
• Carry Flag (C)
 This flag is set when there is a carry out of MSB in case of
unsigned addition or a borrow in case of unsigned
subtraction
• Zero Flag (Z)
 This flag is set when the result of an arithmetic operation is
zero
• Sign Flag (S)
 This flag is set when the result an arithmetic operation is negative
 For signed computations, the sign flag equals the MSB of the result
Zelalem Birhanu, AAiT 11
Status Flags…cntd
• Parity Flag (P)
 This flag is set when the lower byte of a result contains even
number of 1s.
• Overflow Flag (O)
 This flag is set, if an overflow occurs, i.e. if the result of a
signed operation is either too large or too small to fit into a
destination
• Auxiliary Cary Flag (AC)
 This is set if there is a carry from the lowest nibble, i.e. bit
three, during addition or borrow for the lowest nibble, i.e. bit
three, during subtraction.
Zelalem Birhanu, AAiT 12
Control Flags
• Interrupt Flag (I)
 If this flag is set, the maskable interrupts are acknowledged
by the CPU, otherwise they are ignored.
• Direction Flag (D)
 This is used by string manipulation instructions.
 If this flag bit is '0’ the string is processed beginning from the
lowest to the highest address (auto-incrementing mode).
Otherwise, the string is processed from the highest to the
lowest address (auto-decrementing mode).
Zelalem Birhanu, AAiT 13
General Purpose Registers (GPRs)
• The EU has eight 16-bit general purpose registers
AX, BX, CX, DX, BP, SP, SI, DI
• AX, BX, CX and DX can be addressed as two separate 8-
bit values
AH-AL, BH-BL, CH-CL, and DH-DL.
• Usually used as: A - accumulator, B - base, C - counter, D -
data
AX
AH AL
8 8
16
Zelalem Birhanu, AAiT 14
The Bus Interface Unit (BIU)
Zelalem Birhanu, AAiT 15
Instruction Byte Queue
• While the EU is decoding or executing an instruction,
which does not require use of the buses, the BIU fetches
up to six instruction bytes for the following instructions
• The BIU stores these pre-fetched 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(s) for the instruction from the queue in the BIU
Zelalem Birhanu, AAiT 16
Segment Registers
• The four 16-bit segment registers :
 Code segment (CS) register
 Data segment (DS) register
 Stack segment (SS) register
 Extra segment (ES) register
• Used to address memory (up to 1048576 bytes (1MB) )
8086
Memory
20-bit Address
16-bit Data
Zelalem Birhanu, AAiT 17
Physical address generation
• In 8086 system memory was
divided into 64kB units called
segments
• Memory is addressed using a
combination of a segment register
and an offset register
00000H
10000H
20000H
80000H
90000H
F0000H
FFFFFH
64K
64K
64K
64K
80000H
8FFFFH
8F000H
F000H (offset)
Zelalem Birhanu, AAiT 18
.
.
.
.
.
.
Physical address generation…cntd
Zelalem Birhanu, AAiT 19
Physical address generation…cntd
• E.g. If the segment address is 1005h and the offset is
5555h, then the physical address is calculated as follows
Segment address --------- 1005h
Offset address------------- 5555h
Segment address--------- 1005h --------- 0001 0000 0000 0101
Shifted by 4 bit positions---------- 0001 0000 0000 0101 0000
Offset address----------------------- + 0101 0101 0101 0101
Physical address ------------------- 0001 0101 0101 1010 0101
1 5 5 A 5 h
Zelalem Birhanu, AAiT 20
Physical address generation…cntd
• A typical program has three segments: code,
data and stack
CS contains the 16-bit code segment address
DS contains the 16-bit data segment address
SS contains the 16-bit stack segment address
ES can point to alternate data segments
Zelalem Birhanu, AAiT 21
Instruction Pointer (IP)
• The IP contains the distance or offset from the base
address in Code Segment (CS) to the next instruction
byte to be fetched
• The 16-bit offset in IP is added to the 16-bit segment
base address in CS to produce the 20-bit physical
address.
• Location of the next instruction in memory is, therefore
address of next instruction = (CS << 4) + IP or (CS:IP)
Zelalem Birhanu, AAiT 22
Instruction Pointer (IP)…cntd
• E.g. Let CS holds 348Ah, and IP holds
4214h. Now the actual address in the
physical memory space is given by
CS:IP and calculated as:
• CS is first shifted left four times
CS <<4= 348A0h
Then the offset in IP is added
348A0h
+ 4214h
Actual address 38AB4h
Zelalem Birhanu, AAiT 23
Other Registers
Stack Pointer
• A stack is a section of memory set aside to store addresses
and data while a subprogram is executing
• The 8086 allow you to set aside an entire 64KB segment as a
stack. The upper 16 bits of the starting address for this
segment are kept in the stack segment register (SS)
• The stack pointer (SP) register holds the 16-bit offset from
the start of the segment to the memory location where a
word was most recently stored on the stack (Top of stack)
address of top of stack = (SS << 4) + SP or (SS:SP)
Zelalem Birhanu, AAiT 24
Other Registers…cntd
• E.g. Let SS hold 5000h, and SP hold
FFE0h
• Now the actual address in the physical
memory space is given by SS:SP and
calculated as:
• SS is first shifted left four times
SS<<4 = 50000h
Then the offset in SP is added
50000h
+ FFE0h
Top of stack 5FFE0h
Zelalem Birhanu, AAiT 25
Other Registers…cntd
Base Pointer and Index Registers
• In addition to the SP, the EU contains a 16-bit base pointer
(BP) register, a 16-bit source index (SI) register and a 16-bit
destination Index (DI) register.
• The base pointer can be used to hold the 16-bit offset of a
data word in one of the segments. Index registers are very
useful in string manipulation.
• These three registers can be used for temporary storage of
data just as the general-purpose registers described above
Zelalem Birhanu, AAiT 26
Summary of 8086 registers
Zelalem Birhanu, AAiT 27
After 8086
IA-32
• Starting from 80386
• 32 bit registers (extended registers)
• 32 bit address bus
AX
AH AL
8 8
16
EAX
32
Zelalem Birhanu, AAiT 28
After 8086…cntd
On chip Floating Point Unit (FPU)
• Starting from 80486
Pipelining
• Starting from 80486
Superscalar, MMX
• Starting from Pentium
Zelalem Birhanu, AAiT 29
Next Class
• 8086 Pinouts
• 8086 Memory Interfacing
Zelalem Birhanu, AAiT 30
More Readings
1. Dr. Manoj’s Handout, Chapter 1
2. Kip R. Irvine, “Assembly Language For Intel-
Based Computers”, Chapter 2
3. 8086 Datasheet, Intel
Zelalem Birhanu, AAiT 31

More Related Content

What's hot

Intel Pentium Pro
Intel Pentium ProIntel Pentium Pro
Intel Pentium Pro
Muhtasim Fuad Rafid
 
Byte and string manipulation 8086
Byte and string manipulation 8086Byte and string manipulation 8086
Byte and string manipulation 8086
mpsrekha83
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
mahalakshmimalini
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
Vikas Gupta
 
Introduction to msp430
Introduction to msp430Introduction to msp430
Introduction to msp430
Harsha herle
 
INTEL 80386 MICROPROCESSOR
INTEL  80386  MICROPROCESSORINTEL  80386  MICROPROCESSOR
INTEL 80386 MICROPROCESSOR
Annies Minu
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
prasadpawaskar
 
8086 memory interface.pptx
8086 memory interface.pptx8086 memory interface.pptx
8086 memory interface.pptx
HebaEng
 
Evolution of microprocessors and 80486 Microprocessor.
Evolution of microprocessors and 80486 Microprocessor.Evolution of microprocessors and 80486 Microprocessor.
Evolution of microprocessors and 80486 Microprocessor.
Ritwik MG
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessor
Diponkor Bala
 
Memory Addressing
Memory AddressingMemory Addressing
Memory Addressing
chauhankapil
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1
SARALA T
 
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil KawarePentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil KawareProf. Swapnil V. Kaware
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
abhikalmegh
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
Shubham Singh
 
Internal architecture-of-8086
Internal architecture-of-8086Internal architecture-of-8086
Internal architecture-of-8086
Estiak Khan
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
NimeshSingh27
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
Dr.YNM
 
80386 Architecture
80386 Architecture80386 Architecture
80386 Architecture
Rohit Choudhury
 
Microprocessor 80386
Microprocessor 80386Microprocessor 80386
Microprocessor 80386yash sawarkar
 

What's hot (20)

Intel Pentium Pro
Intel Pentium ProIntel Pentium Pro
Intel Pentium Pro
 
Byte and string manipulation 8086
Byte and string manipulation 8086Byte and string manipulation 8086
Byte and string manipulation 8086
 
8086 memory segmentation
8086 memory segmentation8086 memory segmentation
8086 memory segmentation
 
8086 microprocessor
8086 microprocessor8086 microprocessor
8086 microprocessor
 
Introduction to msp430
Introduction to msp430Introduction to msp430
Introduction to msp430
 
INTEL 80386 MICROPROCESSOR
INTEL  80386  MICROPROCESSORINTEL  80386  MICROPROCESSOR
INTEL 80386 MICROPROCESSOR
 
8086 microprocessor-architecture
8086 microprocessor-architecture8086 microprocessor-architecture
8086 microprocessor-architecture
 
8086 memory interface.pptx
8086 memory interface.pptx8086 memory interface.pptx
8086 memory interface.pptx
 
Evolution of microprocessors and 80486 Microprocessor.
Evolution of microprocessors and 80486 Microprocessor.Evolution of microprocessors and 80486 Microprocessor.
Evolution of microprocessors and 80486 Microprocessor.
 
Presentation on 8086 microprocessor
Presentation on 8086 microprocessorPresentation on 8086 microprocessor
Presentation on 8086 microprocessor
 
Memory Addressing
Memory AddressingMemory Addressing
Memory Addressing
 
Msp 430 architecture module 1
Msp 430 architecture module 1Msp 430 architecture module 1
Msp 430 architecture module 1
 
Pentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil KawarePentium (80586) Microprocessor By Er. Swapnil Kaware
Pentium (80586) Microprocessor By Er. Swapnil Kaware
 
8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller8259 Programmable Interrupt Controller
8259 Programmable Interrupt Controller
 
Microprocessor 8085 complete
Microprocessor 8085 completeMicroprocessor 8085 complete
Microprocessor 8085 complete
 
Internal architecture-of-8086
Internal architecture-of-8086Internal architecture-of-8086
Internal architecture-of-8086
 
Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...Interfacing with peripherals: analog to digital converters and digital to ana...
Interfacing with peripherals: analog to digital converters and digital to ana...
 
Microcontroller-8051.ppt
Microcontroller-8051.pptMicrocontroller-8051.ppt
Microcontroller-8051.ppt
 
80386 Architecture
80386 Architecture80386 Architecture
80386 Architecture
 
Microprocessor 80386
Microprocessor 80386Microprocessor 80386
Microprocessor 80386
 

Viewers also liked

Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
Ravi Anand
 
8086 Microprocessor powerpoint
8086  Microprocessor  powerpoint8086  Microprocessor  powerpoint
8086 Microprocessor powerpoint
Randhir Kumar
 
8086 module 1 & 2 work
8086 module 1 & 2   work8086 module 1 & 2   work
8086 module 1 & 2 work
Suhail Km
 
fco-lecture-8086
fco-lecture-8086fco-lecture-8086
fco-lecture-8086
24happy24
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor Mustapha Fatty
 
8086 microprocessor introduction
8086 microprocessor introduction8086 microprocessor introduction
8086 microprocessor introduction
Aakash Ugale
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
Velalar College of Engineering and Technology
 
Various type of register
Various type of registerVarious type of register
Various type of register
Muhammad Taqi Hassan Bukhari
 
Cpu registers
Cpu registersCpu registers
Cpu registers
Puneet Rajput
 
The Intel 8086 microprocessor
The Intel 8086 microprocessorThe Intel 8086 microprocessor
The Intel 8086 microprocessor
George Thomas
 
Registers
RegistersRegisters
Registers
Sanjeev Patel
 
Introduction to 8086 microprocessor
Introduction to 8086 microprocessorIntroduction to 8086 microprocessor
Introduction to 8086 microprocessor
Shreyans Pathak
 
What is CPU Register? Type of CPU Register.
What is CPU Register? Type of CPU Register.What is CPU Register? Type of CPU Register.
What is CPU Register? Type of CPU Register.
Kapil Dev Das
 

Viewers also liked (15)

Microprocessor 8086 instructions
Microprocessor 8086 instructionsMicroprocessor 8086 instructions
Microprocessor 8086 instructions
 
8086 Architecture
8086 Architecture8086 Architecture
8086 Architecture
 
8086 Microprocessor powerpoint
8086  Microprocessor  powerpoint8086  Microprocessor  powerpoint
8086 Microprocessor powerpoint
 
8086 module 1 & 2 work
8086 module 1 & 2   work8086 module 1 & 2   work
8086 module 1 & 2 work
 
fco-lecture-8086
fco-lecture-8086fco-lecture-8086
fco-lecture-8086
 
Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor  Architecture of 8086 Microprocessor
Architecture of 8086 Microprocessor
 
8086 microprocessor introduction
8086 microprocessor introduction8086 microprocessor introduction
8086 microprocessor introduction
 
Timing diagram 8085 microprocessor
Timing diagram 8085 microprocessorTiming diagram 8085 microprocessor
Timing diagram 8085 microprocessor
 
Various type of register
Various type of registerVarious type of register
Various type of register
 
Cpu registers
Cpu registersCpu registers
Cpu registers
 
The Intel 8086 microprocessor
The Intel 8086 microprocessorThe Intel 8086 microprocessor
The Intel 8086 microprocessor
 
Registers
RegistersRegisters
Registers
 
Introduction to 8086 microprocessor
Introduction to 8086 microprocessorIntroduction to 8086 microprocessor
Introduction to 8086 microprocessor
 
What is CPU Register? Type of CPU Register.
What is CPU Register? Type of CPU Register.What is CPU Register? Type of CPU Register.
What is CPU Register? Type of CPU Register.
 
Addressing modes
Addressing modesAddressing modes
Addressing modes
 

Similar to Lecture2

Amp
AmpAmp
8086 Architecture ppt.pdf
8086 Architecture ppt.pdf8086 Architecture ppt.pdf
8086 Architecture ppt.pdf
UmamaheswariV4
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02raone1989
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02raone1989
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02
Murad Mondol
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02raone1989
 
SAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSORSAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA
 
The 8086 microprocessor
The  8086 microprocessorThe  8086 microprocessor
The 8086 microprocessor
Adarsh College, Hingoli
 
26677766 8086-microprocessor-architecture-110905125037-phpapp02
26677766 8086-microprocessor-architecture-110905125037-phpapp0226677766 8086-microprocessor-architecture-110905125037-phpapp02
26677766 8086-microprocessor-architecture-110905125037-phpapp02
Avijeet Negel
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01destaw belay
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01Siva Raman
 
INTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSORINTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSOR
Sagar Kuntumal
 
26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architectureSaurabh Jain
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01jemimajerome
 
8086 architecture
8086 architecture8086 architecture
8086 architecture
Self-Employed
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor
techbed
 
8086-microprocessor-architecture.ppt
8086-microprocessor-architecture.ppt8086-microprocessor-architecture.ppt
8086-microprocessor-architecture.ppt
Madhan7771
 
microprocessor Lec 02 mic
microprocessor Lec 02 micmicroprocessor Lec 02 mic
microprocessor Lec 02 mic
iqbal ahmad
 
Microprocessors
MicroprocessorsMicroprocessors
Microprocessors
chaitanyaambati3
 

Similar to Lecture2 (20)

Amp
AmpAmp
Amp
 
8086 Architecture ppt.pdf
8086 Architecture ppt.pdf8086 Architecture ppt.pdf
8086 Architecture ppt.pdf
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02
 
8086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp028086microprocessor 130821100244-phpapp02
8086microprocessor 130821100244-phpapp02
 
SAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSORSAURABH MITRA-8086 MICROPROCESSOR
SAURABH MITRA-8086 MICROPROCESSOR
 
The 8086 microprocessor
The  8086 microprocessorThe  8086 microprocessor
The 8086 microprocessor
 
26677766 8086-microprocessor-architecture-110905125037-phpapp02
26677766 8086-microprocessor-architecture-110905125037-phpapp0226677766 8086-microprocessor-architecture-110905125037-phpapp02
26677766 8086-microprocessor-architecture-110905125037-phpapp02
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01
 
INTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSORINTEL 8086 MICROPROCESSOR
INTEL 8086 MICROPROCESSOR
 
26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture26677766 8086-microprocessor-architecture
26677766 8086-microprocessor-architecture
 
8086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp018086 microprocessor-architecture-120207111857-phpapp01
8086 microprocessor-architecture-120207111857-phpapp01
 
8086 architecture
8086 architecture8086 architecture
8086 architecture
 
1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor1326 Introduction To 8086 Microprocessor
1326 Introduction To 8086 Microprocessor
 
8086-microprocessor-architecture.ppt
8086-microprocessor-architecture.ppt8086-microprocessor-architecture.ppt
8086-microprocessor-architecture.ppt
 
microprocessor Lec 02 mic
microprocessor Lec 02 micmicroprocessor Lec 02 mic
microprocessor Lec 02 mic
 
8086
8086 8086
8086
 
Microprocessors
MicroprocessorsMicroprocessors
Microprocessors
 

More from misgina Mengesha

Lecture1
Lecture1Lecture1
Sprabq8
Sprabq8Sprabq8
Sensors2006
Sensors2006Sensors2006
Sensors2006
misgina Mengesha
 
Sensors31
Sensors31Sensors31
Sensors31
misgina Mengesha
 
Sensing for robotics and control s set13
Sensing for robotics and control s set13Sensing for robotics and control s set13
Sensing for robotics and control s set13
misgina Mengesha
 
Introduction to sensors
Introduction to sensorsIntroduction to sensors
Introduction to sensors
misgina Mengesha
 
Cn3 sensors and transducers-12
Cn3 sensors and transducers-12Cn3 sensors and transducers-12
Cn3 sensors and transducers-12
misgina Mengesha
 
Cn3 sensors and transducers-1
Cn3 sensors and transducers-1Cn3 sensors and transducers-1
Cn3 sensors and transducers-1
misgina Mengesha
 
480 sensors
480 sensors480 sensors
480 sensors
misgina Mengesha
 
Wwwwww
WwwwwwWwwwww

More from misgina Mengesha (17)

Lecture9
Lecture9Lecture9
Lecture9
 
Lecture8
Lecture8Lecture8
Lecture8
 
Lecture6
Lecture6Lecture6
Lecture6
 
Lecture5
Lecture5Lecture5
Lecture5
 
Lecture5(1)
Lecture5(1)Lecture5(1)
Lecture5(1)
 
Lecture4
Lecture4Lecture4
Lecture4
 
Lecture3
Lecture3Lecture3
Lecture3
 
Lecture1
Lecture1Lecture1
Lecture1
 
Sprabq8
Sprabq8Sprabq8
Sprabq8
 
Sensors2006
Sensors2006Sensors2006
Sensors2006
 
Sensors31
Sensors31Sensors31
Sensors31
 
Sensing for robotics and control s set13
Sensing for robotics and control s set13Sensing for robotics and control s set13
Sensing for robotics and control s set13
 
Introduction to sensors
Introduction to sensorsIntroduction to sensors
Introduction to sensors
 
Cn3 sensors and transducers-12
Cn3 sensors and transducers-12Cn3 sensors and transducers-12
Cn3 sensors and transducers-12
 
Cn3 sensors and transducers-1
Cn3 sensors and transducers-1Cn3 sensors and transducers-1
Cn3 sensors and transducers-1
 
480 sensors
480 sensors480 sensors
480 sensors
 
Wwwwww
WwwwwwWwwwww
Wwwwww
 

Lecture2

  • 1. Lecture 2 The 8086 Microprocessor Architecture [Register level organization] Zelalem Birhanu, AAiT 1
  • 2. In this lecture • The 8086 internal architecture The Execution Unit The Bus Interface Unit Physical Address Generation Zelalem Birhanu, AAiT 2
  • 3. The Basic Arch. The simplest microprocessor at least contains:  Program and data address bus (separate or unified)  Address decoder and generator  Instruction decoder  Arithmetic and Logic Unit (ALU)  A set of basic registers Program Counter (PC) Instruction Register (IR)  Accumulator or Working Register (AC) Flag register (FR) Input and output registers General purpose (temporary)registers (GPRs) Zelalem Birhanu, AAiT 3
  • 4. The 8086 Internal Architecture Zelalem Birhanu, AAiT 4
  • 5. 8086 • 40 pins • 16-bit architecture • Clock Rate : 10MHz max Zelalem Birhanu, AAiT 5
  • 6. IBM PC IBM PC (1981) was based on 8088 which is identical to 8086 except the data bus • Memory: 16kB – 256 kB • CPU: Intel 8088 @ 4.77MHz • $3000 at the time Zelalem Birhanu, AAiT 6
  • 7. 8086 Internal Arch. Zelalem Birhanu, AAiT 7
  • 8. 8086 Internal Arch….cntd Two functional parts Execution Unit (EU) Bus Interface Unit (BIU) Zelalem Birhanu, AAiT 8
  • 9. The Execution Unit (EU) The EU contains : • Control Circuitry: Directs internal operations • A Decoder : Translates instructions fetched from memory into a series of actions which the EU carries out • 16-bit Arithmetic Logic Unit (ALU) : Does arithmetic and logic operations (add, subtract, multiply, OR, AND,…) • Registers : General purpose, flag Zelalem Birhanu, AAiT 9
  • 10. Flag register • Consists of bits that show the status of the CPU or control the operation of the CPU Zelalem Birhanu, AAiT 10
  • 11. Status Flags • Carry Flag (C)  This flag is set when there is a carry out of MSB in case of unsigned addition or a borrow in case of unsigned subtraction • Zero Flag (Z)  This flag is set when the result of an arithmetic operation is zero • Sign Flag (S)  This flag is set when the result an arithmetic operation is negative  For signed computations, the sign flag equals the MSB of the result Zelalem Birhanu, AAiT 11
  • 12. Status Flags…cntd • Parity Flag (P)  This flag is set when the lower byte of a result contains even number of 1s. • Overflow Flag (O)  This flag is set, if an overflow occurs, i.e. if the result of a signed operation is either too large or too small to fit into a destination • Auxiliary Cary Flag (AC)  This is set if there is a carry from the lowest nibble, i.e. bit three, during addition or borrow for the lowest nibble, i.e. bit three, during subtraction. Zelalem Birhanu, AAiT 12
  • 13. Control Flags • Interrupt Flag (I)  If this flag is set, the maskable interrupts are acknowledged by the CPU, otherwise they are ignored. • Direction Flag (D)  This is used by string manipulation instructions.  If this flag bit is '0’ the string is processed beginning from the lowest to the highest address (auto-incrementing mode). Otherwise, the string is processed from the highest to the lowest address (auto-decrementing mode). Zelalem Birhanu, AAiT 13
  • 14. General Purpose Registers (GPRs) • The EU has eight 16-bit general purpose registers AX, BX, CX, DX, BP, SP, SI, DI • AX, BX, CX and DX can be addressed as two separate 8- bit values AH-AL, BH-BL, CH-CL, and DH-DL. • Usually used as: A - accumulator, B - base, C - counter, D - data AX AH AL 8 8 16 Zelalem Birhanu, AAiT 14
  • 15. The Bus Interface Unit (BIU) Zelalem Birhanu, AAiT 15
  • 16. Instruction Byte Queue • While the EU is decoding or executing an instruction, which does not require use of the buses, the BIU fetches up to six instruction bytes for the following instructions • The BIU stores these pre-fetched 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(s) for the instruction from the queue in the BIU Zelalem Birhanu, AAiT 16
  • 17. Segment Registers • The four 16-bit segment registers :  Code segment (CS) register  Data segment (DS) register  Stack segment (SS) register  Extra segment (ES) register • Used to address memory (up to 1048576 bytes (1MB) ) 8086 Memory 20-bit Address 16-bit Data Zelalem Birhanu, AAiT 17
  • 18. Physical address generation • In 8086 system memory was divided into 64kB units called segments • Memory is addressed using a combination of a segment register and an offset register 00000H 10000H 20000H 80000H 90000H F0000H FFFFFH 64K 64K 64K 64K 80000H 8FFFFH 8F000H F000H (offset) Zelalem Birhanu, AAiT 18 . . . . . .
  • 20. Physical address generation…cntd • E.g. If the segment address is 1005h and the offset is 5555h, then the physical address is calculated as follows Segment address --------- 1005h Offset address------------- 5555h Segment address--------- 1005h --------- 0001 0000 0000 0101 Shifted by 4 bit positions---------- 0001 0000 0000 0101 0000 Offset address----------------------- + 0101 0101 0101 0101 Physical address ------------------- 0001 0101 0101 1010 0101 1 5 5 A 5 h Zelalem Birhanu, AAiT 20
  • 21. Physical address generation…cntd • A typical program has three segments: code, data and stack CS contains the 16-bit code segment address DS contains the 16-bit data segment address SS contains the 16-bit stack segment address ES can point to alternate data segments Zelalem Birhanu, AAiT 21
  • 22. Instruction Pointer (IP) • The IP contains the distance or offset from the base address in Code Segment (CS) to the next instruction byte to be fetched • The 16-bit offset in IP is added to the 16-bit segment base address in CS to produce the 20-bit physical address. • Location of the next instruction in memory is, therefore address of next instruction = (CS << 4) + IP or (CS:IP) Zelalem Birhanu, AAiT 22
  • 23. Instruction Pointer (IP)…cntd • E.g. Let CS holds 348Ah, and IP holds 4214h. Now the actual address in the physical memory space is given by CS:IP and calculated as: • CS is first shifted left four times CS <<4= 348A0h Then the offset in IP is added 348A0h + 4214h Actual address 38AB4h Zelalem Birhanu, AAiT 23
  • 24. Other Registers Stack Pointer • A stack is a section of memory set aside to store addresses and data while a subprogram is executing • The 8086 allow you to set aside an entire 64KB segment as a stack. The upper 16 bits of the starting address for this segment are kept in the stack segment register (SS) • The stack pointer (SP) register holds the 16-bit offset from the start of the segment to the memory location where a word was most recently stored on the stack (Top of stack) address of top of stack = (SS << 4) + SP or (SS:SP) Zelalem Birhanu, AAiT 24
  • 25. Other Registers…cntd • E.g. Let SS hold 5000h, and SP hold FFE0h • Now the actual address in the physical memory space is given by SS:SP and calculated as: • SS is first shifted left four times SS<<4 = 50000h Then the offset in SP is added 50000h + FFE0h Top of stack 5FFE0h Zelalem Birhanu, AAiT 25
  • 26. Other Registers…cntd Base Pointer and Index Registers • In addition to the SP, the EU contains a 16-bit base pointer (BP) register, a 16-bit source index (SI) register and a 16-bit destination Index (DI) register. • The base pointer can be used to hold the 16-bit offset of a data word in one of the segments. Index registers are very useful in string manipulation. • These three registers can be used for temporary storage of data just as the general-purpose registers described above Zelalem Birhanu, AAiT 26
  • 27. Summary of 8086 registers Zelalem Birhanu, AAiT 27
  • 28. After 8086 IA-32 • Starting from 80386 • 32 bit registers (extended registers) • 32 bit address bus AX AH AL 8 8 16 EAX 32 Zelalem Birhanu, AAiT 28
  • 29. After 8086…cntd On chip Floating Point Unit (FPU) • Starting from 80486 Pipelining • Starting from 80486 Superscalar, MMX • Starting from Pentium Zelalem Birhanu, AAiT 29
  • 30. Next Class • 8086 Pinouts • 8086 Memory Interfacing Zelalem Birhanu, AAiT 30
  • 31. More Readings 1. Dr. Manoj’s Handout, Chapter 1 2. Kip R. Irvine, “Assembly Language For Intel- Based Computers”, Chapter 2 3. 8086 Datasheet, Intel Zelalem Birhanu, AAiT 31