Proof: BEQ Instruction Example 3
Let's prove the following theorem:
if the following are true:
- instruction #0 is
beq left=left right=right imm=imm
- the PC at time 0 = 0
then value of cell x at time 1 = value of cell x at time 0
The following example shows that when the BEQ instruction is executed, memory values remain unchanged.
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Proof:
Given
1 | instruction #0 is beq left=left right=right imm=imm |
---|---|
2 | the PC at time 0 = 0 |
# | Claim | Reason |
---|---|---|
1 | value of cell x at time (0 + 1) = value of cell x at time 0 | if instruction #0 is beq left=left right=right imm=imm and the PC at time 0 = 0, then value of cell x at time (0 + 1) = value of cell x at time 0 |
2 | 0 + 1 = 1 | 0 + 1 = 1 |
3 | value of cell x at time (0 + 1) = value of cell x at time 1 | if 0 + 1 = 1, then value of cell x at time (0 + 1) = value of cell x at time 1 |
4 | value of cell x at time 1 = value of cell x at time 0 | if value of cell x at time (0 + 1) = value of cell x at time 1 and value of cell x at time (0 + 1) = value of cell x at time 0, then value of cell x at time 1 = value of cell x at time 0 |
Comments
Please log in to add comments