The following example shows that when the value stored in the left cell (cell #1) is equal to the value in the right cell (cell #2), the PC is incremented by imm (2) + 1.
Instructions
Memory Cells |
---|
Program Counter | Time |
---|---|
0 | 0 |
LW Computer Simulator
Quiz (1 point)
Given that:
instruction #0 is
beq left=1 right=2 imm=2
the PC at time 0 = 0
value of cell 1 at time 0 = 2
value of cell 2 at time 0 = 2
Prove that:
the PC at time 1 = 3
The following properties may be helpful:
- 0 + a = a
- (0 + 1) + 2 = 3
if the following are true:
- a = c
- b = c
then a = b
if the following are true:
- instruction #i is
beq left=left right=right imm=imm
- the PC at time t = i
- value of cell left at time t = value of cell right at time t
then the PC at time (t + 1) = (i + 1) + imm
- instruction #i is
if the following are true:
- a = b
- b = c
then a = c
if 0 + 1 = 1, then the PC at time (0 + 1) = the PC at time 1
if the following are true:
- a = b
- a = c
then b = c
Please write your proof in the table below. Each row should contain one claim. The last claim is the statement that you are trying to prove.