Proof: Jump Help 21
Let's prove the following theorem:
if the following are true:
- instruction #9 is
jump imm=(-6) - the PC at time 21 = 9
then the PC at time 22 = 4
Instructions
| Memory Cells |
|---|
| Program Counter | Time |
|---|---|
| 0 | 0 |
LW Computer Simulator
Proof:
Given
| 1 | instruction #9 is jump imm=(-6) |
|---|---|
| 2 | the PC at time 21 = 9 |
| # | Claim | Reason |
|---|---|---|
| 1 | the PC at time (21 + 1) = (9 + 1) + (-6) | if instruction #9 is jump imm=(-6) and the PC at time 21 = 9, then the PC at time (21 + 1) = (9 + 1) + (-6) |
| 2 | 21 + 1 = 22 | 21 + 1 = 22 |
| 3 | the PC at time (21 + 1) = the PC at time 22 | if 21 + 1 = 22, then the PC at time (21 + 1) = the PC at time 22 |
| 4 | the PC at time 22 = (9 + 1) + (-6) | if the PC at time (21 + 1) = the PC at time 22 and the PC at time (21 + 1) = (9 + 1) + (-6), then the PC at time 22 = (9 + 1) + (-6) |
| 5 | (9 + 1) + (-6) = 4 | (9 + 1) + (-6) = 4 |
| 6 | the PC at time 22 = 4 | if the PC at time 22 = (9 + 1) + (-6) and (9 + 1) + (-6) = 4, then the PC at time 22 = 4 |
Comments
Please log in to add comments