The program below shows the result of running the program above. To and from where data has been copied is underlined and in italics. The answer is 000110000110, or 186, and is stored in the word (16 bits) labeled 'C.' The first word (the first 16 data bits) of instr_3 now holds 1001,0111 or 9,7 and the first word of instr_7 now holds 1,1001,1000 or 1,9,8, where the 1 in 1,9,8 is represented by only 1 bit (1).

After Add Two Digits Program Has Run

 label        address            data          comment

start    0000000000000000  0000000010000000  start 0000000000000100
A        0000000000000001  0000000010011001  99 (A)
B        0000000000000010  0000000010000111  87 (B)
C        0000000000000011  0000000110000110  answer (C)
instr_1  0000000000000100  0000000000000001  from address of A
         0000000000000101  0000000000001100  to instr_3's from addr.
         0000000000000110  0000000011110000  copy to these bits
         0000000000000111  0000000000100100  go to instr_2, rot. 4
instr_2  0000000000001000  0000000000000010  from address of B
         0000000000001001  0000000000001100  to instr_3's from addr.
         0000000000001010  0000000000001111  copy to these bits
         0000000000001011  0000000000110000  go to instr_3, no rot.
instr_3  0000000000001100  0000001010010111  from addtable
         0000000000001101  0000000000000011  to address of C
         0000000000001110  0000000011111111  copy to these bits
         0000000000001111  0000000001000000  go to instr_4, no rot.
instr_4  0000000000010000  0000000000000001  from address of A
         0000000000010001  0000000000011100  to instr_7's from addr.
         0000000000010010  0000000011110000  copy to these bits
         0000000000010011  0000000001010000  go to instr_5, no rot.
instr_5  0000000000010100  0000000000000010  from address of B
         0000000000010101  0000000000011100  to instr_7's from addr.
         0000000000010110  0000000000001111  copy to these bits
         0000000000010111  0000000001101100  to instr_6,rot.4 right
instr_6  0000000000011000  0000000000000011  from addr.of C (carry)
         0000000000011001  0000000000011100  to instr_7's from addr.
         0000000000011010  0000000100000000  copy to this bit
         0000000000011011  0000000001110100  to instr_7,rot.4 left
instr_7  0000000000011100  0000001110011000  from addtable
         0000000000011101  0000000000000011  to address of C
         0000000000011110  0000111111110000  copy to these bits
         0000000000011111  0000000010000100  go to instr_8, rot. 4
instr_8  0000000000100000  0000000000000000  doesn't matter
         0000000000100001  0000000000000000  doesn't matter
         0000000000100010  0000000000000000  copy NO bits
         0000000000100011  0000000010000000  go to this instruction
 
addtable 0000001000000000  0000000000000000  0 + 0 + 0 = 00
         0000001000000001  0000000000000001  0 + 0 + 1 = 01
         0000001000000010  0000000000000010  0 + 0 + 2 = 02
                                 .
                                 .
                                 .
         0000001010010110  0000000000010101  0 + 9 + 6 = 15
         0000001010010111  0000000000010110  0 + 9 + 7 = 16
         0000001010011000  0000000000010111  0 + 9 + 8 = 17
         0000001010011001  0000000000011000  0 + 9 + 9 = 18

         0000001100000000  0000000000000001  1 + 0 + 0 = 01
         0000001100000001  0000000000000010  1 + 0 + 1 = 02
         0000001100000010  0000000000000011  1 + 0 + 2 = 03
                                 .
                                 .
                                 .
         0000001110010110  0000000000010110  1 + 9 + 6 = 16
         0000001110010111  0000000000010111  1 + 9 + 7 = 17
         0000001110011000  0000000000011000  1 + 9 + 8 = 18
         0000001110011001  0000000000011001  1 + 9 + 9 = 19


Page 35

Page 34 . . . Page 1 . . . Page 36