W3 Microprocessor Architecture Module 3
W3 Microprocessor Architecture Module 3
W3 Microprocessor Architecture Module 3
Microprocessor Architecture
Module 3: Microprocessor
Architecture
Course Module
[Microprocessor] 2
Microprocessor Architecture
ALU
The Arithmetic and Logic Unit, ALU performs the arithmetic and logical
operations:
o Addition
o Subtraction
o Logical AND
o Logical OR
o Logical EXCLUSIVE OR
o Complement (Logical NOT)
o Increment (add 1)
o Decrement (subtract 1)
o Left shift, Rotate left, Rotate right
o Clear, etc.
Course Module
[Microprocessor] 3
Microprocessor Architecture
Registers
Registers are used for temporary storage and manipulation of data and
instructions by the microprocessor. Data remain in the registers till they are
sent to the I/O devices or memory. Intel 8085 microprocessor has the
following registers:
o One 8-bit accumulator (ACC) i.e. register A
o Six general purpose registers of 8-bit, these are B,C, D, E, H and L
o One 16-bit stack pointer, SP
o One 16-bit Program Counter, PC
o Instruction register
o Temporary register
In addition to the above mentioned registers the 8085 microprocessor
contains a set of five flip-flops which serve as flags (or status flags).
A flag is a flip-flop which indicates some conditions which arises after the
execution of an arithmetic or logical instruction.
a. Accumulator (ACC): The accumulator is an 8-bit
register associated with the ALU. The register 'A' is an
accumulator in the 8085. It is used to hold one of the operands
of an arithmetic and logical operation.
The final result of an arithmetic or logical operation is also
placed in the accumulator.
b. General-Purpose Registers: The 8085 microprocessor
contains six 8-bit general purpose registers. They are: B, D, C,
Course Module
[Microprocessor] 4
Microprocessor Architecture
E, H and L register.
To hold data of 16-bit a combination of two 8-bit registers can
be employed.
The combination of two 8-bit registers is called register pair.
The valid register pairs in the 8085 are: D-E, B-C and H-L. The
H-L pair is used to act as a memory pointer.
c. Program Counter (PC): It is a 16-bit special purpose
register. It is used to hold the address of memory of the next
instruction to be executed. It keeps the track of the instruction
in a program while they are being executed.
The microprocessor increments the content of the next
program counter during the execution of an instruction so that
at the end of the execution of an instruction it points to the
next instruction?s address in the program.
d. Stack Pointer (SP): It is a 16-bit special function
register used as memory pointer. A stack is nothing but a
portion of RAM. In the stack, the contents of only those
registers are saved, which are needed in the later part of the
program.
The stack pointer (SP) controls the addressing of the stack. The
Stack Pointer contains the address of the top element of data
stored in the stack.
e. Instruction Register: The instruction register holds
the opcode (operation code or instruction code) of the
instruction which is being decoded and executed.
f. Temporary Register: It is an 8-bit register associated
with the ALU. It holds data during an arithmetic/logical
operation. It is used by the microprocessor. It is not accessible
to programmer.
g. Flags: The Intel 8085 microprocessor contains five flip-
flops to serve as a status flags. The flip-flops are reset or set
according to the conditions which arise during an arithmetic or
logical operation.
The five status flags of Intel 8085 are:
o Carry Flag (CS)
o Parity Flag (P)
o Auxiliary Carry Flag (AC)
o Zero Flag(Z)
o Sign Flag(S)
Course Module
[Microprocessor] 5
Microprocessor Architecture
Pin Configuration
S1 S0 Operations
0 0 HALT
0 1 WRITE
1 0 READ
1 1 FETCH
Course Module
[Microprocessor] 7
Microprocessor Architecture
TRAP 0024
RST 7.5, RST 6.5 and RST 5.5 are the restart interrupts which cause an
internal restart to be automatically inserted.
The TRAP has the highest priority among interrupts. The order of priority of
interrupts is as follows:
o TRAP (Highest priority)
o RST 7.5
o RST 6.5
o RST 5.5
o INTR (Lowest priority).
Reset Signals
o RESET IN (Input): It resets the program counter (PC) to 0. It also
resets interrupt enable and HLDA flip-flops. The CPU is held in reset
condition till RESET is not applied.
Course Module
[Microprocessor] 8
Microprocessor Architecture
o RESET OUT (Output): RESET OUT indicates that the CPU is being
reset.
Clock Signals
o X1, X2 (Input): X1 and X2 are terminals to be connected to an external
crystal oscillator which drives an internal circuitry of the
microprocessor. It is used to produce a suitable clock for the
operation of microprocessor.
o CLK (Output): CLK is a clock output for user, which can be used for
other digital ICs. Its frequency is same at which processor operates.
Power Supply
Vcc : +5 Vlots supply
Vss : ground reference
8085 Instructions
An instruction of computer is a command given to the computer to perform
a specified operation on given data. Some instructions of Intel 8085
microprocessor are: MOV, MVI, LDA, STA, ADD, SUB, RAL, INR, MVI, etc.
Course Module
[Microprocessor] 9
Microprocessor Architecture
Course Module
[Microprocessor] 10
Microprocessor Architecture
Instruction Cycle
The time required to fetch an instruction and necessary data from memory
and to execute it, is called an instruction cycle. Or the total time required to
execute an instruction is given by:
IC = FC + EC
Where,
IC = Instruction Cycle
FC = Fetch Cycle
EC = Execute Cycle
Course Module
[Microprocessor] 11
Microprocessor Architecture
Course Module
[Microprocessor] 12
Microprocessor Architecture
Timing Diagram
The necessary steps carried out in a machine cycle can be represented
graphically. Such a graphical representation is called timing diagram. The
timing diagram for opcode fetch, memory read, memory write, I/O read and
I/O write will be discussed below:
o Timing Diagram for Opcode Fetch Cycle:
Course Module
[Microprocessor] 13
Microprocessor Architecture
Course Module
[Microprocessor] 14
Microprocessor Architecture
The below table, shows the status of different control signal for different operation:
Course Module
[Microprocessor] 15
Microprocessor Architecture
Course Module