CO Basic Processing Unit
CO Basic Processing Unit
Ming-Chang YANG
mcyang@[Link]
Registers
Input
Arithmetic and
Memory
Logic Unit
Output
Control
• Multiple-Bus Organization
Register file: a
memory unit for the Control circuitry:
Control
processor’s general- Register Interpret or decode the
purpose registers circuitry fetched instruction
file
(GPRs)
Processor–memory interface
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
Y R0
Constant 4 R1
• External Memory Bus: Select MUX R2
…
Sub
memory path (NOT control ALU
…
Z TEMP
…
Sub
internal processor bus. control ALU
…
…
• Outputs: Data stored in control
Sub
ALU
…
…
Sub
control ALU
…
Rn-1
• Hold the instruction until lines
XOR
Carry
in
the current execution is
Z TEMP
completed.
CSCI2510 Lec10: Basic Processing Unit 10
Processor Internal: Register
• Special Registers: Internal processor
bus Control
Y, Z, & TEMP signals
…
PC
– Transparent to the Address
Instruction
decoder
programmer. lines
MAR &
External control logic
– Used by the processor memory
bus
for temporary storage Data
MDR
IR
during execution of lines
some instructions. Y R0
Constant 4 R1
– Never used for storing R2
Select MUX
data generated by one R3
Add
instruction for later use ALU A B
…
Sub
control ALU
by another instruction.
…
…
Sub
control ALU
…
…
Sub
• The output of register Y orcontrol ALU
…
• Multiple-Bus Organization
Ex.
R2 ← [LOC]
– Transferring the contents of memory LOC into register R2.
…
Sub
control
– Decode instruction in IR ALU
…
…
Sub
control
– Decode instruction in IR ALU
…
…
Sub
control
– Decode instruction in IR ALU
…
Select MUX R2
Ri-out R3
Add
ALU A B
…
Sub
– Ri-out: Allow data to be control ALU
…
Z TEMP
…
Sub
Note: Only state “sets” for short. control ALU
…
lines Rn-1
• Recall: Clock Cycle XOR
Carry
in
Z TEMP
Clock
CSCI2510 Lec10: Basic Processing Unit 21
Student ID: Date:
Class Exercise 10.1 Name:
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
…
Sub
control ALU
…
Lec10:
CSCI2510 Z-out, R3-in Unit
Basic Processing 24
2) Arithmetic or Logic Operation (Cont’d)
• Ex: R3 [R1] + [R2]
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
Control lines
( R / W , MFC, etc.)
*MFC (Memory Function Completed): Indicating the
requested operation has been completed.
CSCI2510 Lec06: Memory Hierarchy 28
Recall: Assembly-Language Notation
• Assembly-Language Notation is used to represent
machine instructions and programs.
– An instruction must specify an operation to be performed
and the operands involved.
– Ex. The instruction that causes the transfer from memory
location LOC to register R2:
Load R2, LOC
Some machines may put
Load: operation; destination last:
LOC: source operand; operation src, dest
R2: destination operand.
– MDR connections to
buses are all controlled MDR-inE MDR-in
External
by switches ( ). memory bus
Internal
processor bus
(data lines)
CSCI2510 Lec10: Basic Processing Unit 30
3) Loading Word from Memory (Cont’d)
• Ex: Mov R2, (R1) Internal processor
bus Control
signals
Sequence of Steps: PC
…
R/W
R1-out, MFC
(Control lines) Instruction
decoder
External &
MAR-in, memory Addr
MAR
control logic
bus lines
Read (start to load a MDR
word from memory) Data
lines
IR
Y R0
MDR-inE, Constant 4 R1
…
Sub
control ALU
…
Rn-1
MDR-out, lines
XOR
Carry
in
R2-in Z TEMP
MAR-in, MARin
completed)
MFC
MDR-out,
MDR out
R2-in (not shown)
CSCI2510 Lec10: Basic Processing Unit 32
Class Exercise 10.3
• What is the sequence Internal processor
bus Control
of steps for the signals
…
PC
following operation? Address
Instruction
decoder
lines
Mov R4, (R3) External
MAR &
control logic
memory
bus
MDR
Data IR
lines
Y R0
Constant 4 R1
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
…
Sub
control ALU
…
Rn-1
MDR-outE, lines
XOR
Carry
in
storing is completed)
CSCI2510 Lec10: Basic Processing Unit 35
Class Exercise 10.4
• What is the sequence Internal processor
bus Control
of steps for the signals
…
PC
following operation? Address
Instruction
decoder
lines
Mov (R3), R4 External
MAR &
control logic
memory
bus
MDR
Data IR
lines
Y R0
Constant 4 R1
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
MDR-inE, R2-out,
WaitMFC MDR-in,
Write
MDR-out, MDR-outE,
R2-in WaitMFC
…
Sub
of steps for the fetch control ALU
…
parallelism? Z TEMP
– Increment PC in parallel Y R0
Constant 4 R1
MDR-inE, WaitMFC Select MUX R2
Z-out, PC-in, Y-in Add
R3
ALU A B
…
– Y-in is for branch control
Sub
ALU
…
lines Rn-1
(discuss later). XOR
Carry
in
– Increment PC in parallel. Y R0
Constant 4 R1
MDR-inE, WaitMFC Select MUX R2
Z-out, PC-in, Y-in Add
R3
ALU A B
…
– Y-in is for branch control
Sub
ALU
…
lines Rn-1
(discuss later). XOR
Carry
in
– Increment PC in parallel. Y R0
Constant 4 R1
MDR-inE, WaitMFC Select MUX R2
Z-out, PC-in, Y-in Add
R3
ALU A B
…
– Y-in is for branch control
Sub
ALU
…
lines Rn-1
(discuss later). XOR
Carry
in
• Multiple-Bus Organization
WaitMFC Add
R3
ALU A B
…
MDR-out, SelectY, Add,
Sub
control ALU
…
MDR-out, IR-in Y R0
DecodeInstruction Constant 4 R1
R2
Offset-field-of-IR-out,
Select MUX
R3
Add
SelectY, Add, Z-in, B-in ALU A B
…
Sub
control ALU
Z-out, PC-in
…
Z TEMP
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
Y R0
Constant 4 R1
Select MUX R2
R3
Add
ALU A B
…
Sub
control ALU
…
Z TEMP
• Multiple-Bus Organization
Incrementer
MUX
A
B
3? Instruction format!).
– Buses A and B allow simultaneous Instruction
decoder
Incrementer
operands to output R
• E.g. R=A or R=B Register
file
Constant 4
MUX
A
unit to compute [PC]+4 (IncPC) ALU R
MDR
MAR
Memory b us Address
data lines lines
CSCI2510 Lec10: Basic Processing Unit 56
Class Exercise 10.7
• Can you tell what does the
Bus A Bus B Bus C
Incrementer
Constant 4
MDR-out, IR-in, R=B
MUX
DecodeInstruction A
ALU R
IR
MDR
MAR
Memory b us Address
data lines lines
CSCI2510 Lec10: Basic Processing Unit 57
Summary
• Processor Internal Structure
• Instruction Execution
– Fetch Phase
– Execute Phase
• Multiple-Bus Organization