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