ECE-2015 Computer Architecture
Dr. Vivek Upadhyaya
School of Electronics Engineering, VIT-AP
Microprocessors
A microprocessor is the brain of the computer and it performs all the
• computational tasks
• data processing
The microprocessors can be classified based on the following features:
Instruction Set: It is the set of the instructions that the
microprocessor can execute.
Bandwidth: The number of bits processed by the microprocessor in
a single instruction, or the number of bits which are transfer via the
bus in parallel.
For example, the 8086 microprocessor called 16-bits, i.e. because it
can process, send, and evaluate 16 bits in parallel.
Clock Speed: It determines the speed of the instruction processing
inside the processor and it is measured in Hz.
Difference between 8085 and 8086
Feature 8085 8086
Data Bus Width 8-bit 16-bit
Address Bus Width 16-bit 20-bit
Maximum Memory 64 KB 1 MB
Architecture Von Neumann Pipelined (BIU + EU)
8 general purpose (AX, BX, CX, DX, SP, BP,
Registers 6 general purpose (B, C, D, E, H, L)
SI, DI)
Instruction Queue Not available 6-byte prefetch queue
Operating Modes Single mode Minimum & Maximum mode
Clock Speed ~3–6 MHz ~5–10 MHz
Interrupts 5 hardware interrupts 2 hardware interrupts
Flag Register 5 flags 9 flags
Multiprocessing
No Yes (in maximum mode)
Support
Year Introduced 1976 1978
8086 Architecture
The 8086 (16-bit
microprocessor) is
divided into two
independent functional
Bus Interface parts to speeds up
unit (BIU)
processing: BIU & EU
The BIU handles all
transfers of data and
addresses on the buses
for the execution unit.
The main functions of
EU are:
Execution • Decoding of Instructions
Unit (EU) • Execution of instructions
8086 Registers
8086 has a powerful set of 16-bit registers known as: General & Special Purpose
registers.
• General Data Registers
• Segment Registers
• Pointers and Index Registers
• Flag Register
AX - Accumulator
BX - Base Register
CX - Count Register
DX - Data Register
8086 Registers
General data registers:
• The registers AX, BX, CX, and DX are the general-purpose 16-bit
registers.
• AX is used as a 16-bit accumulator. The lower 8-bit is designated
as AL, and the higher 8-bit is designated as AH.
• BX is a 16-bit base register to hold the starting base location of a
memory region. BL indicates the lower 8-bit of BX, and BH
indicates the higher 8-bit of BX.
• The register CX is used as the default counter, i.e, to hold count
string, shift, and loop instructions.
• The DX register is a general-purpose register to contain an I/O port
address or I/O instructions.
8086 Registers
Special purpose registers: These registers are used as segment
registers, pointers and index registers.
• A segment register is a special 16-bit register in the 8086 microprocessor used to
store the base address of a memory segment.
• Since the 8086 has a 20-bit address bus, it can access 1 MB of memory, but its
registers are only 16 bits wide. To overcome this limitation, it uses segmentation.
8086 Registers
Special purpose registers: These registers are used as segment
registers, pointers and index registers.
Segment Registers
CS (Code Segment) Addressing memory location in the code segment of the
memory, where the executable program is stored.
SS (Stack Segment) It is used to address the stack segment of memory. The
stack segment is the portion of memory used to store stack
data.
DS (Data Segment) Points to the data segment of the memory where the data is
stored.
ES (Extra Segment) Points to the additional data segment of the memory where
the data is stored.
8086 Registers
Pointers and Index Registers
IP (Instruction pointer) IP contains offset within the code segment
BP (Base Pointer) Store the base memory address and act as an offset to
stack segment
SP (Stack Pointer) Used to point the current top value of stack and act as an
offset to stack segment.
SI (Source Index) SI is used to store the offset of source data in data
segment for string operation
DI (Destination Index) DI is used to store the offset of destination data in data
or extra segment for string operation
*Segment Address - it always points at starting address of segment block.
*Offset Address - use to points random position in segment
8086 Registers
8086 Registers
A 16-bit flag register is used in 8086, divided into two parts.
• Status flags (C, P, A, Z, S, & O) (Status flags reflect the result of arithmetic
and logical operations.)
• Control flags (T, I, & D) (Control flags control processor operations.)
JZ – Jump if Zero
JC – Jump if Carry
JO – Jump if Overflow
8086 Registers
A 16 bit flag register is used in 8086 divided into two parts .
• Status flags (C, P, A, Z, S, & O)
• Control flags (T, I, & D)
15 0
8086 Registers
C6 → Carry generated from bit 6 into bit 7 (carry into MSB)
C7 → Carry generated out of bit 7 (final carry out)
8086 Registers
8086 Registers
*An interrupt is a condition that halts the microprocessor temporarily to work on a
different task and then returns to its previous task.
*When a system is instructed to single-step, it will execute one instruction and then
stop.
ES Extra Segment
CS Code Segment
BIU registers SS Stack Segment
(20 bit) DS Data Segment
IP Instruction Pointer
AX AH AL Accumulator
BX BH BL Base Register
CX CH CL Count Register
DX DH DL Data Register
EU registers SP Stack Pointer
BP Base Pointer
SI Source Index Register
DI Destination Index Register
FLAGS
There are two types of addresses that are used for memory in the operating
system i.e. the physical address and logical address.
The physical address refers to a location in the memory. It allows access to data in
the main memory.
A logical address or virtual address is an address that is generated by the CPU
during program execution.
The logical address (generated by CPU) combines with the base address
generated by the MMU (Memory Management Unit) to form the physical address .
8086 Memory Segmentation
• 8086 is 16-bit microprocessor Physical Address = Segment address X
• Logical address: 16 bit 10 + offset address
• Physical address: 20 bits
Example:
If the data at any location has
a logical address specified as
2222 H : 0016 H
Then, the number 0016 H is
the offset. 2222 H is the value
of DS.
PA=2222X10+0016=22236 H
8086 Memory Segmentation
8086 Memory Segmentation
Solution:
Formula Used
𝐏𝐡𝐲𝐬𝐢𝐜𝐚𝐥 𝐀𝐝𝐝𝐫𝐞𝐬𝐬 = 𝐒𝐞𝐠𝐦𝐞𝐧𝐭 × 𝟏𝟎𝐇 + 𝐎𝐟𝐟𝐬𝐞𝐭
(10H = 16 decimal → left shift by 4 bits
8086 Memory Segmentation
8086 Memory Segmentation
Step 1: Find the Base Address of CS
4042𝐻 × 10𝐻 = 40420𝐻
8086 Memory Segmentation
Step 1: Find the Base Address of CS
4042𝐻 × 10𝐻 = 40420𝐻
8086 Memory Segmentation
8086 Memory Segmentation
Solution:
8086 Memory Segmentation
Solution:
Using SP (Stack Pointer)
Physical Address = 36400H + 1735H
36400H
+ 01735H
---------
37B35H
Effective (Physical) Address using SP = 37B35H
Using BP (Base Pointer)
Physical Address = 36400H + 4826H
36400H
+ 04826H
---------
3AC26H
Effective (Physical) Address using BP = 3AC26H
8086 Memory Segmentation
Questions for Practice:
Q1. The value of the Code Segment (CS) register is 3A50H, and the offsets are:
IP = 1200H
BX = 0450H
DI = 2100H, Calculate the effective (physical) addresses.
Q2. The value of the Data Segment (DS) register is 2C40H, and the offsets are:
BX = 1100H
SI = 0025H
DI = 3F20H, Find the physical addresses of memory locations.
Q3. The value of the Stack Segment (SS) register is 4500H, and the offsets are:
SP = 00F0H
BP = 0200H
DI = 1000H
Calculate physical addresses.
8086 Memory Segmentation
Q4. The value of the Extra Segment (ES) register is 5B20H, and the offsets are:
DI = 3000H
SI = 0100H
BX = 0A50H, Find physical addresses.
Q5. CS = 8000H
IP = 9000H
BX = F000H
Calculate physical addresses and check whether they exceed the 1MB limit.
Q6. DS = 1234H
Offsets are:
BX = 2222H
SI = 3333H
DI = 4444H, Find all physical addresses
8086 Memory Segmentation
1)
2)
8086 Memory Segmentation
3)
4)
8086 Memory Segmentation
5)
8086 Memory Segmentation
6)