Ch1
Ch1
1
It could execute 769,230 instructions per second
It could access 64KB of memory
It has 246 instructions
Used In: early PC, On-Board Instrument Data Processors
16 Bit Microprocessors
8086
Introduced in 1978
First 16-bit microprocessor
Clock speed is 5 to 10 MHz
Data bus is 16-bit and address bus is 20-bit
It had 29,000 transistors
It could execute 2.5 million instructions per second
Could access 1MB of memory
It had 22,000 instructions
Used In: CPU of Microcomputers
8088
Introduced in 1979
It was also 16-bit microprocessor
It was creates as cheaper version of Intel’s 8086
16-bit processor with an 8-bit data bus
Could execute 2.5 million instructions per second
The chip become the most popular in the computer industry when IBM used it for its
first PC
80286
Introduced in 1982
It was 16-bit microprocessor
Its clock speed was 8 MHz
Data bus is 16-bit and address bus is 24-bit
Could address 16 MB of memory
It has 134,000 transistors
Could execute 4-million instructions per second
32 Bit Microprocessors
80386
Introduced in 1986
First 32-bit microprocessor
Data bus is 32 bit and address bus is 32-bit
It could address 4GB of memory
It has 275,000 transistors
Clock speed varied from 16 MHz to 33 MHz depending upon different versions
Different Versions
80386DX
80386SX
80386SL
80486
2
Introduced in 1989
32-bit microprocessor
Had 1.2 million transistors
Clock speed varied from 16 MHz to 100 MHz depending upon the various versions
It had five different versions
80486DX
80486SX
80486DX2
80486SL
80486DX4
8KB of cache memory was introduced
Pentium
Introduced in 1993
It was also 32-bit microprocessor
Clock speed was 66 MHz
Data bus is 32-bit and address bus is 32-bit
Could address 4GB of memory
Could execute 110 million instructions per second
Cache memory
8KB for Instruction
8KB for data
Upgraded Version: Pentium Pro
Pentium II
Introduced in 1997
32-bit microprocessor
Clock speed was 233 to 450 MHz
MMX technology was supported
L2 cache and processor were on one circuit
Upgraded Version: Pentium II Xenon
Pentium III
Introduced in 1999
It was 32-bit microprocessor
Clock speed varied from 500 MHz to 1.4 GHz
It had 9.5 million transistors
Pentium IV
Introduced in 2000
32-bit microprocessor
Clock speed was from 1.3 GHz to 3.8 GHz
L1 cache was 32 KB and L2 cache was 256 KB
It had 42 million transistors
Intel Dual Core
Introduced in 2006
It is 32-bit or 64 bit Microprocessor
It has 2-cores
3
Both cores have their own internal bus and L1 cache but share the external bus and L2 cache
Support SMT (Simultaneously Multithreading Technology)
64 Bit Microprocessors
Intel Core 2
Introduced in 2006
64-bit microprocessor
Clock speed is from 1.2 GHz to 3GHz
It has 291 million transistors
L1 cache- 64 KB per core
L2 cache- 4 MB
Versions:
Intel Core 2 Duo
Intel Core 2 Quad
Intel Core 2 Extreme
Intel Core i7
Introduced in 2008
64-bit microprocessor
It has 4 physical cores
Clock speed is from 2.66 GHz to 3.33 GHz
It has 781 million transistors
L1 cache- 64 KB per core
L2 cache- 256 KB
L3 cache- 4 MB
Intel Core i5
Introduced in 2009
It is a 64-bit microprocessor
It has 4 physical cores
Its clock speed is from 2.40 GHz to 3.60 GHz
It has 781 million transistors
L1 cache- 64 KB per core
L2 cache- 256 KB
L3 cache- 8 MB
Intel Core i3
Introduced in 2010
64-bit microprocessor
It has 2 physical cores
Clock speed is from 2.93 GHz to 3.33 GHz
It has 781 million transistors
L1 cache- 64 KB per core
L2 cache- 512 KB
L3 cache- 4 MB
4
1.3 Basic Block Diagram of a Digital Computer:
A typical programmable machine can be represented with three components: MPU, Memory and
I/O as shown in Figure.
Figure: Microprocessor
These three components work together or interact with each other to perform a given task; thus
they comprise a system. The machine (system) represented in above figure can be programmed to
turn traffic lights on and off, compute mathematical functions, or keep trace of guidance system.
This system may be simple or sophisticated, depending on its applications. The MPU applications
are classified primarily in two categories: reprogrammable systems and embedded systems.
Reprogrammable system:
- In this microprocessor is used for computing and data processing.
- Capable of handing large data, storage devices such as disks and CD Rom and peripherals devices
such as printers. E.g. microcomputer
Embedded system:
- In this case microprocessor is a part of final product and is not available for reprogramming to end
uses.
- E.g. washing machine, traffic light controller, Automatic testing machine.
The microprocessor unit consists of the following parts:
ALU: This area of microprocessor performs various functions on data. The ALU performs arithmetic
operation like addition subtraction and logical operation like And, OR, X-OR.
Register array: This area of microprocessor consists of various register identified by B, C, D,E, H, L.
These register are used to temporary store the data during the execution of a program.
Control Unit: This area provides the timing and control signal to all the operations in the
microcomputer. It contains the flow of data between the microprocessor memory and peripheral.
5
Generally they include all the essential elements of a computer on a single chip: MPU, R/W
memory, ROM and I/O lines.
Typical examples of the single-chip microcomputers are the Intel 8051, AT89C51, AT89C52 and
Zilog Z8.
Most of the micro controllers have an 8-bit word size, at least 64 bytes of R/W memory, and 1K
byte of ROM
I/O lines varies from 16 to 40
6
MICROCOMPUTER
As the name implies, Microcomputers are small computers. They range from small controllers that
work directly with 4-bit words to larger units that work directly with 32-bit words. Some of the more
powerful Microcomputers have all or most of the features of earlier minicomputers. Examples of
Microcomputers are Intel 8051 controller-a single board computer, IBM PC and Apple Macintosh
computer.
Memory: This consists of a mixture of ram and Rom. It may also have magnetic floppy disk, magnetic
hard disk or optical disk. Its functions are:
1. Store the binary codes for the sequences of instruction and then write a program from that
sequence of instruction for the computer.
2. Store the binary coded data with which the computer is going to work.
I/P port:The i/p section allows the computer to take in data from the outside world or send data to
the outside world. Eg keyboard, video display terminals, printers, modems, etc.
The physical devices used to interface the computer buses to external systems are called ports. Two
ports are available i/p port example keyboard, mouse. O/p port example monitor, printer.
Central processing unit: The cpu control the operation of computer. Cpu fetches binary coded
instruction from memory. Decode the instruction into a series of actions and carries out these
actions in a sequence of steps. It also contains the instruction pointer register which hold the
address of the next instruction or data item to be fetched from memory.
Address bus: The address bus consists of 16, 20, 24 or 32 parallel signal lines. On these lines the CPU
sends out the address of the memory location that is to be written to or form.
Data bus: The data bus consist of 8, 16 or 32 parallel signal lines and are bidirectional that CPU can
read data in from memory and send data out to memory on these lines. ……device in a system will
have ……out connected to the data bus but only one device at a time has its out enable.
Control bus: The control bus consists of 4-10 parallel signal lines. The CPU sends out signal on the
control bus to enable the o/p of the address memory device. Control bus signal are memory read,
write, i/p read, o/p write.
Application of Microprocessor
a) Microcomputers
b) Industrial Control
c) Robotics
d) Traffic Lights
e) Washing Machines
f) Microwave Oven
g) Security Systems
7
1.5 Bus organization
Bus is a common channel through which bits from any sources can be transferred to the destination.
A typical digital computer has many registers and paths must be provided to transfer instructions
from one register to another. The number of wires will be excessive if separate lines are used
between each register and all other registers in the system. A more efficient scheme for transferring
information between registers in a multiple register configuration is a common bus system. A bus
structure consists of a set of common lines, one for each bit of a register, through which binary
information is transferred one at a time. Control signals determine which register is selected by the
bus during each particular register transfer.
8
computer could get its instructions by reading from the memory and program could be set or altered
by setting the values of a portion of memory. This approach is known as 'stored- program concept'
was first adopted by John Von Neumann and such architecture is named as von-Neumann
architecture and shown in figure below.
The main memory is used to stare both data and instructions. The arithmetic and logic unit is
capable of performing arithmetic and logical operation on binary data. The program control unit
interprets the instruction in memory and causes them to be executed. The I/O unit gets operated
from the control unit.
The Von–Neumann architecture is the fundamental basis for the architecture of modern digital
computers. It consisted of 1000 storage locations which can hold words of 40 binary digits and both
instructions as well as data are stored in it. The storage location of control unit and ALU are called
registers and the various models of registers are:
MAR – memory address register – contains the address in memory of the word to be written into or
read from MBR.
MBR – memory buffer register – consists of a word to be stored in or received from memory.
IR – instruction register – contains the 8-bit op-code instruction to be executed.
IBR – instruction buffer register – used to temporarily hold the instruction from a word in memory.
PC - program counter - contains the address of the next instruction to be fetched from memory.
AC & MQ (Accumulator and Multiplier Quotient) - holds the operands and results of ALU after
processing.
9
Chapter 2: Intel 8085 Microprocessor
2.1 Internal Architecture and Description of 8085
Intel 8085 is a 8 bit general purpose microprocessor capable of addressing up to 64kB of memory. It
is a 40 pin ic package fabricated on a single LSI using an NMOS technology. Its clock speed is about 3
MHZ and uses a single 5v DC supply. The internal structure of 8085 is shown in figure. It consists of
three main sections.
1. Register array.
2. Arithmetic and logic unit.
3. Timing and control unit.
Register array: The 8085 has both 8 bit and 16 bit registers. It has 8 addressable 8 bit registers and
three 16 bit registers. These registers can be classified as:
a) General purpose register b) Special purpose register
a. General purpose register: The 8085 has 6 general purpose registers to store 8 bit data during
program execution. B,C, D ,E, H, L are 8 bit registers and can be used singly or 16 bit register pairs BC,
DE, HL. When used in register pairs, the high order byte resides in the 1st register that is B when BC
is as register pair and low order byte in second (i.e, c when BC is used). The register pair HL besides
it’s possible use as to independent registers functions as a data pointer. It can hold memory
addresses that are referred to in a number of instructions which use register indirect addressing.
b. Special purpose register:
Accumulator: It is a 8 bit register used in arithmetic logic load and store operations as well in input
output instructions.
Flag Register: It is 8 bit register in which the bits carry significant information in the form of flags.
S- Sing Flag
10
Z- zero flag
AC- Auxiliary carry flag
D- Parity flag
CY- Carry flag
Temporary register: It is 8 bit register not accessible to the programmer while executing the
instruction. The 8085 places the date into temporary register for a brief period.
Program counter: The program counter acts as a pointer to the next instruction to be executed and
always contains 16 bit address of the memory location of the next instruction.
The program counter is updated by the processor and points to the next instruction after the
processor has fetched the instruction.
Stack pointer: The stack is an area of read write memory in which temporary information is stored in
first in last out basis. The stack pointer holds the address of last byte written on to the stack.
Instruction register and decoder: These are not accessible to the programmer after fetching an
instruction from memory the processor load it in the instruction register. This instruction is decoded
by the decoder and the sequence of events is established for the execution of instruction.
Arithmetic and logic unit: The ALU performs the computing function. It includes the accumulator,
the temporary register, arithmetic and logic circuits and the flag register. The temporary register is
used to store hold data during an arithmetic/ logic operation. The result is stored in the accumulator
and the flags are set or cleared according to the result of operation.
Timing and control unit: This unit synchronizes all the microprocessor operations with the clock. The
clock is symmetrical square wave signal that drives the cpu. The control circuitry and all the
operation are driven by the clock signals.
Interrupt: The 8085 has 5 interrupt signals that can be used to interrupt a program execution. The
various interrupt signals are, INTR, RST 5.5, RST 6.5, RST 7.5, TRAP.
Serial I/p port: The 8085 has two signals to implement the serial transmission SID and SOD. These
two signals are used to transmitting the data serially.
Data and address bus: The 8085 has 8 bit data bus and hence 8 bit of data can be transmitted
parallel from and to a microprocessor. The 8085 has 16 bit address bus as memory addresses are of
16 bit.
- The 8 bit significant bits of the address are transmitted by AD bus. The AD bus transmits the data
and address at different moments. At a particular moment it transfers either data or address.
- The 8 most significant bit of the address are transmitted by address bus A bus.
- First of all the 16 bit data is transmitted by the microprocessor MSB on the A bus and 8 LSB on the
AD bus. Thus the effective 16 bit bus is used for 16 bit address. Then data is transfer via AD bus.
11
8085 Microprocessor unit pin details:
IO/M :
- pin 34, o/p pin
- Distinguishes whether the address is for memory or I/O
- When high the operation is performed between I/O and µP
- When low the operation is performed between memory and µp.
S0 , S1 :
- Pin 29, 33, o/p pin
- These are status signals which indicates the type of operation performed.
S0 S1 Operation
0 0 HALT
0 1 READ
12
1 0 WRITE
1 1 FETCH (bring information From the Memory to µP)
RD:
- Pin 32, o/p pin
- Controls READ operation.
- When it goes low, the selected memory or I/O device is read.
WR :
- Pin 31, o/p pin
- A low indicates a write operation being performed into the selected memory or I/P device.
READY:
- Pin 35, i/p pin
- It is used to sense whether a peripheral is ready to transfer data or not.
- If READY is high, the peripheral is ready.
- It is low, the µp waits till it goes high.
HLDA:
- Pin 38, 0/p pin.
- A signal for HOLD ack.
- It indicates that the HOLD request has been received.
- After the removal of a HOLD request the HLDA goes low.
INTR:
- pin 10 , input pin
- It is an interrupt request signal.
- When it goes high the program counter does not increment its content. The µP suspects its normal
sequence of instruction at hand it goes to the CALL instruction.
INTA:
- pin 11, o/p
- The µP sends as interrupt ack after INTR is received.
13
RESET IN:
- pin 36, input pin.
- When signal on this pin is low, the µP is reset.
RESET OUT:
- pin 3, output pin.
- This signal indicates that µP is being reset.
- This signal can be used to reset other devices.
X1, X2 :
- Pin 1, 2 , i/p pin.
- These are terminals to connect to an external crystal oscillator which drives on internal circuitry of
the µP to produce a suitable clock for the operation of µP.
LK:
- pin 37, output pin.
- It is a clock output for user which can be used for other digital ICs
- Its frequency is same at which processor operates.
SID:
- pin 5, input pin.
- It is a data line for serial i/p.
- The SID signal can be used to i/p the SID pin to the most significant bit of the accumulator.
SOD:
- Pin 4, o/p pin.
- It is a data line for serial o/p.
- It can be used to o/p the most significant bit of the accumulator.
VCC:
- pin 40, input pin.
- +5v dc supply.
vss:
- Pin 20, input pin.
- Ground.
Microprocessor instruction:
Register transfer language (RTL): The internal network organization of a digital computer is defined
by specifying.
- The set of register it contains and their functions.
- The sequence of micro operation performed on the binary information stored in the registers.
- The control that initiates the sequence of micro operation.
The symbolic notation used to describe the micro operation transfer among register is called register
transfer language.
14
2.2 Instruction Set
a) Data Transfer Instructions
b) Arithmetic Instructions
c) Logical Instructions
d) Rotate Instructions
e) Branching Instructions
f) Control Instructions
15
b) Arithmetic Instructions
16
17
c) Logical Instructions
18
d) Rotate Instructions
e) Branching Instructions
19
f) Control Instructions
20
RLC (rotate accumulator A left by one bit)
f) Relative Addressing Mode:
In this mode, the operand is a memory location specified by the contents of the program
counter plus a constant value.
example:
MOVR0,#05H
AGAIN:
MVIA,#55H
ADDA,R0
JMP AGAIN
1. Immediate addressing: In immediate addressing mode, the operand is a constant value that is
part of the instruction. The immediate addressing mode is used for instructions that require a
fixed value, such as loading a constant value into a register.
2. Direct addressing: In direct addressing mode, the operand is a memory address specified
directly in the instruction. The direct addressing mode is used for instructions that access data
stored in memory.
3. Indirect addressing: In indirect addressing mode, the operand is a memory address specified
indirectly by a register or memory location. The indirect addressing mode is used for
instructions that access data stored in memory, where the memory address is not known in
advance.
4. Register addressing: In register addressing mode, the operand is stored in one of the
processor registers. The register addressing mode is used for instructions that manipulate the
contents of the registers.
5. Indexed addressing: In indexed addressing mode, the operand is obtained by adding an offset
value to a base address stored in a register. The indexed addressing mode is used for
instructions that access data stored in memory using a computed address.
6. Relative addressing: In relative addressing mode, the operand is specified as an offset relative
to the current program counter value. The relative addressing mode is used for instructions
that perform conditional branching or looping.
7. Memory-mapped I/O addressing: In memory-mapped I/O addressing mode, the processor
accesses input/output devices using memory addresses instead of specialized I/O instructions.
Memory-mapped I/O addressing mode is used for interfacing with peripherals such as displays,
keyboards, and printers.
1. Versatility: The 8085 microprocessor supports several addressing modes, which allows for a
wide range of memory access and manipulation options.
2. Efficient memory usage: Different addressing modes allow for efficient use of memory,
reducing the memory footprint of programs and making the best use of available memory.
3. Easy to use: The addressing modes are easy to use, making it simple for programmers to write
and execute complex programs.
4. Improved performance: The use of different addressing modes can improve the performance
of programs, as the correct addressing mode can be chosen to match the specific requirements
of the program.
21
2.4 Instruction Cycle, Machine Cycle, t-states
1. Machine Cycle:
A machine cycle is the basic operational cycle of a microprocessor. It consists of a sequence
of operations that the CPU performs to execute an instruction. In the case of the 8085
microprocessor, the machine cycle is composed of three to six T-states (timing states).
2. Instruction Cycle:
The instruction cycle is the sequence of events that takes place when the processor executes
a single instruction. It comprises fetching the instruction, decoding it, executing it, and then
storing the result if necessary. The instruction cycle involves multiple machine cycles
depending on the complexity of the instruction being executed.
3. Timing States (t-states):
T-states refer to the timing states or clock cycles within a machine cycle. Each machine cycle
is broken down into a specific number of t-states. In the case of the 8085 microprocessor, it
typically requires a minimum of three t-states to execute an instruction. The 8085
microprocessor operates at a basic clock frequency, and each instruction execution involves
a certain number of clock cycles or t-states.
The 8085 microprocessor commonly operates at a clock frequency of 3 MHz (3,000,000 cycles per
second). Therefore, the duration of each clock cycle or t-state at this frequency is 13 MHz3 MHz1 or
approximately 0.33 microseconds.
The different machine cycles in the 8085 microprocessor include:
Opcode Fetch Cycle: Involves fetching the opcode (operation code) of the instruction from
memory.
Memory Read Cycle: When data is read from memory.
Memory Write Cycle: When data is written to memory.
I/O Read Cycle: Reading data from an input port.
I/O Write Cycle: Writing data to an output port.
The actual number of t-states required for each of these cycles can vary depending on the specific
instruction being executed and the memory or I/O operations performed.
22
RD (Read) and WR (Write) signals: Indicate whether the microprocessor is
performing a read or write operation.
ALE (Address Latch Enable): It is used to latch the address onto the address bus.
IO/M (Input/Output and Memory): Differentiates between memory and I/O
operations.
MREQ (Memory Request) and IORQ (Input/Output Request): Indicate the type of
request the microprocessor is making (either memory or I/O).
SYNC: It synchronizes internal operations with the clock signal.
5. Status Signals:
S0, S1, S2: Status signals indicating the current machine cycle state.
HLT (Halt): When this signal is activated, the processor halts its operations.
INTA (Interrupt Acknowledge): Acknowledgment signal for interrupt requests.
6. Memory Read and Write Cycles:
Timing diagrams show the sequence of signals during memory read and write cycles,
indicating when the address and data are placed on the bus, when the read or write
operation occurs, and when the bus becomes inactive.
A timing diagram visually represents these signals over time, showing their transitions, active and
inactive states, and their relationships with the clock signal.
Opcode fetch machine cycle
The opcode fetch machine cycle (OFMC) involves the fetching of the opcode of the instruction to be
executed and the decoding process of that opcode. Usually, it consists of four T states. The timing
diagram of a typical OFMC is explained below.
23
Memory read machine cycle
Contents from a memory location are read during the memory read machine cycle (MRMC). This
cycle is also known as the operand fetch machine cycle. But there are cases when MRMC is not used
for operand fetch but for reading data at given memory location. This machine cycle spans over
three T states. Each of these T states is explained here along with a timing diagram. The first three T
states are almost the same as the first three T states of Opcode Fetch Machine Cycle.
24
IO read machine cycle
Contents from an IO device are read during IO read machine cycle (IORMC). This machine cycle
spans three T states and is similar to MRMC except for the IO/M signal. The destination of this read
operation is the accumulator. The Program Counter is not incremented here. IO/M goes high instead
of going low, indicating that the microprocessor is talking to an IO device. Each of these T states are
explained here along with a timing diagram.
25
IO write machine cycle
Contents are written to an IO device during IO write machine cycle (IOWMC). This machine cycle
spans three T states and is similar to MWMC except for the IO/M signal. IO/M goes high instead of
going low, indicating that the microprocessor is talking to an IO device. The contents of the
accumulator are transferred to the data bus and written to an output device in this cycle. The T
states are explained here along with a timing diagram for your reference.
26
8086 MICROPROCESSOR
INTERNAL ARCHITECTURE OF 8086
- The 8086 CPU is divided into two independent functional parts : BIU (Bus Interface
Unit) and EU (Execution Unit)
- Dividing the work between these units speed up the processing.
27
It has some features that the other general purpose registers do not have.
Certain pairs of these general purpose registers can be used together to store 16 bit words.
The acceptable register pairs are AH and AL,BH and BL,CH and CL,DH and DL
The AH-AL pair is referred to as the AX register, the BH-BL pair is referred to as the BX
register, the CH-CL pair is referred to as the CX register, and the DH-DL pair is referred to as
the DX register.
AX = Accumulator Register
BX = Base Register
CX = Count Register
DX = Data Register
2. FLAG REGISTER
A Flag is a flip-flop which indicates some condition produced by the execution of an
instruction or controls certain operations of the EU.
A 16 bit flag register in the EU contains 9 active flags.
Figure below show shows the location of the nine flags in the flag register.
CONTROL FLAG
TF = SINGLE STEP TRAP FLAG
IF = INTERRUPT ENABLE FLAG
DF = STRING DIRECTION FLAG
The six conditional flags in this group are the CF,PF,AF,ZF,SF and OF
The three remaining flags in the Flag Register are used to control certain operations of the
processor.
The six conditional flags are set or reset by the EU on the basis of the result of some
arithmetic or logic operation.
The Control Flags are deliberately set or reset with specific instructions you put in your
program.
The three control flags are the TF, IF and DF.
Trap Flag is used for single stepping through a program.
The Interrupt Flag is used to allow or prohibit the interruption of a program.
28
The Direction Flag is used with string instructions.
3. POINTER REGISTERS
The 16 bit Pointer Registers are IP,SP and BP respectively
SP and BP are located in EU whereas IP is located in BIU
a) STACK POINTER (SP): The 16 bit SP Register provides an offset value, which when associated
with the SS register (SS:SP)
b) BASE POINTER (BP): The 16 bit BP facilitates referencing parameters, which are data and
addresses that a program passes via the stack. The processor combines the addresses in SS
with the offset in BP. BP can also be combined with DI and SI as a base register for special
addressing.
4. INDEX REGISTERS
The 16 bit Index Registers are SI and DI
a) SOURCE INDEX (SI) REGISTER
- The 16 bit Source Index Register is required for some string handling operations
- SI is associated with the DS Register.
29