Basic Processing Unit
Basic Processing Unit
22CS302
Select MUX
Processor Organization
Add
A B
ALU Sub R( n - 1)
control ALU
lines
Carry -in
XOR TEMP
MDR HAS
TWO INPUTS
AND TWO
OUTPUTS
Executing an Instruction
Ri
R iout
Y in
Constant 4
Select MUX
A B
ALU
Z in
Z out
MDR
Timing
Read
MR
MDRinE
Data
MFC
MDR out
MAR ← [R1]
Assume MAR
is always available
on the address lines
of the memory bus. Start a Read operation on the memory bus
R2 ← [MDR]
Execution of a Complete
Instruction
• Add (R3), R1
• Fetch the instruction
• Fetch the first operand (the contents of the
memory location pointed to by R3)
• Perform the addition
• Load the result into R1
Architecture Internal processor
bus
Riin
Ri
Riout
Y in
Constant 4
Select MUX
A B
ALU
Z in
Z out
Figure 7.2. Input and output gating for the registers in Figure 7.1.
Execution of a Complete
Memory
bus
Select
ALU
control
lines
Address
lines
Data
lines
Constant 4
Add
Sub
XOR
MUX
A
PC
MAR
MDR
ALU
Z
B
Internal processor
bus
Carry -in
Control signals
Instruction
decoder and
control logic
IR
R0
R( n - 1)
TEMP
Instruction
Figure 7.1. Single-bus organization of the datapath inside a processor.
Step Action
Add (R3), R1
Execution of Branch Instructions
Step Action
Constant 4
Incrementer
PC
Register
f ile
Bus C
MUX
A
ALU R
Instruction
decoder
IR
MDR
MAR
Step Action
Select
ALU
control
lines
Address
lines
Data
lines
Constant 4
Add
Sub
XOR
MUX
A
PC
MAR
MDR
ALU
Z
B
Internal processor
bus
Carry -in
Control signals
Instruction
decoder and
control logic
IR
R0
R( n - 1)
TEMP
External
inputs
Decoder/
IR
encoder
Condition
codes
Control signals
Instruction
decoder
CLK
INS1
INS2
INSm
Run
Detailed Block Description
Control step
counter
Step decoder
T 1 T2
Encoder
Tn
Control signals
Reset
End
External
inputs
Condition
codes
• Zin = T1 + T6 • ADD + T4 • BR + …
Branch Add
T4 T6
T1
Generation of the Zin control signal for the processor in Figure 7.1.
Generating End
Branch<0
Add Branch
N N
T7 T5 T4 T5
Clock
Starting
address
generator
PC
Control
store CW
Overview
Figure 7.16. Basic organization of a microprogrammed control unit.
• Control store
One function
cannot be carried
out by this simple
organization.
Overview
• Control signals are generated by a program similar to machine language
MDRout
WMFC
MAR in
Select
Read
PCout
R1out
R3out
Micro -
End
PCin
R1in
Add
Z out
IRin
Yin
Zin
instruction
programs.
1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0
2 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0
3 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
4 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0
5 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0
6 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1
1
2
Action
Starting and
branch address Condition
IR codes
generator
Clock PC
Control
store CW
36