Datapath

Executes an instruction in 1 clock cycle

Diagram - Abstract Datapath

5 Stage Instruction Cycle

Diagram - Simple Datapath

Stage 1: Instruction Fetch (IF)

These details are for the LEG V8 processor detailed in Design Paradigms for ISAs#Example processor LEGv8

Diagram

(see Sequential Circuits)

Steps

Stage 2: Instruction Decode (ID)

Diagram

(see multiplexer)

Steps

  • Decodes instruction fields (opcode, reg#, offset, etc)
  • Read registers:
    • Read reg #1 = Rn (ADD, LDR, STR)
    • Read reg #2 =

Stage 3: Execute (EX)

Diagram

(see sign extend)

Info

  • The ALU performs arithmetic operations
    • Addition for ADD
    • Calculates memory address for LDR/STR
    • Sets zero status for CBZ
  • ALU zero = Rt == 0
  • The branch adder calculates the branch target address (PC + (offsett << 2))

Stage 4: Memory (ME)

Diagram

Info

For loads (LDR): assert read, output is on read data
For stores (STR): assert write, input is from Rt (from #Stage 2 Instruction Decode (ID))

Stage 5: Writeback (WB)

Diagram

Info

  • A result is written back to a register
  • Write reg #
  • Write data

Datapath with Control

See Control

Figure