Beruflich Dokumente
Kultur Dokumente
General- Serial
I/O
Purpose RAM ROM Timer COM
Port
Micro- Port
processor
Address Bus
General-Purpose Microprocessor System
Microcontroller
• A smaller computer
• On-chip RAM, ROM, I/O ports...
• Example:Motorola’s 6811, Intel’s 8051, Zilog’s Z8 and PIC 16X
6
DATA SIZE
Nibble 4 bit
Byte 8 bit
Word 16 bit
7
Evolution of Microprocessors
• The first microprocessor
- Intel 4004 (4 bit) -1971.
- Intel 4040 (4 bit) enhanced version of 4004.
- Rockwell International’s PPS - 4
- Toshiba’s T3472
• The Second microprocessor
- Intel introduced first 8 bit processor in 1972.
- Intel 8008 with PMOS technology.
- In 1973, Intel 8080 with faster 8 bit NMOS technology
and compatible with TTL logic (it need 3 power supplies)
- In 1975, Intel 8085 was developed with an improved
version of 8080 which uses only one +5 volt supply.
The 8 bit processors of other manufacturers are
- Zilog’s Z80 and Z800.
- National Semiconductor’s NSC 800.
- Motorola’s MC 6800 and MC 6809.
- MOS Technology’s 6500 series.
- Rockwell International’s PPS-8,
RCA COSMAC (it uses CMOS Technology).
Generally, the memory addressing capacity of 8 bit microprocessors
are 64 KB. The clock frequency between 1 – 6 MHz. The Z800 can
address more memory i.e. 500 KB and it operates at 25 MHz.
The 8 bit microprocessors use LSI technology and contain 5000 to
10,000 transistors.
In 1978, Intel introduced as 16 bit processor Intel 8086.
The other 16 bit processors are
- Intel 80186, Intel 8088, Intel 80188, Intel 80286.
- Zilog’s Z8000
- Motorola’s 68000, 68010, 68012,
- National Semiconductors PACE and INS 8900.
- Fairchild’s 9440
- Texas Instruments TMS 9900 series and so on.
Clock Data
Name Date Transi stor s Micron s MIPS
speed w idth
8080 1974 6,000 6 2 MHz 8 bits 0.64
16 bits
8088 1979 29,000 3 5 MHz 8-bit 0.33
bus
80286 1982 134,000 1.5 6 MHz 16 bits 1
80386 1985 275,000 1.5 16 MHz 32 bits 5
80486 1989 1,200, 000 1 25 MHz 32 bits 20
32 bits
Pentium 1993 3,100, 000 0.8 60 MHz 64-bit 100
bus
32 bits
233
Pentium II 1997 7,500, 000 0.35 64-bit ~300
MHz
bus
32 bits
450
Pentium III 1999 9,500, 000 0.25 64-bit ~510
MHz
bus
32 bits
Pentium 4 2000 42,000,000 0.18 1.5 GHz 64-bit ~1,700
bus
32 bits
Pentium 4
2004 125,000,000 0.09 3.6 GHz 64-bit ~7,000
"Prescott"
bus
8086 Features
•The BIU fetches instructions, reads and writes data, and computes the 20-bit
address. The EU decodes and executes the instructions using the 16-bit ALU.
Data is fetched using a segment register (usually the DS) and an effective
address (EA) computed by the EU depending on the addressing mode.
3. Arithmetic Logic Unit : ALU is 16 bit. It can add, subtract, AND, OR, XOR,
Increment, Decrement, Complement and Shift binary numbers.
Register Organization : The 8086 has a powerful set of registers. It
includes general purpose registers, segment registers, Pointers and
index registers and flag register.
SP
BH BL
BX
SI
CH CL
DI
CX
DH DL
DX Se gme nt
CS
Flag s DS
IP ES
The General purpose registers (16 – bit):
BX BH BL Base Register
CX CH CL Count Register
DX DH DL Data Register
SP Stack Pointer
EU registers BP Base Pointer
FLAGS
Instructions execute faster if the data is in a register AX, BX, CX,
DX are the data registers
Low and High bytes of the data registers can be accessed separately
- AH, BH, CH, DH are the high bytes
- AL, BL, CL, and DL are the low bytes
Data Registers are general purpose registers but they also perform
special functions
AX
- Accumulator Register
- Preferred register to use in arithmetic, logic and data
transfer instructions because it generates the shortest
- Machine Language Code
- Must be used in multiplication and division
operations and also be used in I/O operations
BX
- Base Register
- Also serves as an address register
- Used in array operations
- Used in Table Lookup operations (XLAT)
CX
- Count register
- Used as a loop counter
- Used in shift and rotate operations
DX
- Data register
- Used in multiplication and division
- Also used in I/O operations
AX, BX, CX and DX are two
bytes wide and each byte can
be accessed separately
These registers are used as
memory pointers.
EU registers AX AH AL Accumulator
BX BH BL Base Register
CX CH CL Count Register
DX DH DL Data Register
SP Stack Pointer
BP Base Pointer
SI Source Index Register
DI Destination Index Register
FLAGS
29
Segment Registers : The 8086 addresses a segmented memory. The
complete 1 megabyte memory is divided into 16 logical segments.
Each segment contains 64 Kbytes of memory.
1. The 8086 allows only four active segment at a time. These four
registers are Code Segment (CS), Data Segment (DS), Stack Segment
(SS) and Extra Segment (ES) registers.
2. The Physical address of the 8086 is 20 bit wide to access 1 MB
memory location. However, its segment registers and memory
location contains logical addresses are just 16 bit wide.
3. The Physical address is calculated from two parts, the first is segment
address and the second is offset.
4. The segment registers contain 16 bit segment base address related
to different segments. The pointers, Index registers or BX may contain
the offset of the location to be addressed
5. The advantage is that instead of maintaining a 20 bit register for
physical address, the processors just maintains two 16 bit registers
which are with in the word length capacity of the machine.
6. A segment register points to the starting address of a memory
segment currently being used. For ex. The code segment register
points to the starting address of the code segment, the data segment
register points to the starting address of the code segment and so on.
7. The value in CS identifies the starting address of 64 KB memory. The
starting address is also known as base address or segment base.
8. The BIU always inserts zeros for the lower 4 bits in the contents of
segment register to generate 20 bit base address. Ex. If the code segment
register contains 348AH, then code segment will start at address
348A0H.
Starting Address Base Registers
of Segments
20000 2000 CS
CS
40000 4000 DS
DS
60000 6000 SS
SS
80000 8000 ES
ES
Memory Segments
Memory Segmentation and Segment Registers
Address
FFFFFH
Extra Segment 64 K
ES
Stack Segment 64 K
SS 1 Mbyte
Physical
Data Segment 64 K Memory
DS
Code Segment 64 K
CS
00000H
Functions of Segment Registers :
1. The CS register holds the upper 16 bits of the starting address of the
segment from which the BIU is currently fetching the instruction
byte.
2. The SS register is used for the upper 16 bits of the starting address for
the program stack (all stack related instruction will operate on stack)
3. ES and DS register are used to hold the upper 16 bits of the starting
address of the two memory segments which are used for data.
Rule for Memory Segmentation :
CS 3 4 8 A 0
Implied zero
(nibble) 4 zero bits
IP + 4 2 1 4
Physical Address 3 8 A B 4
Note: Similar way the 20 bit physical address is generated in the other segments.
Pointers and index register
1. All segment registers are 16 bit. But it is necessary to put 20 bit
address (physical address) on the address bus. To get 20 bit physical
address one or more register is associated with each segment register
the way IP is associated with CS
2. These additional registers belong to the pointer and index group. The
pointer and index group consists of instruction pointer (IP), stack
pointer (SP), base pointer (BP), source index (SI) and destination index
(DI) registers.
Stack Pointer (SP): The stack pointer (SP) register contains the 16-bit
offset from the start of the segment to the top of stack. For stack
operation, physical address is produced by adding the contents of stack
pointer register to the segment base address in SS. If the contents of SP
are 9F20H and SS are 4000H then the physical address is calculated as
follows.
SS = 4000H after shifting four bits left SS = 40000H
Now SS 40000H
+ SP 9F20H
Registers
- Registers are in the CPU and are referred to by specific names
- Data registers
i) Hold data for an operation to be performed
ii) There are 4 data registers (AX, BX, CX, DX)
- Address registers
i) Hold the address of an instruction or data element
ii) Segment registers (CS, DS, ES, SS)
iii) Pointer registers (SP, BP, IP)
iv) Index registers (SI, DI)
- Status register
i) Keeps the current status of the processor
ii) On an IBM PC the status register is called the FLAGS register
FLAG REGISTER
Flag x x x x O D I T S Z x A x P x C
Bit no. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
CF (carry): This flag is set if there is a carry out of the MSB. (Contains
carry from left most bit following arithmetic, also contains last bit from a
shift or rotate operation). The carry flag also serves as a borrow flag for
subtraction. It is set when borrow is needed.
PF (parity): Indicates the number of 1 bits that result from an operation.
It is set for even ones; otherwise zero.
AF (auxiliary carry): Contains carry out of bit 3 into bit 4 for specialized
arithmetic. i.e. set to 1, if there is a overflow out of bit 3 i.e., carry from
lower nibble to higher nibble (D3 to D4). This flag is used for BCD
operations.
ZF (zero): The zero flag sets if the result of operation in ALU is zero and
flag resets if the result is nonzero. The zero flag is also set if a certain
register content becomes zero following an increment or decrement
operation of that register.
SF (sign): After the execution of arithmetic or logical operation, if the
MSB of the result is 1, the sign bit is set. i.e., the sign bit 1 indicates the
TF (trap): Permits operation of the processor in single step mode. i.e.,
to debug a program , run the program one instruction at a time and see the
contents of used register and memory variables after execution of every
instruction. This process is called ‘single stepping’ through a program.
Trap flag is used for single stepping through a program.
Flag Status: SF = 0, ZF = 0, PF = 1, CF = 0, AF = 1, OF = 0
THANK YOU