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