Proof: Pc 19
Let's prove the following theorem:
if the following are true:
- instruction #7 is
addi dst=4 src=4 imm=1 - the PC at time 19 = 7
then the PC at time 20 = 8
Instructions
| Memory Cells |
|---|
| Program Counter | Time |
|---|---|
| 0 | 0 |
LW Computer Simulator
Proof:
Given
| 1 | instruction #7 is addi dst=4 src=4 imm=1 |
|---|---|
| 2 | the PC at time 19 = 7 |
| # | Claim | Reason |
|---|---|---|
| 1 | the PC at time (19 + 1) = 7 + 1 | if instruction #7 is addi dst=4 src=4 imm=1 and the PC at time 19 = 7, then the PC at time (19 + 1) = 7 + 1 |
| 2 | 19 + 1 = 20 | 19 + 1 = 20 |
| 3 | 7 + 1 = 8 | 7 + 1 = 8 |
| 4 | the PC at time (19 + 1) = the PC at time 20 | if 19 + 1 = 20, then the PC at time (19 + 1) = the PC at time 20 |
| 5 | the PC at time 20 = 8 | if the PC at time (19 + 1) = 7 + 1 and the PC at time (19 + 1) = the PC at time 20 and 7 + 1 = 8, then the PC at time 20 = 8 |
Comments
Please log in to add comments