Lecture 4.1 - The Processor
Lecture 4.1 - The Processor
The
Processor
Our Single-Core
Computer
Processor Memory
Enable? Input
Read/Write
Control
Cac he Program
Datapath Memory (including
Address cache) organized
PC around blocks,
Bytes which are typically
Write multiple words
Registers Data
Data
Processor organized
around words and bytes
Processor-Memory Interface I/O-Memory Interfaces
The
Processor
• Processor (CPU): The active part of the
computer that does all the work (data
manipulation and decision-making)
Increment
by 4 for
next
64-bit
instruction
regist
er
CPU
Overview
The value written into the PC can come
from one of two adders
Then, the data written into the
register file can come from either the
ALU or the data memory
Second input to the ALU can come from
a register or the immediate field of the
instruction
Add a multiplexor to select from
several inputs based on the setting of
its control lines to send to the output.
Also called data selector
Control lines are set based on
information taken from the instructions
being executed
Building a
Datapath
Datapath
Elementsthat process data and
addresses in the CPU
Registers, ALUs, mux’s, memories, …
Perform arithmetic/logical
operation
Write register result
R-Type
Instruction
Load/Store
Instructions
Read register operands
Compare operands
Use ALU, subtract and check Zero
output
Calculate target
address
Sign-extend
displacement
Shift left 1 place
(halfword
displacement)
Add to PC value
Branch
Instructions
Just
re-
routes
wire
s
Sign-bit
wire
replicate
d
BEQ
Instruction
Contr
ol
Multiplex
ers
Can’t just
join wires
together
Use
multiplexer
s