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:
a BEQ instruction that compares left and right with immediate imm
Input:
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:
- the instruction at computer c and index i = a BEQ instruction that compares l and r with immediate imm
- the PC at computer c and time t = i
then byte at ID: c, cell #x at time (t + 1) = byte at ID: c, cell #x at time t
(link)if the following are true:
- the instruction at computer c and index i = a BEQ instruction that compares left and right with immediate imm
- the PC at computer c and time t = i
- byte at ID: c, cell #left at time t = byte at ID: c, cell #right at time t
then the PC at computer c and time (t + 1) = (i + 1) + imm
(link)if the following are true:
- the instruction at computer c and index i = a BEQ instruction that compares left and right with immediate imm
- the PC at computer c and time t = i
- not (byte at ID: c, cell #left at time t = byte at ID: c, cell #right at time t)
then the PC at computer c and time (t + 1) = i + 1
(link)
Comments
Please log in to add comments