Complete Data Path of Processor

Untitled

Execution of the Add Instruction

Encoding: RaRb0100

Untitled

  1. Fetch the instruction from memory:
    1. Read Mem[PC]: activate MemRead
    2. Puts the fetched instruction into the Instruction Register
  2. Decode the instruction: figure out what it is supposed to do
  3. Read Ra and Rb from the Register File
    1. Notice how Ra and Rb are encoded in the instruction
  4. Compute ALUout = Ra + Rb (set up ALUop to add - code 000)
    1. Goes into the new register, ALUout
  5. Write ALUout into Ra (write into the register file
  6. Set Z and N based on ALUout
    1. See NOR gate for Z, bit 7, for N last lecture
  7. Compute PC <- PC + 1 by sending PC to the ALU, and also 1 (see muxes)

Execution of the Subtract Instruction

sub Ra, Rb: RaRb0110

Untitled

Execution of the nand Instruction

nand Ra, Rb: RaRb1000

Untitled

Execution of the ori Instruction

Requires different use of different parts of the datapath: Imm5111

Untitled