microprocessor details 1 updated april 2011 paul r. godin prgodin gmail.com

25
MICROPROCESSOR DETAILS 1 Updated April 2011 ©Paul R. Godin prgodin ° @ gmail.com

Upload: arron-turner

Post on 18-Jan-2018

219 views

Category:

Documents


0 download

DESCRIPTION

ALU (Arithmetic Logic Unit) 3

TRANSCRIPT

Page 1: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

MICROPROCESSOR DETAILS

1

Updated April 2011©Paul R. Godin

prgodin°@ gmail.com

Page 2: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Internal Diagram of a Basic MPU

2

Page 3: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

ALU(Arithmetic Logic Unit)

3

Page 4: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

ALU• The ALU performs many of the functions that involve

arithmetic and logic operations. – Arithmetic:

• Add• Subtract

– Logic• AND• OR• XOR• Incrementing a number

4

Page 5: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

• The basic Arithmetic component can only perform addition, 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 data manipulation, such as shift left/right, rotate, and the 2’s compliment operations.

• All ALU results are stored in a register

Arithmetic

5

Page 6: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Registers

6

Page 7: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Registers

7

Page 8: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Registers

• Data registers are locations where data is stored temporarily within the microprocessor.

• There are a larger number of registers in MPUs, each with a specific function.

• The following slides address the more important registers.

8

Page 9: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Program Counter Register

• The most important of the registers, the program counter is often referred to as the PC.

• The Program Counter controls the sequence in which instructions are performed.

• The count indicates the memory location from which information is to be retrieved.

9

Page 10: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Accumulator Register

• This is one of the most used registers. Often referred to as the A or Acc register.

• It has two main functions:– Hold one of the operands before an arithmetic or a

logic operation.– Stores the results after the operation.

10

Page 11: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Temporary Register

• The temporary register is used to transfer data to the ALU.

• It usually contains the second value required for arithmetic operations.

• It is often called the Data Register.

11

Page 12: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

General Purpose Registers• The general purpose registers are used to store various

binary values and can be accessed quickly. In our example the data is 8-bit but addresses are 16-bit. Two registers can be combined to store a 16-bit (address) value.

• These registers are controllable with programming instructions.

12

Page 13: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Stack Register• The stack register is used to temporarily store an

address. Special register used for sub-routines and when processing interrupts.

• Different microprocessors use the stack registers in different manners.

• Sometimes referred to as the Data Pointer.

13

Page 14: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

FLAG Register• The FLAG register is used to keep track of specific

results 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

Page 15: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Instruction Register• This register stores and provides instructions to the

instruction decoder.

• The instruction decoder examines the code and determines which operation needs to be performed.

15

Page 16: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Index Register• Also known as the incrementer/decrementer register,

used for indexed addressing mode. It modifies the Operand address.

16

Page 17: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Control

17

Page 18: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Control• The control section of the MPU is responsible for:

– Timing of all components (within and outside the microprocessor)

– 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 all buses (not all control lines are shown on diagram).

18

Page 19: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Reset In operation• The RESET is an externally applied control signal

that stops all operation of the microprocessor, and forces the program counter to return to the start (often all zero’s).

• This causes the program execution to restart at the first memory location.

19

Page 20: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

ALE• The Address Latch Enable is a control signal used

with MPUs that have multiplexed address outputs.

• It indicates the moment when the lower address is contained on the multiplexed address bus (as opposed to the data).

• An ALE pulse is generated at the beginning of every machine cycle. The negative edge latches the address in our example.

20

Page 21: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Interrupt• The microprocessor can be interrupted from its normal

operations to execute instructions from another memory location.

• There are several interrupt inputs, with each having a priority setting and a restart address.

• The table on the following page an example of the priority of the interrupts and restarts.

21

Page 22: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

Interrupt Priority Example

Interrupt Table for the 8085 Microprocessor 22

Page 23: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

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 continues from where it left off (from the PC).

23

Page 24: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

TRAP• The TRAP command is the highest level interrupt.

• TRAP causes the CPU to execute the command located at a specific memory location.

• Typically, TRAP is used for urgent request. For instance, a shut-down routine.

24

Page 25: MICROPROCESSOR DETAILS 1 Updated April 2011 Paul R. Godin prgodin gmail.com

END of Part 2

©Paul R. Godinprgodin°@ gmail.com