Program Counter on ADDI

When an ADDI instruction is executed, the program counter (PC) is always incremented by 1. This means that the instructions execute sequentially.

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

then the PC at time (t + 1) = x + 1

For example, if the PC is 0, and instruction #0 is an ADDI instruction, then when the instruction executes, the PC is set to 1:
Instructions
Memory Cells
Program Counter Time
0 0
LW Computer Simulator

In other words:

if the following are true:

  • instruction #0 is addi dst=s src=d imm=imm
  • the PC at time 0 = 0

then the PC at time (0 + 1) = 0 + 1

Also note that:

if the following are true:

  • instruction #1 is addi dst=s src=d imm=imm
  • the PC at time 1 = 1

then the PC at time (1 + 1) = 1 + 1


Comments

Please log in to add comments