CPU16 Datapath and Control
Tom Kelliher, CS 240
May 3, 2006
CPU16 architecture.
- CPU16 datapath.
- CPU16 control.
CPU16 implementation.
(To be modified according to our architecture.)
High-level block diagram:
Control signals:
- RegDst, RegWrite.
- ALUSrcA: Choose between PC and Rs.
- MemRead, MemWrite, MemtoReg.
- IorD: Choose between PC and ALUOut for memory address.
- PCWrite: Load a new value into PC.
- PcWriteCond: Load a new value into PC if zero is active.
- ALUOp.
- ALUSrcB: Choose between Rt/Rd, 4, sign-extended immediate,
sign-extended shifted immediate.
- PCSource: Choose between PC + 4, ALUOut (branch target address), jump
address
- Steps: Fetch, decode, execution/completion.
- Instructions: R-format, memory reference, conditional branch, jump.
Common to all instructions.
- Load IR.
- Increment PC.
Common to all instructions.
- Load A (rs field) and B (rt field) from register file.
- Load ALUOut with branch target.
These are ``optimistic'' optimizations which do no harm, even if
they are not needed/do not make sense for the current instruction.
Instruction classes go their own way.
- R-format:
- Perform ALU operation, loading ALUOut.
- Memory reference:
- Use ALU to compute sum of base & offset, loading ALUOut.
- Conditional branch:
- If zero load PC with computed branch target in ALUOut.
This instruction has completed.
- Jump:
- Load PC with jump address.
This instruction has completed.
Just two instruction classes remaining.
- R-format:
- Load register file (rd field) from ALUOut.
This instruction has completed.
- Memory reference:
- sw: Memory location specified by address in ALUout written with
value stored in B.
This instruction has completed.
- lw: MDR loaded from memory location specified by address in
ALUOut.
- Load register file (rt field) from MDR.
Design the state machine necessary for controlling the datapath.
Thomas P. Kelliher
2006-04-28
Tom Kelliher