Proof: Pc 5
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 5 = 5
then the PC at time 6 = 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 5 = 5 |
# | Claim | Reason |
---|---|---|
1 | the PC at time (5 + 1) = 5 + 1 | if instruction #5 is addi dst=1 src=2 imm=0 and the PC at time 5 = 5, then the PC at time (5 + 1) = 5 + 1 |
2 | 5 + 1 = 6 | 5 + 1 = 6 |
3 | the PC at time (5 + 1) = the PC at time 6 | if 5 + 1 = 6, then the PC at time (5 + 1) = the PC at time 6 |
4 | the PC at time 6 = 6 | if the PC at time (5 + 1) = 5 + 1 and the PC at time (5 + 1) = the PC at time 6 and 5 + 1 = 6, then the PC at time 6 = 6 |
Comments
Please log in to add comments