Unit 1 and 3-MPMC Sem4 2022
Unit 1 and 3-MPMC Sem4 2022
Unit 1 and 3-MPMC Sem4 2022
Syllabus
Course Outcomes
CO No. CO Statement (At the end of the course, students will be able BL
…)
Eg= PA is 80000
Of instruction
Cs=?= 8000
IP=?= 0000
8 0 0 0= CS
+ 0 0 0 0=IP
8 0 0 0 0= PA
Example of physical address calculation
• Suppose,
• CS= Code segment holds the value 3000 (remember, this is contents of the register CS)
• This is actually a 16bit hexadecimal number(0011 0000 0000 0000)
• Let IP= instruction pointer hold the value FFFF (This is the content of register IP)
• Then 20 bit physical address is calculated as
• 3 0 0 0 (segment address/ base address)
• + F F F F (Offset address)
• =3 F F F F= 20 bit physical address
• 2)CS has 4042
• IP has 0580
• Physical address is
• 4042
• + 05 8 0
• = 4 0 9 A 0
• (Contents= data=16bit)
Queue
• 6 Byte Pre-fetch Queue:
• It is a 6 byte queue (FIFO).
• Fetching the next instruction (by BIU from CS) while executing the
current instruction is called pipelining.
• Gets flushed whenever a branch instruction occurs.
EU
• Stack Pointer:
Points to Stack top. Stack is in Stack Segment, used during
instructions like PUSH, POP, CALL, RET etc.
• Base Pointer:
BP can hold offset address of any location in the stack segment. It is
used to access random locations of the stack.
• Source Index:
It holds offset address in Data Segment during string operations.
• Destination Index:
It holds offset address in Extra Segment during string operations
Combinations of Segment and pointer
registers( produce addresses)
• CS:IP= produce 20 bit address of instruction/command
• SS:SP and SS:BP=produce 20 bit address of stack
• DS: SI= produce 20 bit address of input data
• ES: DI= produce 20 bit address to store/ display the output
• IP is in BIU, because it helps to calculate the address of the instruction
• Contents of all these registers is 16bit
• Their 16 bit contents are combined using the same formula to
produce 20 bit address.
• All these registers have addresses also, their addresses are 20 bits
EU- the below mentioned are used only for
temporary storage and arithmetic calculations.
• AX register:- Accumulator
It holds operands and results during multiplication and division operations. Also an accumulator
during String operations.
• BX register:
BX temporary storage. Especially multiplication.
• CX register:
It holds count for instructions like loop, rotate, shift and string operations, like a counter.
• DX register:
It is used with AX to hold 32 bit values during multiplication and division.
• Note: All these are 16 bit
Note
• Please note that the input data, or the output results are not stored
in any of these registers.
• The instruction, data input and output are stored somewhere in
addresses calculated by these registers.
• We just collect 16bit contents of these registers to calculate address
of instructions and data.
Flag register
Status Flags
Flag Bit Function
S After any operation if the MSB is 1, then it indicates that the number is negative. And this flag is
set to 1
AC When some arithmetic operations generates carry after the lower half and sends it to upper half,
the AC will be 1
P This is even parity flag. When result has even number of 1, it will be set to 1, otherwise 0 for odd
number of 1s
CY This is carry bit. If some operations are generating carry after the operation this flag is set to 1
O The overflow flag is set to 1 when the result of a signed operation is too large to fit.
Control Flags
Flag Bit Function
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.
Pin Diagram
Desription
• VCC – Pin number 40 – At this pin, the external power supply of + 5V is
provided to the processor.
• VSS – Pin number 1 and 20 – These two pins acts as the ground. This pin
directs the extra current of the microprocessor to ground.
• AD0 – AD15 – Pin number 2 to 16 and 39 – These are the multiplexed
address and data bus.
• We know that the 8086 microprocessor has 20-bit address bus and 16-bit
data bus. So, the 16 lines of the address and data bus are multiplexed
together so as to reduce the number of lines inside the IC.
• We are aware of the fact that at a time either address or data will be
transmitted by the bus. So, at a particular time only either the address or the
data bus will be enabled from the multiplexed buses.
• A16/S3, A17/S4, A18/S5 and A19S6 – Pin number 35 to 38 – Out of 20
address bits, 4 are present in the multiplexed form with the status
signals. In the case of memory operations, these pins act as an address
bus and contain the memory address of any particular instruction or
data.
• Basically, the signal at S3 and S4 show that which segment is currently
accessed by the microprocessor among the four segments present in it.
Status signals s3 and s4
• S5 acts as interrupt flag. S6 is always 0
• BHE’/S7 : Bus High Enable/Status. During T1 it is low. It is used to enable
data onto the most significant half of data bus, D8-D15. 8-bit device
connected to upper half of the data bus use BHE (Active Low) signal. It is
multiplexed with status signal S7. S7 signal is available during T2, T3 and T4.
• RD’: This is used for read operation. It is an output signal. It is active when
low.
• READY : This is the acknowledgement from the memory or slow device that
they have completed the data transfer. The signal made available by the
devices is synchronized by the 8284A clock generator to provide ready input
to the microprocessor. The signal is active high(1).
• INTR : Interrupt Request. This is triggered input. This is sampled during the last
clock cycles of each instruction for determining the availability of the request. If
any interrupt request is found pending, the processor enters the interrupt
acknowledge cycle. This can be internally masked after resulting the interrupt
enable flag. This signal is active high(1) and has been synchronized internally.
• NMI : Non maskable interrupt. This is an edge triggered input which results in a
type II interrupt. A subroutine is then vectored through an interrupt vector lookup
table which is located in the system memory. NMI is non-maskable internally by
software. A transition made from low(0) to high(1) initiates the interrupt at the
end of the current instruction. This input has been synchronized internally.
• MN/MX’ : Minimum/Maximum. This pin signal indicates what mode the
processor will operate in. If high, Minimum mode, If Low, Maximum mode.
• TEST’ : This examined by a ‘WAIT’ instruction. If the TEST pin goes
low(0), execution will continue, else the processor remains in an idle
state. The input is internally synchronized during each of the clock
cycle on leading edge of the clock.
• CLK : Clock Input. The clock input provides the basic timing for
processing operation and bus control activity. Its an asymmetric square
wave with a 33% duty cycle.
• RESET : This pin requires the microprocessor to terminate its present
activity immediately. The signal must be active high(1) for at least
four clock cycles.
Minimum mode special signals
• INTA’ : Interrupt acknowledge. It is active low(0) during T2, T3 and Tw of
each interrupt acknowledge cycle.
• DT/R’ : Data Transmit/Receive. This pin is required in minimum systems,
that want to use an 8286 or 8287 data bus transceiver. The direction of data
flow is controlled through the transceiver.
• DEN’ : Data enable. This pin is provided as an output enable for the
8286/8287 in a minimum system which uses transceiver. DEN is active
low(0) during each memory and input-output access and for INTA cycles.
• ALE : Address Latch Enable. ALE is provided by the microprocessor to
latch the address into the 8282 or 8283 address latch. It is an active high(1)
pulse during T1 of any bus cycle.
• HOLD/HLDA : HOLD indicates that another master has been requesting
a local bus .This is an active high(1). The microprocessor receiving the
HOLD request will issue HLDA (high) as an acknowledgement in the
middle of a T4 or T1 clock cycle
• M/IO’
• This signal is used to distinguish between memory and I/O
operations. When it is low, it indicates I/O operation and when it is
high indicates the memory operation. It is available at pin 28.
• WR’ : It stands for write signal and is available at pin 29. It is used
to write the data into the memory or the output device depending
on the status of M/IO signal.
QS1 and QS0
These are queue status signals and are available at pin 24 and 25. These signals provide the status of instruction queue. Their conditions are shown in the following table −