Lecture-3 (Microprocessor 8086)
Lecture-3 (Microprocessor 8086)
Internal Architectures
Course Teacher:
Deboky Saha (DES)
Contractual Lecturer
Department of Computer Science & Engineering
BRAC University.
Address bus
ALU Register
Section
Data bus
D E
Arithmetic H L
and Logic
Unit
Instruction Stack Pointer
decoder
Program Counter
Incrementer/ Decrementer
Address latch
Zero flag: If the result of the latest operation is zero, then zero flag will be set to
‘1’; otherwise it be reset to ‘0’.
Auxiliary Carry Flag: This flag is not accessible to programmer. This flag will
be used by the system during BCD (binary-coded decimal) operations.
Parity Flag: If the result of the latest operation is having even number of ‘1’s,
then this flag will be set to ‘1’ Otherwise this will be reset to ‘0’. This is used for
error checking.
Carry Flag: If the result of the latest operations exceeds 8-bits then this flag will
be set to ‘1’. Otherwise it be reset to ‘0’.
10 CSE – 341 : Microprocessors
BRAC University
8086
GND 1 40 Vcc
AD14 AD15
AD13 A16,S3
AD12 A17,S4
AD11 A18,S5
AD10 A19,S6
AD9 /BHE,S7
AD8 MN,/MX
AD7 /RD
AD6 /RQ,/GT0 HOLD
AD5
8086 /RQ,/GT1 HLDA
AD4 /LOCK /WR
AD3 /S2 IO/M
AD2 /S1 DT/R
AD1 /S0 /DEN
AD0 QS0 ALE
NMI QS1 /INTA
INTR /TEST
CLK READY
GND 20 21 RESET
EU: ALU + Registers (AX, BX, CX, DX, SI, DI, BP, and SP)
+ FLAGS register.
ALU: performs arithmetic & logic operations.
Registers: store data
FLAGS Register: Individual bits reflect the result of a computation.
25
Flag Register
It is generally divided into two and they are Status flag and Control Flag
Status Flags:
Carry Flag (CF)- Carry out from MSB. If there is no carry then CF=0, if
there is carry in the MSB, then C.F=1
In other words, this flag is set to ’1’ when there is an unsigned overflow.
For example when you add bytes 255 + 1 (result is not in range 0...255).
When there is no overflow this flag is reset to 0.
Parity Flag (PF) - this flag is set to ’1’ when there is even number of one
bits in result, and reset to ’0’ when there is odd number of one bits.
Auxiliary Flag (AF) - set to ’1’ when there is a carry from lower nibble
to higher nibble.
Zero Flag (ZF) - set to ’1’ when result is zero. For non-zero result this
flag is reset to ’0’.