After instruction_2 is executed, the memory has the following bit values.
latch bit address values 0000 1100 <-----| address of instruction 0001 0000 <--| | value of a 0010 0001 | | not 0 = 1 0011 0000 ---| | not 1 = 0 instruction_1 0100 0001 | from address 0101 1000 | to address 0110 0001 | 'to' bits to change 0111 1000 | instr.addr.and rot.amount instruction_2 1000 0011 | from address 1001 0001 | to address 1010 0001 | 'to' bits to change 1011 1100 ------| instr.addr.and rot.amount instruction_3 1100 0000 from address 1101 0000 to address 1110 0000 'to' bits to change 1111 1100 instr.addr.and rot.amountThe italics show from where data was copied. The underlining shows to where data was copied. The arrows show how data was copied.
Latch 0000 now has value 1100, so that the next instruction to be executed is instruction_3 in latches 1100, 1101, 1110, and 1111.
1. Latch 1100 holds 0000, so data will be copied from latch 0000.
2. Latch 1101 holds 0000, so data is copied to latch 0000.
3. Latch 1110 holds 0000, so no data bits are copied (to latch 0000).
4. Latch 1111 holds 1100, so 1100 is copied to latch 0000.This results in the following bit values in memory.
latch bit address values 0000 1100 <-----| address of instruction 0001 0000 | value of a 0010 0001 | not 0 = 1 0011 0000 | not 1 = 0 instruction_1 0100 0001 | from address 0101 1000 | to address 0110 0001 | 'to' bits to change 0111 1000 | instr.addr.and rot.amount instruction_2 1000 0011 | from address 1001 0001 | to address 1010 0001 | 'to' bits to change 1011 1100 | instr.addr.and rot.amount instruction_3 1100 0000 | from address 1101 0000 | to address 1110 0000 | 'to' bits to change 1111 1100 ------| instr.addr.and rot.amountThe underlined bits have been copied to from the italic bits.
Thus, instruction_3 changes nothing (because latch 0000 already held 1100) and leads to instruction_3 being executed again and again.
Ending a program with an instruction like instruction_3 ensures that nothing else will happen after the desired instructions (instruction_1 and instruction_2) are executed. It's just something for the computer to do until we stop the processor and look in memory for the results.
Page 13
Page 12 . . . Page 1 . . . Page 14