ADDI Instruction Property

The Add-Immediate (ADDI) instruction contains the following information:

  • source (src) - The memory cell number of one operand.
  • immediate (imm) - The second operand (a number).
  • destination (dst) - The memory cell number where the sum will be stored.
When an ADDI instruction is executed, the value in memory cell #src will be added to imm and the sum will be stored in dst. In other words:

if the following are true:
  • instruction #i is addi dst=dst src=src imm=imm
  • the PC at time t = i

then value of cell dst at time (t + 1) = (value of cell src at time t) + imm

Here is an example of a simulator that contains an ADDI instruction:
Instructions
Memory Cells
Program Counter Time
0 0
LW Computer Simulator

PC is 0, so the simulator is going to execute instruction #0. The src is 1 and imm is 3. Thus, the operation is

value at memory cell #1 + 3

= 5 + 3

= 8

dst is 2, which means the result will be stored in memory cell #2.


Comments

Please log in to add comments