MICROPROCESSOR DETAILS
1
Updated April 2011
©Paul R. Godin
prgodin°@ gmail.com
Internal Diagram of a Basic MPU
2
ALU(Arithmetic Logic Unit)
3
ALU
The ALU performs many of the functions that involvearithmetic and logic operations.
Arithmetic:
Add
Subtract
Logic
AND
OR
XOR
Incrementing a number
4
The basic Arithmetic component can only performaddition, yet it can perform all other operations:
Subtraction: Adding the 2’s compliment
Multiply:  Adding or shifting the value multiple times
Divide: Subtracting or shifting the value multiple times
The Arithmetic unit also handles all datamanipulation, such as shift left/right, rotate, and the2’s compliment operations.
All ALU results are stored in a register
Arithmetic
5
Registers
6
Registers
7
Registers
Data registers are locations where data is storedtemporarily within the microprocessor.
There are a larger number of registers in MPUs, eachwith a specific function.
The following slides address the more importantregisters.
8
Program Counter Register
The most important of the registers, the programcounter is often referred to as the PC.
The Program Counter controls the sequence in whichinstructions are performed.
The count indicates the memory location from whichinformation is to be retrieved.
9
Accumulator Register
This is one of the most used registers.  Often referredto as the A or Acc register.
It has two main functions:
Hold one of the operands before an arithmetic or alogic operation.
Stores the results after the operation.
10
Temporary Register
The temporary register is used to transfer data to theALU.
It usually contains the second value required forarithmetic operations.
It is often called the Data Register.
11
General Purpose Registers
The general purpose registers are used to store variousbinary values and can be accessed quickly.  In ourexample the data is 8-bit but addresses are 16-bit. Tworegisters can be combined to store a 16-bit (address)value.
These registers are controllable with programminginstructions.
12
Stack Register
The stack register is used to temporarily store anaddress. Special register used for sub-routines andwhen processing interrupts.
Different microprocessors use the stack registers indifferent manners.
Sometimes referred to as the Data Pointer.
13
FLAG Register
The FLAG register is used to keep track of specificresults of arithmetic operations.
This includes:
the sign of a result (S)
whether an overflow occurred (CY)
whether the result was zero (Z)
the parity of the result (P)
the auxiliary carry status (AC)
Flags are covered in greater detail in another course.
14
Instruction Register
This register stores and provides instructions to theinstruction decoder.
The instruction decoder examines the code anddetermines which operation needs to be performed.
15
Index Register
Also known as the incrementer/decrementer register,used for indexed addressing mode.  It modifies theOperand address.
16
Control
17
Control
The control section of the MPU is responsible for:
Timing of all components (within and outside themicroprocessor)
Clock input
Input and Output traffic flow
External inputs (for example, reset)
Outputs (for example, status)
The control section ensures the proper traffic flow on allbuses (not all control lines are shown on diagram).
18
Reset In operation
The RESET is an externally applied control signalthat stops all operation of the microprocessor, andforces the program counter to return to the start(often all zero’s).
This causes the program execution to restart at thefirst memory location.
19
ALE
The Address Latch Enable is a control signal usedwith MPUs that have multiplexed address outputs.
It indicates the moment when the lower address iscontained on the multiplexed address bus (asopposed to the data).
An ALE pulse is generated at the beginning of everymachine cycle.  The negative edge latches theaddress in our example.
20
Interrupt
The microprocessor can be interrupted from its normaloperations to execute instructions from another memorylocation.
There are several interrupt inputs, with each having apriority setting and a restart address.
The table on the following page an example of thepriority of the interrupts and restarts.
21
Interrupt Priority Example
Interrupt Table for the 8085 Microprocessor
22
Interrupt (INTR)
Interrupts allows the microprocessor to run a sub-routine, or a different set of instruction.
The PC value is pushed to the Stack register
When the sub-routine is done, the program continuesfrom where it left off (from the PC).
23
TRAP
The TRAP command is the highest level interrupt.
TRAP causes the CPU to execute the commandlocated at a specific memory location.
Typically, TRAP is used for urgent request.  Forinstance, a shut-down routine.
24
END of Part 2
©Paul R. Godin
prgodin°@ gmail.com