Function Branch-On-Equal Instruction

the branch-on-equal (beq) instruction compares the values in left and right. If the values are the same, then the program counter is increased by 1 + imm

Format:

instruction #i is beq left=left right=right imm=imm

Input:

number i -
number left -
number right -
number imm -

Output:

boolean - None

Details:

Instructions
Memory Cells
Program Counter Time
0 0
LW Computer Simulator

Conditional properties that reference this function:

  • if the following are true:
    • instruction #i is beq left=l right=r imm=imm
    • the PC at time t = i

    then value of cell x at time (t + 1) = value of cell x at time t

    (link)
  • if the following are true:
    • instruction #i is beq left=left right=right imm=imm
    • the PC at time t = i
    • value of cell left at time t = value of cell right at time t

    then the PC at time (t + 1) = (i + 1) + imm

    (link)
  • if the following are true:
    • instruction #i is beq left=left right=right imm=imm
    • the PC at time t = i
    • not (value of cell left at time t = value of cell right at time t)

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

    (link)


Comments

Please log in to add comments