MPMC Unit-1
MPMC Unit-1
UNIT–I Introduction: Basic Microprocessor architecture, Harvard and Von Neumann architectures with
examples, Microprocessor Unit versus Microcontroller Unit, CISC and RISC architectures.
8086 Architecture: Main features, pin diagram/description, 8086 microprocessor family, internal
architecture, bus interfacing unit, execution unit, interrupts and interrupt response, 8086 system timing,
minimum mode and maximum mode configuration.
***
Concept-1: Basic Microprocessor architecture, Harvard and Von Neumann architectures with examples
Concept-2: Microprocessor Unit versus Microcontroller Unit
Concept-3: CISC and RISC architectures
Concept-4: Main features of 8086mp
Concept-5: 8086 microprocessor family
Concept-6: Internal architecture
Concept-7: Pin diagram/description
Concept-8: Physical Memory Organization
Concept-9: Interrupts and interrupt response
Concept-10: 8086 system timing
Concept-11: Minimum mode and Maximum mode configuration
***
Concept-1: Basic Microprocessor architecture, Harvard and Von Neumann architectures with
examples
Introduction: A Microprocessor is a Digital Electronic Device used to perform several operations like data
transfer operations, arithmetic and logical operations and fabricated on a single Silicon integrated Circuit (IC)
Chip. It is used to fetch, decode and execute a given instruction.
Basics of Microprocessor –
A Microprocessor takes a bunch of instructions in machine language and executes them, telling the
processor what it has to do. Microprocessor performs three basic things while executing the instruction:
It performs some basic operations like addition, subtraction, multiplication, division, and some logical
operations using its Arithmetic and Logical Unit (ALU). New Microprocessors also perform operations
on floating-point numbers also.
Data in microprocessors can move from one location to another.
It has a Program Counter (PC) register that stores the address of the next instruction based on the value
of the PC, Microprocessor jumps from one location to another and takes decisions.
Fixed Program Computers – Their function is very specific and they couldn’t be reprogrammed, e.g.
Calculators.
Stored Program Computers – These can be programmed to carry out many different tasks, applications are
stored on them, hence the name.
Modern computers are based on a stored-program concept introduced by John Von Neumann.
In this stored-program concept, programs and data are stored in a separate storage unit called memories
and are treated the same.
This novel idea meant that a computer built with this architecture would be much easier to reprogram.
It is also known as ISA (Instruction set architecture) computer and is having three basic units:
Harvard Architecture
In a normal computer that follows von Neumann architecture, instructions and data both are stored in the same
memory. So same buses are used to fetch instructions and data.
This means the CPU cannot do both things together (read the instruction and read/write data). Harvard
Architecture is the computer architecture that contains separate storage and separate buses (signal path)
for instruction and data.
It was basically developed to overcome the bottleneck of Von Neumann Architecture.
The main advantage of having separate buses for instruction and data is that the CPU can access
instructions and read/write data at the same time.
Structure of Harvard Architecture:
Buses
Buses are used as signal pathways. In Harvard architecture, there are separate buses for both instruction
and data. Types of Buses:
Data Bus: It carries data among the main memory system, processor, and I/O devices.
Data Address Bus: It carries the address of data from the processor to the main memory system.
Instruction Bus: It carries instructions among the main memory system, processor, and I/O devices.
Instruction Address Bus: It carries the address of instructions from the processor to the main
memory system.
Operational Registers
There are different types of registers involved in it which are used for storing addresses of different types
of instructions.
For example, the Memory Address Register and Memory Data Register are operational registers.
Program Counter
It has the location of the next instruction to be executed. The program counter then passes this next address
to the memory address register.
Arithmetic and Logic Unit
The arithmetic logic unit is that part of the CPU that operates all the calculations needed. It performs
addition, subtraction, comparison, logical Operations, bit Shifting Operations, and various arithmetic
operations.
Control Unit
The Control Unit is the part of the CPU that operates all processor control signals. It controls the input
and output devices and also controls the movement of instructions and data within the system.
Input/Output System
Input devices are used to read data into main memory with the help of CPU input instruction. The
information from a computer as output is given through Output devices. The computer gives the results
of computation with the help of output devices.
Physical It uses one single physical address It uses two separate physical addresses
Address for accessing and storing both data for storing and accessing both
and instructions. instructions and data.
Buses (Signal One common signal path (bus) It uses separate buses for the transfer of
Paths) helps in the transfer of both both data and instructions.
instruction and data.
Number of It requires two clock cycles for It executes any instruction using only
Cycles executing a single instruction. one single cycle.
Access to The CPU is not able to read/write The CPU can easily read/write data as
CPU data and access instructions at the well as access the instructions at any
same time. given time.
Uses This method comes to play in the This architecture is best for signal
case of small computers and processing as well as microcontrollers.
personal computers.
Usage of This architecture does not waste This type of architecture can result in
Space any space. It is because the space wastage. It is because the
instruction memory can utilize the instruction memory cannot utilize the
left space of the data memory. It leftover space in the data memory. It
can also happen vice-versa. also cannot happen vice-versa.
Execution The speed of execution of the Von The overall speed of execution of
Speed Neumann Architecture is Harvard Architecture is comparatively
comparatively slower. It is faster. It is because the processor, in
because it is not capable of this case, is capable of fetching both
fetching the instructions and data instructions and data at the very same
both at the same time. time.
Characteristics of RISC:
1. It has simpler instructions and thus simple instruction decoding.
2. More general-purpose registers.
3. The instruction takes one clock cycle in order to get executed.
4. The instruction comes under the size of a single word.
5. Pipeline can be easily achieved.
6. Few data types.
7. Simpler addressing modes.
Characteristics of CISC:
1. Instructions are complex, and thus it has complex instruction decoding.
2. The instructions may take more than one clock cycle in order to get executed.
3. The instruction is larger than one-word size.
4. Lesser general-purpose registers since the operations get performed only in the memory.
5. More data types.
6. Complex addressing modes.
Both CISC and RISC approaches primarily try to increase the performance of a CPU. Here is how both of
these work:
1. CISC: This kind of approach tries to minimize the total number of instructions per program, and it does so
at the cost of increasing the total number of cycles per instruction.
2. RISC: It reduces the cycles per instruction and does so at the cost of the total number of instructions per
program.
When programming was done in assembly language earlier, there was a desire to make the instructions perform
more tasks. It is because assembly programming was arduous and error-prone and led to the evolution of CISC
architecture. But as the dependency of high-level language on assembly language decreased, RISC architecture
prevailed.
Example
Suppose we need to add two different 8-bit numbers:
1. CISC approach: There would be a single instruction or command for this, such as ADD, that would
perform the task.
2. RISC approach: In this case, the programmer would write the very first load command in order to load
data in the registers. Then it would use a suitable operator and store the obtained result in the location that is
desired.
The add operation here is divided into parts, namely, operate, load, and store. Due to this, RISC
programs are much longer, and they require more memory to get stored, even though they require fewer
transistors because the commands are less complex.
Practice Problems in RISC and CISC Architecture
1. Both the RISC and CISC architectures have primarily been developed to reduce _____________.
a. Time delay
b. Semantic gap
c. Cost
d. All of the above
Answer – (b) Semantic gap
2. Pipe-lining is the special feature of ____________.
a. IANA
b. ISA
c. CISC
d. RISC
Answer – (d) RISC
3. Which of these architectures is power efficient?
a. IANA
b. ISA
c. CISC
d. RISC
Answer – (d) RISC
Generations of microprocessors:
First-generation –
From 1971 to 1972 the era of the first generation came which brought microprocessors like INTEL 4004
Rockwell international PPS-4 INTEL 8008 etc.
Second generation –
The second generation marked the development of 8-bit microprocessors from 1973 to 1978. Processors like
INTEL 8085 Motorola 6800 and 6801 etc came into existence.
Third generation –
The third generation brought forward the 16-bit processors like INTEL 8086/80186/80286 Motorola 68000
68010 etc. From 1979 to 1980 this generation used the HMOS technology.
Fourth generation –
The fourth-generation came into existence from 1981 to 1995. The 32-bit processors using HMOS fabrication
came into existence. INTEL 80386 and Motorola 68020 are some of the popular processors of this generation.
Fifth-generation –
From 1995 till now we are in the fifth generation. 64-bit processors like PENTIUM, Celeron, dual, quad, and
octa-core processors came into existence.
Types of microprocessors :
Superscalar microprocessor –
These processors can perform many tasks at a time. They can be used for ALUs and multiplier-like arrays.
They have multiple operation units and perform tasks by executing multiple commands.
Disadvantages of microprocessors –
8086 Microprocessor is divided into two functional units, i.e., EU (Execution Unit) and BIU (Bus Interface
Unit). It has the following functional parts –
EU (Execution Unit)
Execution unit gives instructions to BIU stating from where to fetch the data and then decode and execute
those instructions. Its function is to control operations on data using the instruction decoder & ALU. EU has
no direct connection with system buses as shown in the above figure, it performs operations over data through
BIU.
ALU
It handles all arithmetic and logical operations, like +, −, ×, /, OR, AND, NOT operations.
Flag Register
It is a 16-bit register that behaves like a flip-flop, i.e. it changes its status according to the result stored in the
accumulator. It has 9 flags and they are divided into 2 groups − Conditional Flags and Control Flags.
Conditional Flags:
It represents the result of the last arithmetic or logical instruction executed. Following is the list of conditional
flags −
• Carry flag − This flag indicates an overflow condition for arithmetic operations.
• Auxiliary flag − When an operation is performed at ALU, it results in a carry/barrow from lower
nibble (i.e. D0 – D3) to upper nibble (i.e. D4 – D7), then this flag is set, i.e. carry given by D3 bit to
D4 is AF flag. The processor uses this flag to perform binary to BCD conversion.
• Parity flag − This flag is used to indicate the parity of the result, i.e. when the lower order 8-bits of
the result contains even number of 1’s, then the Parity Flag is set. For odd number of 1’s, the Parity
Flag is reset.
• Zero flag − This flag is set to 1 when the result of arithmetic or logical operation is zero else it is set
to 0.
• Sign flag − This flag holds the sign of the result, i.e. when the result of the operation is negative, then
the sign flag is set to 1 else set to 0.
• Overflow flag − This flag represents the result when the system capacity is exceeded.
Control Flags:
Control flags controls the operations of the execution unit. Following is the list of control flags −
• Trap flag − It is used for single step control and allows the user to execute one instruction at a time
for debugging. If it is set, then the program can be run in a single step mode.
• Interrupt flag − It is an interrupt enable/disable flag, i.e. used to allow/prohibit the interruption of a
program. It is set to 1 for interrupt enabled condition and set to 0 for interrupt disabled condition.
• Direction flag − It is used in string operation. As the name suggests when it is set then string bytes are
accessed from the higher memory address to the lower memory address and vice-a-versa.
Register Organization of 8086 :
General purpose register:
There are 8 general purpose registers, i.e., AH, AL, BH, BL, CH, CL, DH, and DL. These registers can be
used individually to store 8-bit data and can be used in pairs to store 16bit data. The valid register pairs are
AH and AL, BH and BL, CH and CL, and DH and DL. It is referred to the AX, BX, CX, and DX respectively.
• AX register − It is also known as accumulator register. It is used to store operands for arithmetic
operations.
• BX register − It is used as a base register. It is used to store the starting base address of the memory
area within the data segment.
• CX register − It is referred to as counter. It is used in loop instruction to store the loop counter.
• DX register − This register is used to hold I/O port address for I/O instruction.
S0, S1, S2
These are the status signals that provide the status of operation, which is used by the Bus Controller
8288 to generate memory & I/O control signals. These are available at pin 26, 27, and 28. Following
is the table showing their status −
LOCK
When this signal is active, it indicates to the other processors not to ask the CPU to leave the system
bus. It is activated using the LOCK prefix on any instruction and is available at pin 29.
RQ/GT1 and RQ/GT0
These are the Request/Grant signals used by the other processors requesting the CPU to release the
system bus. When the signal is received by CPU, then it sends acknowledgment. RQ/GT0 has a higher
priority than RQ/GT1.
There are 20 address lines in the 8086 microprocessor. This gives us 220 different memory locations
Hence the total size is 220 Bytes (is each memory location is Byte Addressable, one byte of data can he stored
at every single location), which is equal to IMB
Even the memory is byte-addressable yet the 8086 microprocessor an easily handle up to 16 bits of
data at a time through its 16 data lines. So, to organize the memory efficiently, the entire memory in 8086 is
divided into two memory banks: odd bank and the even bank
The way in which data is read or written is decided by the value of BHE, and the last address but that is the
AO line. It is done in the following way
1 1 No operation is performed
To read or write 8 bits of data, it would require only 1 CPU cycle, no matter the data is stored in any
of the memory banks, but to read or write 16 bits of data, the BIL of the 8086 may require either I or 2
memory cycles depending upon whether the lower byte of word is located at even or odd memory
address
If the lower byte of the word is stored at even memory bank and the upper byte is stored at odd memory
bank then the CPU will require only I memory cycle. So, it is better to store data in this way
If the lower byte of the word is located at an odd memory address, then the CPU will require 2 memory
cycles.
The first memory cycle is required for accessing the lower byte of the word through the higher data
bus, ie D15 to DS, and the second memory cycle is required for accessing the upper byte of the word
through the lower data bus, ie D7 to DO
Hardware Interrupts
Hardware interrupt is caused by any peripheral device by sending a signal through a specified pin to
the microprocessor. The 8086 has two hardware interrupt pins, i.e. NMI and INTR. NMI is a non-maskable
interrupt and INTR is a maskable interrupt having lower priority. One more interrupt pin associated is INTA
called interrupt acknowledge.
NMI
It is a single non-maskable interrupt pin (NMI) having higher priority than the maskable interrupt
request pin (INTR)and it is of type 2 interrupt.
When this interrupt is activated, these actions take place −
• Completes the current instruction that is in progress.
• Pushes the Flag register values on to the stack.
• Pushes the CS (code segment) value and IP (instruction pointer) value of the return address on to the
stack.
• IP is loaded from the contents of the word location 00008H.
• CS is loaded from the contents of the next word location 0000AH.
• Interrupt flag and trap flag are reset to 0.
INTR
The INTR is a maskable interrupt because the microprocessor will be interrupted only if interrupts are
enabled using set interrupt flag instruction. It should not be enabled using clear interrupt Flag instruction. The
INTR interrupt is activated by an I/O port. If the interrupt is enabled and NMI is disabled, then the
microprocessor first completes the current execution and sends ‘0’ on INTA pin twice. The first ‘0’ means
INTA informs the external device to get ready and during the second ‘0’ the microprocessor receives the 8 bit,
say X, from the programmable interrupt controller.
These actions are taken by the microprocessor −
• First completes the current instruction.
• Activates INTA output and receives the interrupt type, say X.
• Flag register value, CS value of the return address and IP value of the return address are pushed on to
the stack.
• IP value is loaded from the contents of word location X × 4
• CS is loaded from the contents of the next word location.
• Interrupt flag and trap flag is reset to 0
Software Interrupts
Some instructions are inserted at the desired position into the program to create interrupts. These
interrupt instructions can be used to test the working of various interrupt handlers. It includes −
INT- Interrupt instruction with type number
It is 2-byte instruction. First byte provides the op-code and the second byte provides the interrupt type number.
There are 256 interrupt types under this group.
Its execution includes the following steps −
• Flag register value is pushed on to the stack.
• CS value of the return address and IP value of the return address are pushed on to the stack.
• IP is loaded from the contents of the word location ‘type number’ × 4
• CS is loaded from the contents of the next word location.
• Interrupt Flag and Trap Flag are reset to 0
The starting address for type0 interrupt is 000000H, for type1 interrupt is 00004H similarly for type2
is 00008H and ……so on. The first five pointers are dedicated interrupt pointers. i.e. −
TYPE 0 interrupt represents division by zero situation.
TYPE 1 interrupt represents single-step execution during the debugging of a program.
TYPE 2 interrupt represents non-maskable NMI interrupt.
TYPE 3 interrupt represents break-point interrupt.
TYPE 4 interrupt represents overflow interrupt.
The interrupts from Type 5 to Type 31 are reserved for other advanced microprocessors, and interrupts from
32 to Type 255 are available for hardware and software interrupts.
INT 3-Break Point Interrupt Instruction. It is a 1-byte instruction having op-code is CCH. These instructions
are inserted into the program so that when the processor reaches there, then it stops the normal execution of
program and follows the break-point procedure.
Its execution includes the following steps −
• Flag register value is pushed on to the stack.
• CS value of the return address and IP value of the return address are pushed on to the stack.
• IP is loaded from the contents of the word location 3×4 = 0000CH
• CS is loaded from the contents of the next word location.
• Interrupt Flag and Trap Flag are reset to 0
The first 1Kbyte of memory of 8086 (00000 to003FF) is set aside as a table for storing the starting
addresses of Interrupt Service Procedures(ISP).Since 4-bytes are required for storing starting addresses of
ISPs, the table can hold 256 Interrupt procedures.
The starting address of an ISP is often called the Interrupt Vector or Interrupt Pointer. Therefore the
table is referred as Interrupt Vector Table. In this table, IP value is put in as low word of the vector & CS is
put in high vector.
There are at least four clock periods in a bus cycle of 8086 microprocessor. These four clock periods are called
T1, T2, T3 and T4 states.
These four clock states gives bus cycle duration T of 200 ns *4 = 800 ns in 5-MHz 8086 system.
Read Cycle :
When a read cycle is to be performed, during T1 microprocessor puts an address on address bus, and then bus
is put in high impedance state during T2 state. Data to be read must be out on bus during T3 and T4. During
T3 bus is made “reserved for data in” and finally data is read during T4.
Write Cycle :
In case of write memory cycle, during T1 state microprocessor puts an address on address bus. Data is put on
data bus by CPU during T2 state and maintained during T3 and T4 states, that is written out to memory or I/O
devices.
The microprocessor 8086 is operated in minimum mode by strapping its MN/MX pin to logic 1.
In this mode, all the control signals are given out by the microprocessor chip itself.
There is a single microprocessor in the minimum mode system.
The remaining components in the system are latches, transceivers, clock generator, memory and I/O
devices.
Latches are generally buffered output D-type flip-flops like 8282. They are used for separating the
valid address from the multiplexed address/data signals and are controlled by the ALE signal generated
by 8086.
Transceivers are the bidirectional buffers and some times they are called as data amplifiers. They are
required to separate the valid data from the time multiplexed address/data signals. They are controlled
by two signals namely, DEN and DT/R.
The DEN signal indicates the direction of data, i.e. from or to the processor.
The system contains memory for the monitor and users program storage. Usually, EPROM are used
for monitor storage, while RAM for users program storage. A system may contain I/O devices.
The opcode fetch and read cycles are similar. Hence the timing diagram can be categorized in two
parts, the first is the timing diagram for read cycle and the second is the timing diagram for write cycle.
Read & Write Cycles:
The read cycle begins in T1 with the assertion of address latch enable (ALE) signal and also M / IO
signal. During the negative going edge of this signal, the valid address is latched on the local bus.
The BHE and A0 signals address low, high or both bytes. From T1 to T4 , the M/IO signal indicates a
memory or I/O operation.
At T2, the address is removed from the local bus and is sent to the output. The bus is then tristated.
The read (RD) control signal is also activated in T2.
The read (RD) signal causes the address device to enable its data bus drivers. After RD goes low, the
valid data is available on the data bus.
The addressed device will drive the READY line high. When the processor returns the read signal to
high level, the addressed device will again tristate its bus drivers. A write cycle also begins with the
assertion of ALE and the emission of the address.
The M/IO signal is again asserted to indicate a memory or I/O operation. In T2, after sending the
address in T1, the processor sends the data to be written to the addressed location.
The data remains on the bus until middle of T4 state. The WR becomes active at the beginning of T2
(unlike RD is somewhat delayed in T2 to provide time for floating).
The BHE and A0 signals are used to select the proper byte or bytes of memory or I/O word to be read
or write.
In the maximum mode, the 8086 is operated by strapping the MN/MX pin to ground.
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. 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 RD and WR ( for
memory and I/O devices), DEN, DT/R, ALE etc. using the information by the processor on the status
lines.
The bus controller chip has input lines S2, S1, S0 and CLK. These inputs to 8288 are driven by CPU.
It derives the outputs ALE, DEN, DT/R, MRDC, MWTC, AMWC, IORC, IOWC and AIOWC. The
AEN, IOB and CEN pins are specially useful for multiprocessor systems.
AEN and IOB are generally grounded. CEN pin is usually tied to +5V. The significance of the
MCE/PDEN output depends upon the status of the IOB pin.
INTA pin used to issue two interrupt acknowledge pulses to the interrupt controller or to an interrupting
device.
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.
Here the only difference between in timing diagram between minimum mode and maximum mode is
the status signals used and the available control and advanced command signals.
Read & Write Cycles:
S0, S1, S2 are set at the beginning of bus cycle.8288 bus controller will output a pulse as on the ALE
and apply a required signal to its DT / R pin during T1.
In T2, 8288 will set DEN=1 thus enabling transceivers, and for an input it will activate MRDC or
IORC. These signals are activated until T4.
For an output, the AMWC or AIOWC is activated from T2 to T4 and MWTC or IOWC is activated
from T3 to T4.
The status bit S0 to S2 remains active until T3 and become passive during T3 and T4.
If reader input is not activated before T3, wait state will be inserted between T3 and T4.
Fig: Maximum mode Read Cycle
2. Draw the minimum mode pin diagram and explain the function of each pin in detail.
3. Explain the functions of ALE, READY, HOLD, and BHE pins of 8086 microprocessor.
ALE
It stands for address enable latch and is available at pin 25. A positive pulse is generated each time the
processor begins any operation. This signal indicates the availability of a valid address on the address/data
lines.
Ready
It is available at pin 22. It is an acknowledgement signal from I/O devices that data is transferred. It is an active
high signal. When it is high, it indicates that the device is ready to transfer data. When it is low, it indicates
wait state.
HOLD
This signal indicates to the processor that external devices are requesting to access the address/data buses. It
is available at pin 31.
BHE
BHE stands for Bus High Enable. It is available at pin 34 and used to indicate the transfer of data using data
bus D8-D15. This signal is low during the first clock cycle, thereafter it is active.
5. Draw the flag register of 8086 microprocessor and explain the function of each flag.
Conditional Flags
Conditional flags are as follows:
Carry Flag (CY): This flag indicates an overflow condition for unsigned integer
arithmetic. It is also used in multiple-precision arithmetic.
Auxiliary Flag (AC): 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 AC flag is set i.e. carry given by D3 bit to D4 is AC flag. This is not a
general-purpose flag, it is used internally by the Processor to perform Binary to BCD conversion.
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.
Control Flags:
Control flags are set or reset deliberately to control the operations of the execution unit.
Control flags are as follows:
Trap Flag (TF): 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.
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.
6. Differentiate between minimum and maximum mode operations of 8086 microprocessor.
In minimum mode there can be only one processor In maximum mode there can be multiple processors
i.e. 8086. with 8086, like 8087 and 8089.
ALE for the latch is given by 8086 as it is the only ALE for the latch is given by 8288 bus controller as
processor in the circuit. there can be multiple processors in the circuit.
DEN and DT/R for the trans-receivers are given by DEN and DT/R for the trans-receivers are given by
8086 itself. 8288 bus controller.
Direct control signals M/IO, RD and WR are given Instead of control signals, each processor generates
by 8086. status signals called S2, S1 &S0.
Control signals M/IO, RD and WR are decoded by Status signals S2, S1 &S0 are decoded by a bus
a 3:8 decoder like 74138. controller like 8288 to produce control signals.
INTA is given by 8086 in response to an interrupt INTA is given by 8288 bus controller in response to an
on INTR line. interrupt on INTR line.
HOLD and HLDA signals are used for bus request RQ /GT lines are used for bus requests by other
with a DMA controller like 8237. processors like 8087 or 8089.
Multiprocessing cannot be performed hence As multiprocessing can be performed, it can give very
performance is lower. high performance.
Segmentation is the process in which the main memory of the computer is divided into different segments
and each segment has its own base address. It is basically used to enhance the speed of execution of the
computer system, so that processor is able to fetch and execute the data from the memory easily and fast.
Need for Segmentation –
The Bus Interface Unit (BIU) contains four 16 bit special purpose registers (mentioned below) called as
Segment Registers.
• Code segment register (CS): is used for addressing memory location in the code segment of the memory,
where the executable program is stored.
• Data segment register (DS): points to the data segment of the memory where the data is stored.
• Extra Segment Register (ES): also refers to a segment in the memory which is another data segment in the
memory.
• Stack Segment Register (SS): is used for addressing stack segment of the memory. The stack segment is that
segment of memory which is used to store stack data.
The number of address lines in 8086 is 20, 8086 BIU will send 20bit address, so as to access one of the 1MB
memory locations. The four segment registers actually contain the upper 16 bits of the starting addresses of
the four memory segments of 64 KB each with which the 8086 is working at that instant of time. A segment
is a logical unit of memory that may be up to 64 kilobytes long. Each segment is made up of contiguous
memory locations. It is independent, separately addressable unit. Starting address will always be changing. It
will not be fixed. Note that the 8086 does not work the whole 1MB memory at any given time. However it
works only with four 64KB segments within the whole 1MB memory.
Bellow is the one way of positioning four 64 kilobyte segments within the 1M byte memory space of an 8086.
Types of Segmentation –
1. Overlapping Segment – A segment starts at a particular address and its maximum size can go up to
64kilobytes. But if another segment starts along this 64kilobytes location of the first segment, then
the two are said to be Overlapping Segment.
2. Non-Overlapped Segment – A segment starts at a particular address and its maximum size can go
up to 64kilobytes. But if another segment starts before this 64kilobytes location of the first segment,
then the two segments are said to be Non-Overlapped Segment.
Advantages of the Segmentation The main advantages of segmentation are as follows:
• It provides a powerful memory management mechanism.
• Data related or stack related operations can be performed in different segments.
• Code related operation can be done in separate code segments.
• It allows to processes to easily share data.
• It allows to extend the address ability of the processor, i.e. segmentation allows the use of 16 bit
registers to give an addressing capability of 1 Megabytes. Without segmentation, it would require 20
bit registers.
• It is possible to enhance the memory size of code data or stack segments beyond 64 KB by allotting
more than one segment for each area.
D This is directional flag. This is used in string related operations. D = 1, then the string will be
accessed from higher memory address to lower memory address, and if D = 0, it will do the
reverse.
I This is interrupt flag. If I = 1, then MPU will recognize the interrupts from peripherals. For I = 0,
the interrupts will be ignored
T This trap flag is used for on-chip debugging. When T = 1, it will work in a single step mode.
After each instruction, one internal interrupt is generated. It helps to execute some program
instruction by instruction.
MICROPROCESSOR AND MICROCONTROLLER Page |1
Unit Outcomes:
At the end of this unit you will learn:
1. Write a task list, flow chart or pseudo code for simple programming problem.
2. Write code, assemble and run a very simple assembly language program.
3. Describe the use of program development tools such as editors, assemblers,
linkers, locators, debuggers and emulators.
4. Properly document assembly language programs
Introduction:
What is Assembly Language?
➢ An assembly language is a low-level programming language for microprocessors and
other programmable devices.
➢ Each personal computer has a microprocessor that manages the computer's
arithmetical, logical, and control activities.
➢ Each family of processors has its own set of instructions for handling various
operations such as getting input from keyboard, displaying information on screen and
performing various other jobs. These set of instructions are called 'machine language
instructions'.
➢ A processor understands only machine language instructions, which are strings of 1's
and 0's.
➢ An assembly language implements a symbolic representation of the machine code
needed to program a given CPU architecture.
Why you should learn Assembly Language?