Chapter 5: Processing Unit
Chapter 5: Processing Unit
Chapter objectives
In this chapter you will learn about: Execution of instructions by a processor The functional units of a processor and how they are interconnected Hardware for generating control signals Microprogrammed control
Recap: Organisation
Bus
Processor
Control
Memory
Devices
Input
Cache Datapath
Output Registers
Fundamental Concepts
Instruction execution
cycle: fetch, decode, execute. Fetch: fetch next instruction
(using PC) from memory into IR. Decode: decode the instruction. Execute: execute instruction.
Instruction Fetch Instruction Decode Operand Fetch Execute Result Store Next Instruction
Single-bus Organization
Internal processor bus
Register Y, Z and TEMP are use ONLY by the processor unit for temporary storage during the execution of some instructions. Programmer cannot access these registers The IR and the Instruction decoder are integral parts of the control circuitry in the processing unit.
Y RO
MUX
A B
: : R(n1)
Carry-in
:
XOR
ALU
TEMP Z
Processor: Datapath and Control
Single-bus Organization
The data registers, ALU and the interconnecting bus is referred to as data path Register R0 through R(n1) are the processor register These register include General Purpose Register and Special Purpose Register (stack pointer, index register and pointers) The Register and ALU are used for storing and manipulating data These are 2 option provides for A & B input of the ALU. Select by MUX
Internal processor bus PC Address line Memory bus Data line MAR MDR IR Constant 4 Select ALU control lines
Add Sub
Y RO
MUX
A B
: : R(n1)
Carry-in
:
XOR
ALU
TEMP Z
Processor: Datapath and Control
Single-bus Organization
Internal processor bus PC
The Multiplexer (MUX) is used to select one of the two inputs If select (1) select output of Y If select (0)- select Constant as input A for ALU The constant number is used to increment the contents of program counter
MAR MDR
Y RO
MUX
A B
: : R(n1)
Carry-in
:
XOR
ALU
TEMP Z
Processor: Datapath and Control
Register Transfer
Register to register transfer: For each register Ri, two control signals: Riin used to load the data
on the bus into the register. Riout to place the registers Select contents on the bus.
Constant 4 MUX
A B
X
Riout
ALU
Zin
Z X Zout
Arithmetic/Logic Operation
Internal processor bus
ALU: Performs
arithmetic and logic operations on its A and B inputs. Select To perform R3 [R1] + [R2]:
1. R1out, Yin 2. R2out, SelectY, Add, Zin 3. Zout, R3in
Constant 4 MUX
A
Yin X Y X X Ri
Riin
Riout
B
ALU Zin X
Z X Zout
MDRinE
MDRin
MDR
MDRoutE
MDRout
RO
MUX
A B
: : R(n1)
Carry-in
:
XOR
ALU TEMP Z
RO
MUX
A B
: : R(n1)
Carry-in
:
XOR
ALU TEMP Z
: : R(n1)
Carry-in
:
XOR
ALU TEMP Z
: : R(n1)
Carry-in
:
XOR
ALU TEMP Z