Proof: Byte 5 Stays the Same 8
Let's prove the following theorem:
if the following are true:
- instruction #8 is
beq left=4 right=5 imm=1
- the PC at time 8 = 8
- value of cell 5 at time 8 = 4
then value of cell 5 at time 9 = 4
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Proof:
Given
1 | instruction #8 is beq left=4 right=5 imm=1 |
---|---|
2 | the PC at time 8 = 8 |
3 | value of cell 5 at time 8 = 4 |
# | Claim | Reason |
---|---|---|
1 | value of cell 5 at time (8 + 1) = value of cell 5 at time 8 | if instruction #8 is beq left=4 right=5 imm=1 and the PC at time 8 = 8, then value of cell 5 at time (8 + 1) = value of cell 5 at time 8 |
2 | 8 + 1 = 9 | 8 + 1 = 9 |
3 | value of cell 5 at time (8 + 1) = value of cell 5 at time 9 | if 8 + 1 = 9, then value of cell 5 at time (8 + 1) = value of cell 5 at time 9 |
4 | value of cell 5 at time 9 = value of cell 5 at time 8 | if value of cell 5 at time (8 + 1) = value of cell 5 at time 9 and value of cell 5 at time (8 + 1) = value of cell 5 at time 8, then value of cell 5 at time 9 = value of cell 5 at time 8 |
5 | value of cell 5 at time 9 = 4 | if value of cell 5 at time 9 = value of cell 5 at time 8 and value of cell 5 at time 8 = 4, then value of cell 5 at time 9 = 4 |
Comments
Please log in to add comments