Professional Documents
Culture Documents
P M SHAH
The microprocessor is a multipurpose, programmable,
clock-driven, register based electronic device that reads
the instructions from a storage device called Memory,
accepts data as input, performs on them arithmetic or
logical operations according to those set of instructions
and then produces results as output.
Programmable:
The microprocessor can perform different sets of
operations on the data it receives depending on the
sequence of instructions supplied in the given program.
By changing the program, the microprocessor
manipulates the data in different ways.
Register Based:
Register is a device that hold the data.
Instructions:
Each microprocessor is designed to execute a specific group of
operations. This group of operations is called an instruction
set. This instruction set defines what microprocessor can and
cannot do.
102045610 MT by Prof. P M SHAH
Storage Device (Memory):
Memory is the location where information is kept while not in use.
Memory is a collection of storage devices.
Usually, each storage device holds one bit. Also, in most kinds of
memory, these storage devices are grouped into groups of 8. These
8 storage locations can only be accessed together. So, one can only
read or write in terms of bytes to and form memory.
Memory is usually measured by the number of bytes it can hold.
It is measured in Kilos, Megas and lately Gigas. A Kilo in computer
language is 210 =1024. So, a KB (KiloByte) is 1024 bytes. Mega is
1024 Kilos and Giga is 1024 Mega.
These are devices that bring data into the system from the
outside world.
Some of newer ones will have complex operations such as square root.
Programming Languages:
Machine level language
Assembly level language
High level language
Output:
The results must be presented on an output device.
This can be the monitor, a paper from the printer, a simple LED
or many other forms.
ROM RAM
Input devices transfer binary information from the outside world to the
microprocessor.
Examples of input devices are: keyboard, mouse, bar code reader, scanner and the
like.
Reg.
ALU
Array Memory Input Output
Data Bus
Control
Unit
Control Bus
S0 S0
4 X 1 MUX 4 X 1 MUX
S1 S1
Adder
A CCUMULATOR S Z AC
F LAGS P CY
B C
D E
H L
S TACK P OINTER
P ROGRAM C OUNTER
A DDRESS 16 8 D ATA
102045610 MT by Prof. P M SHAH
General Purpose Registers:
B, C, D, E, H & L
The Accumulator
Special Register in a ALU and used as one of the operand in Arithmetic &
Logical operations.
The flag
It is a flip-flop. The status of which reflects the result.
The Program Counter (PC)
This is a register that is used to control the sequencing of the execution of
instructions.
This register always holds the address of the next instruction.
Since it holds an address, it must be 16 bits wide.
102045610 MT by Prof. P M SHAH
The Stack pointer
The stack pointer is also a 16-bit register that is used to point
into memory.
The memory this register points to is a special area called the
stack.
The stack is an area of memory used to hold data that will be
retreived soon.
The stack is usually accessed in a Last In First Out (LIFO)
fashion.
Interrupt
The microprocessor’s operations are interrupted and the
microprocessor executes what is called a “service routine”.
This routine “handles” the interrupt, (perform the necessary
operations). Then the microprocessor returns to its previous
operations and continues.
Hold
The 8085 has a pin called HOLD. This pin is used by external devices to
gain control of the busses.
When the HOLD signal is activated by an external device, the 8085
stops executing instructions and stops using the busses.
This would allow external devices to control the information on the
busses. Example DMA.
H IGH -O RDER
A DDRESS B US
SOD
SID
8
TRAP 0 M ULTIPLEXED
RST7.5
RST6.5
RST5.5
8 A DD /D ATA B US
INTR
READY
5
HOLD ALE
RESETIN’ S0
S1
INTA’ IO/M’
HLDA RD’
WR’
CLK (OUT): An output clock pin to drive the clock of the rest of
the system.
102045610 MT by Prof. P M SHAH
SID SOD
102045610
COUT RDY RD WR ALE S0 S1 IO/M MT by Prof.
HLD HLDA RSTPI MRST
SHAH
O A15-A8 AD7-AD0
In addition to the arithmetic & logic circuits, the ALU
includes the accumulator, which is part of every
arithmetic & logic operation.
MOV A , B
Operation: MOV
Operand: A , B
Binary Code:
0011 1000 78 Single byte.
MVI A , 32
Operation: MVI A
Operand: The number 32
Binary Code:
0011 1110 3E 1st byte.
0011 0010 32 2nd byte.
LDA 4000
Opcode: LDA
Operand: 4000
Binary code:
0011 1010 3A 1st byte.
0000 0000 00 2nd byte
0100 0000 40 3rd byte
102045610 MT by Prof. P M SHAH
Operation: Load Accumulator with the content of
memory location pointed by HL register pair.
MOV A , M
Opcode: MOV
Operand: A , M
Binary code:
0111 1110 7E Single byte.
Internal Bus
B C
Instr. D E
ALU H L Memory
Dec. SP
PC
RD
ALE
AD7-AD0 Latch
A7-A0
D7 – D0
AD6 D6 Q6 A6
EN
AD0 D0 Q0 A0
EN
LE OE
ALE
102045610 MT by Prof. P M SHAH
The 8085 generates a single RD signal. However, the signal needs
to be used with both memory and I/O. So, it must be combined
with the IO/M signal to generate different control signals for the
memory and I/O.
Keeping in mind the operation of the IO/M signal we can use the following
ckt to generate the right set of signals:
ALE
RD
IO/M,
S1,S0
WR
102045610 MT by Prof. P M SHAH
From the above discussion, we can define terms that will
become handy later on:
T-State: One subdivision of an operation. A T-state lasts for one clock
period.
An instruction’s execution length is usually measured in a number of T-states.
Machine Cycle: The time required to complete one operation of accessing
memory, I/O, or acknowledging an external request.
This cycle may consist of 3 to 6 T-states.
Instruction Cycle: The time required to complete the execution of an
instruction.
In the 8085, an instruction cycle may consist of 1 to 6 machine cycles.
The 8085 needs to read these two bytes from memory before it
can execute the instruction. Therefore, it will need at least two
machine cycles.
The first machine cycle is the op-code fetch discussed earlier.
The second machine cycle is the Memory Read Cycle.
102045610 MT by Prof. P M SHAH
102045610 MT by Prof. P M SHAH
STA 5065H 2010h 32h
2011h 65h
2012h 50h
Opcode fetch to fetch the opcode (32H) from location 2010H, decode
it and determine that 2 more bytes are needed (4 T-states).
Memory read to read the low order byte of the address (65H) (3 T-
states).
Memory read to read the high order byte of the address (50H) (3 T-
states).
A memory write to write the contents of the accumulator into the
memory location. (3 T-States).