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