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