Module 1
Module 1
101003/CS500D
Microprocessors and Microcontrollers
Syllabus
8008 8085
● Arithmetic and Logic Operations: Arithmetic operations like add, subtract and
logical operations like AND, OR, XOR etc.
● Memory: collection of storage devices where information is kept while not in
current use.
● Produces: For the user to see the result of the execution of the program, the
results must be presented in a human readable form , through output devices.
Microprocessor Based System
Fetch-Deode and Execute cycle
8085
● Capable of addressing 64 k of
memory (216 )
8086
● 20 bit address bus (1 MB)
● More powerful instruction set
Microprocessor ● 3 Clock frequency - 5, 8 and
10 MHz
● 40 Pin IC
● 16 bit Registers
● AX → 16 bit accumulator
○ AL - Lower 8 bits, AH - Higher 8 bits
○ Most important GPR
● BX
○ Offset storage for physical address in certain
addressing modes
● CX
○ Default counter for string and loop operations
● DX
○ Implicit operand or destination
Segment Registers
● 1 MB of Memory
○ 16 logical segments of 64 KB
● 4 Segment Registers
● Code Segment Register
○ Addressing a memory location in CS
○ CS → Executable program is stored
● Data Segment Register
○ Points to DS → Data is stored
● Extra Segment Register
○ Also contains Data
● Stack Segment Register
○ Store Stack data - temporarily store important data
Pointers and Index Registers
• Handles all transactions of data and addresses on the buses for the execution unit:
• sends out addresses
• fetches instructions from memory
• reads data from ports and memory
• writes data to ports and memory
Bus Interface Unit
• BIU contains
• 6 byte instruction queue
• Segment Registers
• Instruction Pointer (IP)
• Address conversion mechanism (adder)
Instruction Queue
• The complete physically available memory (1 MB) may be divided into a number of logical
segments.
• A segment is a 64 KB block of memory
• The 16 bit contents of the segment registers in the BIU actually point to the starting location of a
particular segment.
• Complete physical address of 20 bits generated using segment and offset register (each16 bit long)
• Physical Address = Segment Address + Offset Address
• Segment Register → Segment Address
• Offset Register → Offset Address
• Performed by the address conversion mechanism (adder)
Address Calculation
● Segment Address = 1000H
1. Left shift the 16-bit address present in the segment register by 4-bits
0001 0000 0000 0000 (0000)
• Contains the register set of 8086 except the segment registers and IP
o Contains Direction Flag (D), Interrupt Flag (I) and Trap Flag (T)
Flag Purpose
Carry (CF) Holds the carry after addition or the borrow after subtraction. Also indicates
some error conditions, as dictated by some programs and procedures
Parity (PF) PF = 0; odd parity, PF = 1;even parity . Set to 1 if the lower byte of result
has even number of 1s
Auxiliary (AF) Holds the carry (half – carry) after addition or borrow after subtraction
between bit positions 3 and 4 of the result
Zero (ZF) Shows the result of the arithmetic or logic operation. Z = 1; result is zero.
Z = 0; otherwise
Sign (SF) Holds the sign of the result after an arithmetic/logic instruction execution.
S = 1; negative, S = 0; positive
Overflow (OF) Overflow occurs when signed numbers are added or subtracted. An
overflow indicates the result has exceeded the capacity of the machine
Flag Purpose
○ Multiprocessor or Maximum
Mode
Pin Configuration of 8086
● 8086 Signals can be
categorised into 3 groups:
0 0 No operation
1 0 Empty queue
S2 S1 S0 Indication
0 0 0 Interrupt Acknowledge
0 0 1 I/O Read
0 1 0 I/O Write
0 1 1 Halt
1 0 0 Opcode Fetch
1 0 1 Memory Read
1 1 0 Memory Write
1 1 1 Passive
LOCK Request/Grant Signals
● When low indicates to the other ● RQ / GT0, RQ / GT1
processors not to ask the CPU to
leave the system bus.
● Request/Grant signals used by the
● Activated using the LOCK prefix on
other processors requesting the
any instruction
CPU to release the system bus.
• The byte-wide storage locations are assigned consecutive addresses over the range from 00000H
to FFFFFH.
• Data bytes associated with an even address (00000, 00002 etc.) reside in the even bank and those
with the odd address (00001, 00003 etc.) reside in the odd bank.
• Address bits A1 through A19 select the storage location that is to be accessed.
• They are applied to both banks in parallel.
• A0 and BHE are used as bank-select signals.
• Each of the memory bank provides half of the 8086’s 16 bit data bus.
Note : To access odd addressed word two bus cycles are required.
● 2 Operating configurations:
● All the control signals are given out by the microprocessor chip itself.
● They are used for separating the valid address from the multiplexed address/data
signals and are controlled by the ALE signal generated by 8086.
● Transreceivers are the bidirectional buffers and some times they are called as data
amplifiers required to separate the valid data from the time multiplexed
address/data signals.
● The DEN signal indicates that valid data is available on the data bus, while DT/R
indicates the direction of data, i.e. from or to the processor.
8086 Minimum Mode Diagram
Timing Diagram
● The working of the minimum mode can be better described in terms of the timing
diagram.
● During the negative going edge of this signal, the valid address is latched on the
local bus.
● At T2, the address is removed from the local bus and is sent to the output.
● After RD goes low, the valid data is available on the data bus.
● When the processor returns the read signal to high level, the addressed
device will again tri state its bus drivers.
Write Cycle Timing Diagram for Minimum Mode
● A write cycle also begins with the assertion of ALE and the emission of the
address.
● In T2, after sending the address in T1, the processor sends the data to be
written to the addressed location.
● In this mode, the processor derives the status signal S2, S1, S0.
● Another chip called bus controller derives the control signal using this status
information .
● In the maximum mode, there may be more than one microprocessor in the system
configuration.
8086 Maximum Mode Diagram
● The components in the system are same as in the minimum mode
system.
● The basic function of the bus controller chip IC8288, is to derive control
signals like:
● ○DEN, DT/R, ALE etc. using the information by the processor on the status lines.
● The bus controller chip 8288 has input lines S2, S1, S0 and CLK.
● It derives the outputs ALE, DEN, DT/R, MRDC, MWTC, AMWTC, IORC, IOWC
and AIOWC.
● IORC, IOWC are I/O read command and I/O write command signals respectively .
● These signals enable an IO interface to read or write the data from or to the
address port.
● The MRDC, MWTC are memory read command and memory write command
signals respectively and may be used as memory read or write signals.
● All these command signals instructs the memory to accept or send data from or to
the bus.
● For both write command signals, the advanced signals namely AIOWC and AMWTC
are available.
● They also serve the same purpose but are activated one clock cycle earlier than
IOWC and MWTC respectively
● Variant of the Intel 8086
• 16-bit registers.
• One megabyte address range like 8086.
• According to Intel documentation, the 8086 and 8088 have the same execution unit
(EU)—only the bus interface unit (BIU) is different.
• The 8088 was targeted at economical systems.
• Allows the use of an eight-bit data path and eight-bit support and peripheral chips.
• It could use all the support chips of the 8080, an 8-bit CPU and predecessor of the
8086 (like the DMA-controller, interrupt controller, etc.).
8086 ● Example:
ADD AX, BX
Machine Language
Instruction Format
OPCODE DESTINATION SOURCE
OPERAND OPERAND
General Instruction Format for 8086
• 0 →source
▪ Data Size Bit (W bit): Specifies whether the operation will be performed on 8-bit or 16-bit
data
• 0 →8 bits
• 1→ 16 bits
General Instruction Format for 8086
▪ 2-bit MOD field and 3-bit R/M field together specify the second operand
▪ 2-bit MOD field and 3-bit R/M field together specify the second operand
• W bit = 0 (8-bits)
• W bit = 1 (16-bits)
• W bit = 1 (16-bits)