The Processor: Datapath & Control: Simplified Implementation of MIPS With
The Processor: Datapath & Control: Simplified Implementation of MIPS With
Data
Register #
PC Address Instruction Registers ALU Address
Register #
Instruction
memory Data
Register # memory
Data
• Typical execution:
– read contents of some state elements
– send values through some combinational logic
– write results to one or more state elements
State State
element Combinational logic element
1 2
Clock cycle
Data
Register #
PC Address Instruction Registers ALU Address
Register #
Instruction
memory Data
Register # memory
Data
10
A Single Cycle Implementation
Data
Register #
PC Address Instruction Registers ALU Address
Register #
Instruction
memory Data
Register # memory
Data
Data
Register #
PC Address Instruction Registers ALU Address
Register #
Instruction
memory Data
Register # memory
Data
Fetch components
• Program counter - tracks address of instruction
• Instruction memory - memory from which we fetch an
instruction to execute
• Adder - does increment of PC by 4, labeled as “add”
Instruction
address
PC
Instruction Add Sum
Instruction
memory
Fetching Instructions
Register numbers
come from the fixed
fields in the
instruction
18
Elements for Load and Store
Value written
to destination
register (load)
• So, we have:
– 2 register source operands
– a 16-bit offset (PC-relative)
– ALU to do comparison (remember zero check?)
22
More about branches
• Wait a minute….
– We need to compute the target address
– AND
– use the ALU to compare $t1 and $t2
• What do we do???? 23
Branch Elements
25