Professional Documents
Culture Documents
❖ 4-Bit Microprocessors
❖ 8-Bit Microprocessors
❖ 16-Bit Microprocessors
❖ 32-Bit Microprocessors
❖ 64-Bit Microprocessors
1.History:
Million
Pentium II 64-bit 1998
XEON
Pentium III 64-bit 1999
Pentium 64-bit 2000
IV
Dual Core 64-bit 2006
Core 2 2006
Core i7 2008
Core i5 2009
Core i3 2010
Motorola
6800 8-bit 64KB 40 1974
6809 8-bit 64KB 40 1978
68000 16-bit 16MB 64 1979
68020 32-bit 4GB 169 PGA 200000 1984
68030 32-bit 4GB 169 PGA
68040 32-bit 4GB
Zilog
z-80 8-bit 64KB 40
z-800 8-bit 500K
z-8000 16-bit 64KB
It is a 2nd generation microprocessor and is the base for studying and using
all the microprocessor available in the market.
❖ It is an 8 bit microprocessor.
❖ It has 16(A0-A15) bit address lines (AB), hence can address up to 216 =
65536 (64K) memory locations.
❖ Six 8-bit general purpose register arranged in pairs: BC, DE, HL.
System Bus
❖ Address bus
❖ Data Bus
❖ Control Bus
Address bus –It is a group of conducting wires which carries address only.
AB is unidirectional because address flows in one direction, from μp to
memory or from μp to Input/output devices. The range of Address of 8085
μp is from 0000 H to FFFF H. The μp can address 65, 536 different memory
location. The Length of the AB determines the amount of memory can be
handled. Actual amount of memory can be accessed is usually much less
than this theoretical limit due to chipset and motherboard limitations.
Data bus –It is a group of conducting wires which carries Data only. DB is
bidirectional because data flow in both directions, from μp to memory or
Input/Output devices and from memory or Input/Output devices to μp. It is
ranging from 00 H to FF H. In write operation, the μp will put the data on
the DB, where as in read operation, the memory controller will get the data
from specific memory block and put it into the DB.
The width of the DB is directly related to the largest number that the bus
can carry, such as an 8 bit bus can represent 2 to the power of 8 unique
values, this equates to the number 0 to 255. A 16 bit bus can carry 0 to
65535.
Memory read
Memory write
I/O read
I/O Write
Opcode fetch
If one line of control bus may be the read/write line. Low on this line
indicates the read operation, if this is high, it is write operation.
ALE (Address Latch Enable) signal: It goes high during first T state of a
every machine cycle and enables the lower 8-bits of the address, and for the
rest of the T states of the machine cycles the lower 8-bits are data nines.
WR’ – It is a signal to control WRITE operation. When it goes low the data on
the data bus is written into the selected memory or I/O location.
SO, S1 – These are status signals. They distinguish the various types of
operations such as halt, reading, instruction fetching or writing.
Architecture:
Fig:8085 Architecture
The 8085 has 6 general-purpose registers to store 8-bit data; these are
identified as- B, C, D, E, H, and L. They can be combined as register pairs –
BC, DE, and HL, to perform 16-bit operations. These registers are used to
store or copy temporary data during the execution of the program.
Sign Flag: It is 7thbit of the flag register, which is also known as the MSB.
It helps the programmer to know whether the number in the accumulator is
positive or negative. After any operation if the MSB of the result is 1, it
in indicates the number is negative and the sign flag becomes set, i.e.
1. If the MSB is 0, it indicates the number is positive and the sign flag
becomes reseti.e.0. from 00H to 7F, sign flag is 0 from 80H to FF, sign flag is
11- MSB is 1 (negative) 0- MSB is 0 (positive)
Example:
Zero Flag:: 6th bit of the flag register. After any arithmetical or logical
operation if the result is 0 (00)H, the zero flag becomes set i.e. 1,
otherwise it becomes reset i.e. 0.00H zero flag is 1.from 01H to FFH zero flag
is 01- zero result, 0- non-zero result. It helps in determining if two numbers
are equal or not.
Example:
MVI A, 10 //A=10H
SUB A //(A = A – A)
Auxiliary Carry Flag (AC): It is 4th bit of the flag register. This flag is used
in BCD number system (0-9). If after any arithmetic or logical operation B(3)
generates any carry and passes on to B(4) this flag becomes set i.e. 1,
otherwise it becomes reset i.e. 0. Note –Flag register in 8085 which is not
accessible by user
Example:
MOV A, 2B //A=2BH
MOV B ,39 //B=39H
ADD B //(A = A + B)
A= , AC=11
Parity Flag: It is 2nd bit of the flag register. This flag tests for number of 1’s
in the accumulator. If after any arithmetic or logical operation the
result has even parity, if the accumulator holds even number of 1’s, it
is set, P=1. On the other hand if the number of 1’s is odd, then it is reset,
P=0, it is said to be odd parity.
Carry Flag: 0th bit of the flag register. Carry is generated when performing
n bit operations and the result is more than n bits, then this flag
becomes set i.e. 1, otherwise it becomes reset i.e. 0. During subtraction
(A-B), if A>B it becomes reset and if (A<B) it becomes set. Carry flag is also
called borrow flag.1-carry out from MSB bit on addition or borrow into
MSB bit on subtraction 0-no carry out or borrow into MSB bit
Example:
MVI A 30 //A=30H
MVI B 40 //B=40H
SUB B // (A = A – B)
since A<B,CY=1 as 30 – 40 generates a carry/borrow.
MVI A 40 //A=40H
MVI B 30 //B=30H
SUB B //(A = A – B)
since A>B,CY=0 as 40 – 30 generates a carry/borrow.
(c) Memory Registers –There are two 16-bit registers used to hold memory
addresses. The size of these registers is 16 bits because the memory
addresses are 16 bits. They are:-
1. Address Bus & Data Bus: The AB is a group of sixteen lines i.e A0-A15.
The AB is unidirectional, i.e., bits flow in one direction from the
microprocessor unit to the peripheral devices and uses the high order
address bus.
ALE – Address Latch Enable signal. It goes high during first T state of a
machine cycle and enables the lower 8-bits of the address, if its value is
1 otherwise data bus is activated.
IO/M’ S1 S0 Operation
0 0 0 HALT
0 0 1 Memory WRITE
0 1 0 Memory READ
0 1 1 OPCODE FETCH
1 0 1 I/O Read
1 1 0 I/O Read
1 1 1 interrupt ack
WR’( To control WRITE operation): When it goes low the data on the data
bus is written into the selected memory or I/O location.
XI, X2(CLK in) – A crystal is connected at these two pins. The frequency
is internally divided by two, therefore, to operate a system at 3MHZ the
crystal should have frequency of 6MHZ.
CLK OUT – This signal can be used as the system clock for other devices.
Fig:clock setup
The 8085 has five interrupt signals that can be used to interrupt a program
execution.
(i)INTR
(ii)RST 7.5
(iii) RST 6.5
(iv) RST 5.5
(v) TRAP
5. Reset Signals:
RESET IN’ – When the signal on this pin is low(0), the program-counter is
set to zero, the buses are tristated and the microprocessor unit is reset.
RESET OUT – This signal indicates that the MPU is being reset. The
signal can be used to reset other devices.
6. DMA Signals:
HLDA – It is a signal which indicates that the hold request has been
received after the removal of a HOLD request, the HLDA goes low.
Serial transmission in 8085 is implemented by the two signals SID and SOD
Fig:
Instruction set:
❖ Opcode
❖ Operand
1Byte instruction: these instructions requires only one memory location for the
storing in the memory.
Ex: MOV,ADD,SUB,ORA,ANA.INR,DCR
2 Byte instruction: these instructions requires two one memory location for the
storing in the memory.
Ex: All the instructions with ending letter ‘I’, except LXI
3 Byte instruction: these instructions requires only three memory location for the
storing in the memory.
Arithmetic instructions--20
Logical instructions--19
Branching(8)
JUMP conditional/unconditional
CALL conditional/unconditional
RET conditional/unconditional
PCHL
RST-N
• JC • CC • RC • RST 0
• JNC • CNC • RNC • RST 1
• JP • CP • RP • RST 2
• JM • CM • RM • RST 3
• JPE • CPE • RPE • RST 4
• JPO • CPO • RPO • RST 5
• JZ • CZ • RZ • RST 6
• JNZ • CNZ • RNZ • RST 7
Data transfer instructions: They copy the data from a register (i/o or
memory) called source to another register (memory or i/o) called the
destination. Destination and the source registers are any of the 7 general
purpose registers. Memory to memory transfer is not available. Data transfer
instructions will not modify any flag after execution of the instructions.
B= 000
MOV Rd,Rs: 1B-1M/C-4T
C= 001
OP-Code fetch machine cycle D= 010
E= 011
MOV B,C H= 100
L= 101
O1 000 001 M= 110
A= 111
MOV M,Rs: the content of the register is transferred to the memory whose
address is specified in the HL register pair without losing the source
content.
MVI R, 8Bit data: this instruction directly copies the 8 bit data which is
available in the instruction itself in to the specified register.
MVI B,42H
2B-2M/C-7T
Memory read-3T
A=47H=0100 0111
B=51H=0101 0001
------------------------- S Z - AC - P - CY
1 0 X 0 X 0 X 0
A=98H=1001 1000
A=76H=0111 0110
S Z - AC - P - CY
((HL))=A2H=1010 0010 0 0 X 0 X 1 X 1
-----------------------------
ACI 57H
A=26H=0010 0110
S Z - AC - P - CY
57H=0101 0111 0 0 X 0 X 1 X 0
------------------------
A=7E=0111 1110
S Z - AC - P - CY
0 0 X 0 X 0 X 0
CY=1,A=26H
ACI 57H
A=26H=0010 0110 S Z - AC - P - CY
57H=0101 0111 0 0 X 0 X 1 X 0
CY=1= 1
-------------------------
A=7EH=0111 1110
-----------------------
SUB C
A=37H,C=40H,
A=37H=0011 0111------0011 0111 S Z - AC - P - CY
-C=40H=0100 0000-----1100 0000 1 0 X 0 X 0 X 0
------------------------- ----------------
F7H 1111 0111=-9
A=40H
SUI 37H
S Z - AC - P - CY
A=40H=0100 0000-------0100 0000 0 0 X 0 X 1 X 1
Ex: B=25H
INR B S Z - AC - P - CY
0 0 X 0 X 0 X 0
B=25H=0010 0101
+1H=0000 0001
-------------------------
B=26H=0010 0110
Ex: HL=3000H
3000H 71H
71H=0111 0001
+1H=0000 0001
---------------------- S Z - AC - P - CY
0 0 X 0 X 1 X 0
((HL))=A1H=0111 0010
INX Rp: (Increment register pair by 1): The specified register pair content
is incremented by one and is stored in the same place. No flags are modified.
INX Rp 1B-1M/C-6T Opcode fetch -6T
BC=9FFFH
INX B
BC=9FFFFH=1001 1111 1111 1111
+1=0000 0000 0000 0001
-------------------------------------------------
BC=A000H= 1010 0000 0000 0000
Ex: HL=3000H
DCX Rp(Decrement register pair by 1): the specified register pair content
is decremented by one and is stored in the same place. no flags are
modified.
DCX Rp 1B-1M/C-6T Opcode fetch -6T
Ex: DE=1FFFH
DCX D
DE=1FFFFH=0001 1111 1111 1111
-1=1111 1111 1111 1111
-------------------------------------------------
DE=1FFEH=1 0001 1111 1111 1110
DAD Rp: (Add register pair to HL) 16 bit addition: this instruction is used
to add the content of HL with the content of the register pair specified in the
instruction. If the result is greater than 16 bits, then the carry flag is set
and no other flags are modified. This instruction also used to multiply the
HL content by 2.
DAD SP
HL=0000H=0000 0000 0000 0000
+SP=2050H=0010 0000 0101 0000
---------------------------------------------
HL=2050H=0010 0000 0101 0000
Ex: HL=0242
DAD H
HL=0242H=0000 0010 0100 0010
+HL=0242H=0000 0010 0100 0010
---------------------------------------------
=0484H=0000 0100 1000 01000
LOGICAL INSTRUCTIONS
µP is basically a programmable logic chip, hence it can perform all logical
functions through its instructions such as Rotate, AND,OR,EX-OR and NOT.
All the logic operations are performed in the accumulator.
1 AND 3 ANA,R
ANA,M
ANI,8 bit data
2 OR 3 ORA,R
ORA,M
ORI,8bit data
3 EX OR 3 XRA,R
XRA,M
XRI,8bit data
4 Rotate 4 RAR
RRC
RAL
RLC
5 NOT 3 STC
CMC
CMA
6 Compare 3 CMP,R
CMP,M
CPI,8 bit data
Addressing modes:
• To perform any operation, we have to give the corresponding
instructions to the microprocessor.
• In each instruction, programmer has to specify 3 things:
– Operation to be performed.
– Address of source of data.
– Address of destination of result.
The method by which the address of source of data or the address of
destination of result is given in the instruction is called Addressing Modes.
The term addressing mode refers to the way in which the operand of the
instruction is specified.
Types of addressing modes:
i) Immediate Addressing Mode
ii)Register Addressing Mode
iii) Direct Addressing Mode
iv) Register Indirect Addressing Mode
v)Implicit Addressing Mode
i)Immediate Addressing Mode: In immediate addressing mode the source
operand is always data. If the data is 8-bit, then the instruction will be of 2
bytes, if the data is of 16-bit then the instruction will be of 3 bytes.
Examples:
MVI B, 45 //B=45H
LXI H 3050 // HL=3050H
JMP address //jump to the operand address immediately
Examples:
MOV A, M //(A)=((HL))
LDAX B //(A)=(BC)
LXIH 9570 //(HL)=9570
v)Implied/Implicit Addressing Mode: In implied/implicit addressing mode
the operand is hidden and the data to be operated is available in the
instruction itself.
Examples:
CMA //(A)=1’s complement of the accumulator A)
RRC //(rotate accumulator A right by one bit)
RLC //(rotate accumulator A left by one bit)
Interrupt structure:
When the microprocessor receives any interrupt signal from peripheral(s)
which are requesting its services, it stops its current program execution and
program control is transferred to a sub-routine by generating a CALL signal
and after executing sub-routine by generating RET signal again the program
control is transferred to the main program from where it had stopped.
Mainly in the microprocessor based system the interrupts are used for data
transfer between the peripheral and the microprocessor.
Interrupts can be classified into various categories based on different
parameters:
i) Internally generate interrupts & externally generated interrupts
ii) Hardware & Software interrupts
iii) Maskable & non Maskable interrupts
iv) Vector and non vector interrupts
Internally generated interrupts: Interrupts arises due to the use of illegal
instructions or using of erroneous data. These are synchronous signals
Ex: register overflow, divide by zero, using of invalid operation
Externally generated interrupts: If the request is coming through
hardware pins they are called externally generated interrupts. These are
asynchronous signals
Ex: power supply failure, timing device signals
Hardware and Software Interrupts: When microprocessors receive
interrupt signals through pins (hardware) of microprocessor, they are
known as Hardware Interrupts. There are 5 Hardware Interrupts.
They are – INTR, RST 7.5, RST 6.5, RST 5.5, TRAP
Software Interrupts are those which are inserted in between the program
which means these are nemonics of microprocessor. There are 8 software
interrupts.
They are – RST 0, RST 1, RST 2, RST 3, RST 4, RST 5, RST 6, RST 7.
Non-Vectored Interrupts: the interrupts whose vector address is not yet
predefined. The interrupting device gives the address of sub-routine for
these interrupts.
Ex: INTR
Non-Vectored Interrupt address generation:
RIM: This instruction is used to read the status of the hardware interrupts
(RST 7.5, RST 6.5, RST 5.5) by loading into the A register a byte which
defines the condition of the mask bits for the interrupts. It also reads the
condition of SID (Serial Input Data) bit on the microprocessor.
Interrupt priority