Professional Documents
Culture Documents
ARCHITECTURE AND
CONTROL UNIT
PII Lecture 6: Processor:
Datapath and Control
Datapath:
Single-bus Organization
Multiple-bus Organization
MIPS: Multicycle Datapath and Control
Stages of Instructions
Datapath Walkthroughs
Processor and Logic Design
Bus
Control
Cache Input
Datapath
Output
Registers
Next
Instruction
Riin
Yin
X
X
Ri
Y
Constant 4
X
A B
ALU
Zin X
Z
X
Zout
R3 [R1] + [R2]: A B
ALU
1. R1out, Yin
2. R2out, SelectY, Zin X
Add, Zin
3. Zout, R3in Z
X
Zout
Add
ALU Sub A B
control : ALU
lines Carry-in
XOR
X X
MDR
X X
MDRout MDRou
E t
CS1104-P2-6 Processor: Datapath and Control 15
Reading a Word from Memory (2)
Move (R1), R2 /* R2 [[R1]]
Sequence of control steps:
1. R1out, MARin, Read
2. MDRinE, WMFC
3. MDRout, R2in
WMFC: Wait for arrival of MFC (Memory-Function-
Completed) signal.
MFC: To accommodate variability in response time,
the processor waits until it receives an indication that
the Read/Write operation has been completed. The
addressed device sets MFC to 1 to indicate this.
Incrementer
Instruction
PC decoder
Register IR
file
Constant 4
MDR
MUX
A
ALU
R
MAR
Address
line
Memory bus
data lines
CS1104-P2-6 Processor: Datapath and Control 20
Multiple-Bus Organization (3)
For the ALU, R=A (or R=B) means that its A (or B)
input is passed unmodified to bus C.
Add R4, R5, R6 /* R6 [R4] + [R5]
Adds the contents of R4 and R5 to R6.
Sequence of control steps:
1. PCout, R=B, MARin, Read, IncPC
2. WMFC
3. MDRoutB, R=B, IRin
4. R4outA, R5outB, SelectA, Add, R6in, End
...
External
: inputs
Decoder/
IR : encoder
:
Condition
: codes
...
Control signals
Example of a horizontal 1.
2.
PCout, MARin, Read, Select4, Add, Zin
Zout, PCin, Yin, WMFC
organization scheme: 3. MDRout, IRin
4. R3out, MARin, Read
5. R1out, Yin, WMFC
6. MDRout, SelectY, Add, Zin
7. Zout, R1in, End
instruction
MDRout
WMFC
Select
MARin
Read
PCout
R1out
R3out
Micro-
PCin
.. ..
R1in
Add
End
Zout
IRjn
Yin
Zin
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 Select=0: SelectY
7 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 Select=1: Select4
CS1104-P2-6 Processor: Datapath and Control 25
Memory bus
data lines
MIPS: Multicycle Datapath and Control
registers
rd
instruction
memory
PC
memory
rs
Data
rt ALU
+4 imm
reg[1]
registers
3
instruction
reg[1]+reg[2]
memory
PC
memory
1
Data
reg[2] ALU
2
imm
+4
add r3, r1, r2
reg[1]
registers
x
instruction
reg[1]-17
memory
PC
memory
1
Data
ALU
3
imm 17
+4
slti r3, r1, 17
reg[1]
registers
x
instruction
reg[1]+20
memory
PC
MEM[r1+20]<-r3 memory
1
Data
ALU
3 reg[3]
imm 20
+4
sw r3, 20(r1)
registers
x
instruction
reg[1]+40
memory
PC
memory
1
Data
ALU
3
r3<-MEM[r1+40]
imm 40
+4
lw r3, 40(r1)
registers
rd
instruction
memory
PC
memory
rs
Data
ALU
rt
+4 imm
opcode, funct
Controller
CS1104-P2-6 Processor: Datapath and Control 45
Where is Logic Design Used?
Combinational circuits for
ALU and other parts of the
datapath.
Different control signals are ALU
50