Proof: JUMPR Instruction Example
Let's prove the following theorem:
if the following are true:
- instruction #0 is
jumpr addr=1 - the PC at time 0 = 0
- value of cell 1 at time 0 = 3
then the PC at time 1 = 3
In this example, a JUMPR instruction causes the computer to jump to the value in memory cell #1.
Instructions
| Memory Cells |
|---|
| Program Counter | Time |
|---|---|
| 0 | 0 |
LW Computer Simulator
Proof:
Given
| 1 | instruction #0 is jumpr addr=1 |
|---|---|
| 2 | the PC at time 0 = 0 |
| 3 | value of cell 1 at time 0 = 3 |
| # | Claim | Reason |
|---|---|---|
| 1 | the PC at time (0 + 1) = value of cell 1 at time 0 | if instruction #0 is jumpr addr=1 and the PC at time 0 = 0, then the PC at time (0 + 1) = value of cell 1 at time 0 |
| 2 | 0 + 1 = 1 | 0 + 1 = 1 |
| 3 | the PC at time (0 + 1) = the PC at time 1 | if 0 + 1 = 1, then the PC at time (0 + 1) = the PC at time 1 |
| 4 | the PC at time 1 = value of cell 1 at time 0 | if the PC at time (0 + 1) = the PC at time 1 and the PC at time (0 + 1) = value of cell 1 at time 0, then the PC at time 1 = value of cell 1 at time 0 |
| 5 | the PC at time 1 = 3 | if the PC at time 1 = value of cell 1 at time 0 and value of cell 1 at time 0 = 3, then the PC at time 1 = 3 |
Comments
Please log in to add comments