Академический Документы
Профессиональный Документы
Культура Документы
BEC30303
Computer Architecture and Organization
Chapter 3:
Processing Unit
Mohamad Hairol Jabbar
Department of Computer Engineering
http://fkee.uthm.edu.my/mhjabbar
REVIEW CHAPTER 2
Instruction architecture definition ISA, elements in
an instruction, assembly vs RTN, CPU storage
organizations
Stack organization operations, RPN
Instruction formats 3-address, 2-address, 1address, 0-address, RISC address
Condition codes/status flags
Addressing modes definition, types of addressing
mode
Encoding of machine instructions definition,
instruction length: fixed vs variable
Computer Architecture and Organization (BEC30303) | Chapter 3: Processing Unit
CHAPTER 3
OUTLINE
Instruction execution
Instruction fetch and execution steps
Control signals
INSTRUCTION EXECUTION
HW COMPONENTS IN CPU
Processor
Memory
Devices
Control
Cache
Input
Datapath
Output
Registers
FUNDAMENTAL CONCEPTS
Processor (CPU):
the active part of the computer, which does all the
work (data manipulation and decision-making).
Datapath:
portion of the processor which contains hardware
necessary to perform all operations required by
the computer.
Control:
portion of the processor (also in hardware) which
tells the datapath what needs to be done (the
brain).
Computer Architecture and Organization (BEC30303) | Chapter 3: Processing Unit
INSTRUCTION EXECUTION
Instruction execution
Instruction
Fetch
Instruction
Decode
Operand
Fetch
Execute
Result
Store
Next
Instruction
10
Internal
processor bus
PC
Address line
Memory
bus
Data line
Instruction
decoder and
control logic
MAR
MDR
IR
Constant 4
Control signals
...
Y
R0
Select
ALU
control
lines
MUX
Add
Sub
:
:
R(n1)
ALU
Carry-in
XOR
TEMP
Z
11
Internal
processor bus
Control signals
...
PC
Address line
Memory
bus
Data line
Instruction
decoder and
control logic
MAR
MDR
IR
Constant 4
Y
R0
Select
ALU
control
lines
MUX
Add
Sub
:
:
R(n1)
ALU
Carry-in
XOR
TEMP
Z
12
Control signals
...
PC
Address line
Memory
bus
Data line
Instruction
decoder and
control logic
MAR
MDR
IR
Constant 4
Y
R0
Select
ALU
control
lines
MUX
Add
Sub
:
:
R(n1)
ALU
Carry-in
XOR
TEMP
Z
13
14
REGISTER TRANSFER
Register to register transfer:
For each register Ri, two
control signals:
Riin used to load the data
Example: To transfer
contents of R1 to R4:
Set R1out to 1. This places
Yin
X
Ri
Y
Constant 4
X
Riout
MUX
A
ALU
Zin
Z
X
Zout
15
ARITHMETIC/LOGIC OPERATION
Internal processor bus
ALU: Performs
Riin
Yin
X
X
Constant 4
Ri
Y
X
Riout
MUX
A
ALU
Zin
Z
X
Zout
Computer Architecture and Organization (BEC30303) | Chapter 3: Processing Unit
16
MDRinE
MDRin
MDR
MDRoutE
MDRout
17
Internal
processor bus
MDRin
MDRin
Address line
Control
signals
...
PC
Memory
bus
Data line
Instruction
decoder
and control
logic
MAR
MDR
IR
MDR
X
Constant
4
MDRout
MDRou
t
ALU
control
lines
R0
MU
X
Select
E
Add
Sub
:
:
R(n1)
ALU
Carry-in
XOR
TEMP
Z
18
Internal
processor bus
MDRinE
PC
MDRin
Address line
Memory
bus
MAR
IR
MDR
Constant
4
R0
X
MU
X
Select
MDRoutE
Instruction
decoder
and control
logic
MDR
Data line
MDRout
ALU
control
lines
Add
Sub
:
:
R(n1)
ALU
Carry-in
XOR
TEMP
Z
19
1. MAR [R1]
2. Start a Read operation on the
memory bus
3. Wait for the MFC response
from the memory MFC
Memory-Function-Completed
Signal
4. Load MDR from the memory
bus
5. R2 [MDR]
Instruction
decoder
and control
logic
MAR
MDR
IR
Y
Constant
4
MU
X
Select
ALU
control
lines
R0
Add
Sub
:
:
ALU
Carryin
XOR
R(n1)
TEMP
(Memory-Function-Completed) signal.
20
PC
Address line
Memory
bus
Data line
Instruction
decoder
and control
logic
MAR
MDR
IR
Y
Constant
4
MU
X
Select
ALU
control
lines
R0
Add
Sub
:
:
R(n1)
ALU
Carryin
XOR
TEMP
21
ARITHMETIC INSTRUCTIONS
Add R1, (R2) /* R1 <- R1 + [R2] *
Adds the contents of a memory location
pointed to by R2 to register R1.
Sequence of actions:
Fetch the instruction
Fetch the operand from memory location pointed
by R2
Perform the addition
Store the result in R1
22
XOR
AL
U
Instruction
decoder
and
control
logic
IR
RO
:
:
R(n1)
Carryin
24
TEMP
Step 2 :
Control
signals
PC
Address line
Memory
bus
Data line
...
Instruction
decoder
and control
logic
MAR
MDR
IR
Y
Constant 4
RO
Step 3 :
MUX
Select
MDRout, IRin
lines
Add
Sub
:
:
R(n1)
ALU
Carry-in
XOR
TEMP
Z
25
Instruction
decoder
and control
logic
MAR
bus
Data line
MDR
IR
Step 5 :
Address line
Constant
4
RO
MUX
Add
Sub
:
:R1
R(n1)
R2
ALU
Carry-in
XOR
TEMP
Z
26
Address line
Memory
bus
Step 5 :
Instruction
decoder
and control
logic
MAR
Data line
MDR
IR
lines
Y
Constant
4
RO
MUX
Add
Sub
:
:R1
R(n1)
R2
ALU
Carry-in
XOR
TEMP
Z
27
Control
signals
PC
...
Address line
Instruction
decoder
and control
logic
MAR
Data line
MDR
IR
Y
Constant
4
RO
MUX
Select
ALU
control
lines
Add
Sub
:
:R1
R(n1)
ALU
Carry-in
XOR
TEMP
Zin
Z
Zout
28
Bus C
Bus A Bus B
Bus C
Incrementer
Instruction
decoder
PC
IR
Register
file
MUX
Constant 4
MDR
A
ALU
R
MAR
Address
line
Memory bus
data lines
Computer Architecture and Organization (BEC30303) | Chapter 3: Processing Unit
29
30
31
32
33
34
35
CONTROL SIGNALS
37
38
HARDWIRED CONTROL
An instruction is executed in a sequence of
steps, where each step requires one clock cycle.
A counter as well as logic gates may be used to
keep track of the progress of execution.
Several actions are performed in each step,
depending on the instruction being executed.
In some cases, such as for branch instructions,
the actions taken depend on tests applied to the
result of a computation or a comparison
operation.
External signals, such as interrupt requests, may
also influence the actions to be performed.
Computer Architecture and Organization (BEC30303) | Chapter 3: Processing Unit
39
Source: kuiraq.com/staff/salamhm
Computer Architecture and Organization (BEC30303) | Chapter 3: Processing Unit
40
Disadvantages:
Complex to be designed
Cannot be modified for changes
41
MICROPROGRAMMED CONTROL
Microinstructions are control processor within
the main processor i.e fetched and executed
much like machine instructions.
Function:
to direct the actions of the main processors
hardware components, by indicating which
control signals need to be active during each
execution step.
42
43
Disadvantage:
Slow control speed because CPU needs to
process the instructions before executing it
44
FINISH