Proof: Byte 2 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 2 at time 20 = 3
then value of cell 2 at time 21 = 3
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 2 at time 20 = 3 |
| # | Claim | Reason |
|---|---|---|
| 1 | value of cell 2 at time (20 + 1) = value of cell 2 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 2 at time (20 + 1) = value of cell 2 at time 20 |
| 2 | 20 + 1 = 21 | 20 + 1 = 21 |
| 3 | value of cell 2 at time (20 + 1) = value of cell 2 at time 21 | if 20 + 1 = 21, then value of cell 2 at time (20 + 1) = value of cell 2 at time 21 |
| 4 | value of cell 2 at time 21 = value of cell 2 at time 20 | if value of cell 2 at time (20 + 1) = value of cell 2 at time 21 and value of cell 2 at time (20 + 1) = value of cell 2 at time 20, then value of cell 2 at time 21 = value of cell 2 at time 20 |
| 5 | value of cell 2 at time 21 = 3 | if value of cell 2 at time 21 = value of cell 2 at time 20 and value of cell 2 at time 20 = 3, then value of cell 2 at time 21 = 3 |
Comments
Please log in to add comments