Proof: Addi Insn 18
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 18 = 6
- value of cell 3 at time 18 = 3
then value of cell 2 at time 19 = 3
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 18 = 6 |
3 | value of cell 3 at time 18 = 3 |
# | Claim | Reason |
---|---|---|
1 | value of cell 2 at time (18 + 1) = (value of cell 3 at time 18) + 0 | if instruction #6 is addi dst=2 src=3 imm=0 and the PC at time 18 = 6, then value of cell 2 at time (18 + 1) = (value of cell 3 at time 18) + 0 |
2 | 18 + 1 = 19 | 18 + 1 = 19 |
3 | value of cell 2 at time (18 + 1) = value of cell 2 at time 19 | if 18 + 1 = 19, then value of cell 2 at time (18 + 1) = value of cell 2 at time 19 |
4 | value of cell 2 at time 19 = (value of cell 3 at time 18) + 0 | if value of cell 2 at time (18 + 1) = value of cell 2 at time 19 and value of cell 2 at time (18 + 1) = (value of cell 3 at time 18) + 0, then value of cell 2 at time 19 = (value of cell 3 at time 18) + 0 |
5 | value of cell 2 at time 19 = 3 + 0 | if value of cell 2 at time 19 = (value of cell 3 at time 18) + 0 and value of cell 3 at time 18 = 3, then value of cell 2 at time 19 = 3 + 0 |
6 | 3 + 0 = 3 | 3 + 0 = 3 |
7 | value of cell 2 at time 19 = 3 | if value of cell 2 at time 19 = 3 + 0 and 3 + 0 = 3, then value of cell 2 at time 19 = 3 |
Comments
Please log in to add comments