MP Module 1 - Modified
MP Module 1 - Modified
Microprocessors (with specific insight into x86 family) - Features of 8086 Internal Block Diagram of 8086 –
Execution Unit – Bus Interface Unit – Addressing Modes Hardware structure of 8086- Pin Configuration-Clock-
Processor activities (Interrupt, DMA, etc.)- Maximum mode- Instruction cycle Assembly process – Assemblers
for x86 – Instruction Design
Microprocessor
• The microprocessor, also known as the Central Processing Unit (CPU), is the brain of all
computers and many household and electronic devices.
• It is actually a silicon chip that contains a CPU.
• In the world of personal computers, the terms microprocessor and CPU are used
interchangeably.
or
• The microprocessor is a multipurpose, programmable device that accepts digital data as input,
processes it according to instructions stored in its memory, and provides results as output
Role of Microprocessor in Micro Computer
• A microcomputer system is one which uses a microprocessor as its cpu
• In addition, the microcomputer also has a memory unit, input/output devices and system
buses.
=====================================================================
Features of 8086
16bit processor.
- It’s ALU, internal registers works with 16bit binary word
16bit data bus.
- It can read or write data to a memory/port either 16bits or 8 bit at a time
20bit address bus
- it can address upto 220 = 1MB memory location; 0 to 1048575 or 00000 – fffff H
Frequency range: 6-10 MHz
It consists of powerful instruction set, which provides operations like multiplication and
division easily.
It uses two stages of pipelining, i.e. Fetch Stage and Execute Stage, which improves
performance.
It has an instruction queue, which is capable of storing six instruction bytes from
the memory resulting in faster processing.
1
It supports two modes of operation, i.e. Maximum mode and Minimum mode. Maximum mode
is suitable for system having multiple processors and Minimum mode is suitable for system
having a single processor.
=====================================================================
Internal Block Diagram of 8086
Architecture of 8086
8086 is 16 bit microprocessor ie. Data bus and internal registers are of 16 bit in width
It has 20 bit address bus ( A0 to A19 ).Can address up to 220 = 1 megabytes of memory space.
Also has the capacity to work on 8 bit data.
The internal block diagram has been partitioned into two logical units - Bus Interface Unit
(BIU) and Execution Unit (EU)
BIU and EU interact through the internal bus.
Execution Unit
• EU is responsible for executing the instructions of the programs and to carry out the
required processing
2
Functions of EU
To tell BIU, from where to fetch the instructions or data.
To decode the instructions: A decoder in the EU control system translates instructions.
To execute the instructions.
Contains ALU, Control unit, Internal bus ,Registers.
These registers can be used as 8-bit registers AH, AL, BH, BL, CH, CL, DH, and DL.
These can be used as 16-bit in pair to have AX, BX, CX, and DX to store 16-bit data.
AX Register: AX register is also known as accumulator register that stores
operands for arithmetic operations .
BX Register: This register is mainly used as a base register. It holds the starting
base location of a memory region within a data segment.
CX Register: It is defined as a counter. It is primarily used in loop instruction to
store loop counter.
DX Register: DX register is used to contain I/O port address for I/O instruction.
• Data Registers are general purpose but they also perform special functions
AX-Accumulator register . It is used for all
– Input/output operations
– arithmetic operations
– string manipulation
BX-Base register- used as offset storage for generating physical addresses in case of
certain addressing modes.
CX- Count register
– Used as a loop counter
– Used in shift and rotate operations
4
DX-Data register
– Used in multiplication and division
– Also used as a port number in I/O operations
Flag Register
Flag Registers of 8086 is also called status register. It keeps the current status
of the processor
8086 has 9 flags and they are divided into two categories:
1. Conditional Flags -represent result of last arithmetic or logical instruction executed.
5
2. Control Flags Used to control some operations of the MPU.
These flags are to be set in order to achieve some specific purposes.
6
Functions of Segment Registers
• CS register holds 16-bits starting address of code segment
• SS register hold the starting address for the current stack.
• DS Register: Points to the current data segment.
• ES registers are used to hold the starting address of the extra segment.
Memory Segmentation
8086 has 20bit address bus and so the available memory space is 220 = 1MB
Addresses are expressed as 5 hex digits from 00000 – FFFFF H
But 20 bit addresses are TOO BIG to fit in 16 bit registers!
So this memory is divided into 4 logical segments.
That is within the 1 MB of memory, the 8086 defines 4 64KB memory blocks or segments.
Means each segment is 64Kbytes in size and addressed by one of the segment registers.
In 8086 microprocessor, memory is divided into 4 segments as shown here
7
• Within a segment, a particular memory location is specified with an offset.
• A logical address is a combination of a segment address and an offset
• It is specified as segment:offset
--------------------------------------------------------------------------------------------------------------
Addressing Modes
An instruction is divided into Opcode and Operand. Opcode specifies what an instruction does ,
operand specifies the data .
3. Register addressing
The square brackets around the 1354H denotes the contents of the memory
location. When executed, this instruction will copy the contents of the memory
location into BX register.
This addressing mode is called direct because the displacement of the operand from
the segment base (offset)is specified directly in the instruction.
9
• Suppose BX:0030H . This instruction causes data from offset 0030h in Data segment to move
to AX.
ADD AX,[SI]
SUB AX,[DI]
6. Based Indexed Addressing mode
• The content of base register [BX] or [BP] is added to the content of an index register [SI] or
[DI].
• The resulting value points to the location where the data is present.
8 bit or 16 bit displacement is added with contents of any one of [BX], [BP], [SI] or
[DI]
10
Hardware Structure of 8086
AD0-AD15 (Bidirectional)
Address/Data bus
Low order address bus; these are multiplexed with data.
When AD lines are used to transmit memory address the symbol A is used instead of AD, for
example A0-A15.
When data are transmitted over AD lines the symbol D is used in place of AD, for example D0-
D7, D8-D15 or D0-D15.
A16/S3, A17/S4, A18/S5, A19/S6
High order address bus. These are multiplexed with status signals
BHE (Active Low)/S7 (Output)
Bus High Enable/Status
It is available at pin 34 and used to indicate the transfer of data using data bus D8-D15.
It is used to indicate the transfer of data over the higher order data bus (D8 to D15).
This signal is low during the first clock cycle, thereafter it is active
RD (Read) (Active Low)
The signal is used for read operation.
It is an output signal.
It is active when low.
11
ALE
This signal indicates the availability of a valid address on the address/data lines.
TEST
8086 will enter a wait state after execution of the WAIT instruction and will resume execution
only when the is made low by an active hardware.
This signal is active high for the first 4 clock cycles to RESET the microprocessor.
CLK
The clock input provides the basic timing for processor operation and bus control activity.
INTR Interrupt Request
This is a triggered input.
This is sampled during the last clock cycles of each instruction to determine the
availability of the request.
If any interrupt request is pending, the processor enters the interrupt acknowledge cycle.
This signal is active high and internally synchronized.
MN/MX
The 8086 microprocessor can work in two modes of operations : Minimum mode and
Maximum mode.
In the minimum mode of operation the microprocessor do not associate with any co-
processors and can not be used for multiprocessor systems.
In the maximum mode the 8086 can work in multi-processor or co-processor
configuration.
Minimum or maximum mode operations are decided by the pin MN/ MX(Active low).
12
When this pin is high 8086 operates in minimum mode otherwise it operates in Maximum
mode.
13
, (Queue Status) The processor provides the status of queue in these lines.
The queue status can be used by external device to track the internal status of the queue in
, (Bus Request/ Bus Grant) These requests are used by other local bus
, , Status signals; used by the
masters to8086
forcebus
the controller
processor to generate
release thebus
local bus at the end of
timing and controlthesignals. Thesecurrent
processor’s are decoded as shown.
bus cycle.
These pins are bidirectional.
The request on will have higher priority than
8086.
The output on QS0 and QS1 can be interpreted as shown in the table.
LOCK
Output signal from 8086.
If this signal is low, processor prevents any other bus masters from accessing the
bus.
Instruction cycle
The time taken by the processor to execute an instruction.
Specified in terms of number of clock cycles.
Instruction can be decomposed into
o Fetch Instruction (FI)
o Decode instruction (DI)
o Calculate Operand Address(CO)
o Fetch Operands ( FO)
o Execute Instruction (EI)
o Write or store result in memory (WO)
The time for all these activities constitute the instruction cycle.
• The minimum mode is selected by applying logic 1 to the MN / MX’ input pin.
14
• This is a single microprocessor configuration.
• In this mode, all the control signals are given out by the microprocessor chip itself.
• The maximum mode is selected by applying logic 0 to the MN / MX’ input pin.
• This is a multi micro processors configuration-means in the maximum mode, there may be
more than one microprocessor in the system configuration.
• 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.
Assembler
• Systems Level Program that translates assembly language source code to machine language
• That is assembler converts computer instructions into a pattern of bits that the computer's
processor can use to perform its basic operations.
• The conversion process is referred to as assembly, or assembling the code.
• Assembly Language Programming:Using symbolic instructions to represent the raw data that
will form the machine language program and initial data constants
15