The following program is the same as the previous one (before it was run) except that A now has value 0 instead of value 1 (in the rightmost bit). This means that instr_4 will be executed instead of instr_5 and B will get 1111111111111111 from C rather than 1010101010101010 from D. The instructions are executed in the following order: instr_2, instr_3, instr_4, instr_6. Instr_5 is not executed.

Branching Program with Flag = 0

 label        address            data          comment

start    0000000000000000  0000000000100000  start 0000000000001000
A        0000000000000001  0000000000000000  flag(1 or 0)right bit
B        0000000000000010  0000000000000000  value to change
C        0000000000000011  1111111111111111  all 1's pattern
D        0000000000000100  1010101010101010  1,0 pattern

instr_2  0000000000001000  0000000000000001  from A
         0000000000001001  0000000000001111  to next of instr_3
         0000000000001010  0000000000010000  change this bit
         0000000000001011  0000000000110100  to instr_3, rot.4
instr_3  0000000000001100  0000000000000000  doesn't matter
         0000000000001101  0000000000000000  doesn't matter
         0000000000001110  0000000000000000  copy NO bits
         0000000000001111  0000000001000000  to instr_4 OR instr_5
instr_4  0000000000010000  0000000000000011  from C pattern
         0000000000010001  0000000000000010  to B
         0000000000010010  1111111111111111  copy all bits
         0000000000010011  0000000001100000  to instr_6, no rot.
instr_5  0000000000010100  0000000000000100  from D pattern
         0000000000010101  0000000000000010  to B
         0000000000010110  1111111111111111  copy all bits
         0000000000010111  0000000001100000  to instr_6, no rot.
instr_6  0000000000011000  0000000000000000  doesn't matter
         0000000000011001  0000000000000000  doesn't matter
         0000000000011010  0000000000000000  copy NO bits
         0000000000011011  0000000001100000  go to this instruction

The following program shows the result of executing the preceding program. Notice that B now contains 1111111111111111 from C and address 0000000000001111 still contains 0000000001000000. Instr_4 has been executed instead of instr_5.

After Branching Program with Flag = 0 Has Run

 label        address            data          comment

start    0000000000000000  0000000001100000  start 0000000000001000
A        0000000000000001  0000000000000000  flag(1 or 0)right bit
B        0000000000000010  1111111111111111  value to change
C        0000000000000011  1111111111111111  all 1's pattern
D        0000000000000100  1010110010101010  1,0 pattern

instr_2  0000000000001000  0000000000000001  from A
         0000000000001001  0000000000001111  to next of instr_3
         0000000000001010  0000000000010000  change this bit
         0000000000001011  0000000000110100  to instr_3, rot.4
instr_3  0000000000001100  0000000000000000  doesn't matter
         0000000000001101  0000000000000000  doesn't matter
         0000000000001110  0000000000000000  copy NO bits
         0000000000001111  0000000001000000  to instr_4 OR instr_5
instr_4  0000000000010000  0000000000000011  from C pattern
         0000000000010001  0000000000000010  to B
         0000000000010010  1111111111111111  copy all bits
         0000000000010011  0000000001100000  to instr_6, no rot.
instr_5  0000000000010100  0000000000000100  from D pattern
         0000000000010101  0000000000000010  to B
         0000000000010110  1111111111111111  copy all bits
         0000000000010111  0000000001100000  to instr_6, no rot.
instr_6  0000000000011000  0000000000000000  doesn't matter
         0000000000011001  0000000000000000  doesn't matter
         0000000000011010  0000000000000000  copy NO bits
         0000000000011011  0000000001100000  go to this instruction


Page 37

Page 36 . . . Page 1 . . . Page 38