Proof: Byte 1 Stays the Same 20
Let's prove the following theorem:
if the following are true:
- instruction #8 is
beq left=4 right=5 imm=1 - the PC at time 20 = 8
- value of cell 1 at time 20 = 2
then value of cell 1 at time 21 = 2
Instructions
| Memory Cells |
|---|
| Program Counter | Time |
|---|---|
| 0 | 0 |
LW Computer Simulator
Proof:
Given
| 1 | instruction #8 is beq left=4 right=5 imm=1 |
|---|---|
| 2 | the PC at time 20 = 8 |
| 3 | value of cell 1 at time 20 = 2 |
| # | Claim | Reason |
|---|---|---|
| 1 | value of cell 1 at time (20 + 1) = value of cell 1 at time 20 | if instruction #8 is beq left=4 right=5 imm=1 and the PC at time 20 = 8, then value of cell 1 at time (20 + 1) = value of cell 1 at time 20 |
| 2 | 20 + 1 = 21 | 20 + 1 = 21 |
| 3 | value of cell 1 at time (20 + 1) = value of cell 1 at time 21 | if 20 + 1 = 21, then value of cell 1 at time (20 + 1) = value of cell 1 at time 21 |
| 4 | value of cell 1 at time 21 = value of cell 1 at time 20 | if value of cell 1 at time (20 + 1) = value of cell 1 at time 21 and value of cell 1 at time (20 + 1) = value of cell 1 at time 20, then value of cell 1 at time 21 = value of cell 1 at time 20 |
| 5 | value of cell 1 at time 21 = 2 | if value of cell 1 at time 21 = value of cell 1 at time 20 and value of cell 1 at time 20 = 2, then value of cell 1 at time 21 = 2 |
Comments
Please log in to add comments