Concept: entire instruction executes in one clock cycle
Implication: cycle time must accommodate worst-case path (load/store)
Stages (all in one cycle): Fetch → Decode/Register read → Execute → Memory → Write-back → PC update
2. Datapath Components
Instruction Memory
Address = PC; outputs 32-bit instruction
Register File
Two read ports (rs1, rs2), one write port (rd)
Read data → ALU inputs or branch comparator
Sign-Extend Unit
Expands immediate fields to 32 bits
ALU
Performs arithmetic/logic based on ALU control
Inputs: rs1_data, (rs2_data or imm)
Data Memory
Address = ALU result; read/write controlled by signals
MUXes
ALU src: choose register vs. immediate
MemToReg: choose ALU result vs. memory data for write-back
PC Src: choose next PC (PC+4, branch target, jump target)
PC + 4 Adder
Computes sequential PC
Branch Adder
Computes PC + sign-extended offset
3. Control Signals (from Main & ALU Control)
Signal | Action----------|--------------------------------------------RegWrite | enables write to Register FileMemRead | enables Data Memory readMemWrite | enables Data Memory writeMemToReg | 0: ALU result → RF, 1: Data Mem → RFALUSrc | 0: second ALU input = rs2, 1: = immediateBranch | 1: perform branch decisionJump | 1: use jump addressALUOp[1:0]| selects ALU operation category
4. Data Flow per Instruction Type
R-Type (add x5,x6,x7)
Fetch instruction
Decode: rs1=x6, rs2=x7 → read register file
ALUSrc=0, ALUOp=10 → ALU computes x6 + x7
MemToReg=0, RegWrite=1 → write ALU result to x5
PC←PC+4
I-Type Load (lw x8,12(x9))
Fetch
Decode: rs1=x9, imm=12
ALUSrc=1, ALUOp=00 → ALU computes address x9+12
MemRead=1 → read Data Mem at address
MemToReg=1, RegWrite=1 → write memory data to x8
PC←PC+4
Store (sw x10,8(x11))
Fetch
Decode: rs1=x11, rs2=x10, imm=8
ALUSrc=1, ALUOp=00 → address x11+8
MemWrite=1 → store x10 to Data Mem
PC←PC+4
Branch (beq x1,x2,offset)
Fetch
Decode: rs1, rs2, offset
ALUSrc=0, ALUOp=01 → ALU computes x1 - x2 and Zero flag
If Branch=1 & Zero=1 → PC←PC+offset
else → PC←PC+4
Jump (jal x3,label)
PCSrc MUX selects jump target, writes PC+4 to x3
5. Timing Considerations
Critical path: instruction memory → control → ALU → Data Mem → register write
Single-cycle cost: cycle time = sum of component delays
Trade-off: slow cycle time vs. simpler control; motivates pipelining (Lecture 8)