Proof: Addi Insn 12
Let's prove the following theorem:
if the following are true:
- instruction #6 is
addi dst=2 src=3 imm=0
- the PC at time 12 = 6
- value of cell 3 at time 12 = 2
then value of cell 2 at time 13 = 2
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Proof:
Given
1 | instruction #6 is addi dst=2 src=3 imm=0 |
---|---|
2 | the PC at time 12 = 6 |
3 | value of cell 3 at time 12 = 2 |
# | Claim | Reason |
---|---|---|
1 | value of cell 2 at time (12 + 1) = (value of cell 3 at time 12) + 0 | if instruction #6 is addi dst=2 src=3 imm=0 and the PC at time 12 = 6, then value of cell 2 at time (12 + 1) = (value of cell 3 at time 12) + 0 |
2 | 12 + 1 = 13 | 12 + 1 = 13 |
3 | value of cell 2 at time (12 + 1) = value of cell 2 at time 13 | if 12 + 1 = 13, then value of cell 2 at time (12 + 1) = value of cell 2 at time 13 |
4 | value of cell 2 at time 13 = (value of cell 3 at time 12) + 0 | if value of cell 2 at time (12 + 1) = value of cell 2 at time 13 and value of cell 2 at time (12 + 1) = (value of cell 3 at time 12) + 0, then value of cell 2 at time 13 = (value of cell 3 at time 12) + 0 |
5 | value of cell 2 at time 13 = 2 + 0 | if value of cell 2 at time 13 = (value of cell 3 at time 12) + 0 and value of cell 3 at time 12 = 2, then value of cell 2 at time 13 = 2 + 0 |
6 | 2 + 0 = 2 | 2 + 0 = 2 |
7 | value of cell 2 at time 13 = 2 | if value of cell 2 at time 13 = 2 + 0 and 2 + 0 = 2, then value of cell 2 at time 13 = 2 |
Comments
Please log in to add comments