We now examine in detail how the basic pipeline CPU execute instructions with constants as second operand.
Br Cond ------ LD ST BRA Opcode Im Cen <-- Dest -> <- Src1 --> <-- Src2 -> +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
The ID stage also extracts the constant stored inside the instruction "add r1, 2, r3"
|
Incidently, the B register is updated with R2 because the ID stage does not know which operand will be used.... You will see in the next step that there is no harm in fetching R2 into B.
And ofcourse, D register is updated with R3 (but R3 will not be used in this instruction).
|
Also, SMDR register will be updated with the value R3 (but R3 will not be used - see next step).
Clearly, fetching R2 into B register was harmless.