Conventional Machine Level Execution Cycle

After the fetch cycle has been completed, an instruction to be executed has been loaded into the control unit and the program counter updated, and the execution cycle begins. Now, most computers store data in the memory but perform arithmetic on the contents of registers. Now, due to this, the computer functions that implement your typical programming language statement (for instance, a=b+c;), must move data from memory into registers, do the arithmetic, and then move the results back into the memory.

The actual sequence of instructions required to solve this simple arithmetic statement (a=b+c) varies from computer to computer. We will use one example that requires three instructions. The first instruction has an opcode that specifies copying data from memory into a register in an operation called load. This instruction must indicate the memory location of the data, which we will call b, referring to second variable in our arithmetic operation.

Now, the next memory location that must be added to the number in the register and the result placed back into the register is specified by the second instruction. This instruction must also indicate the address of its data, c. The final instruction indicates that the results are to be copied from the register back into the memory in an operation called store. As with the other instructions, the address of the desired location, a, must be specified.

The table below shows what these instructions might look like in memory. In the example above, the variable b is located at the 26th decimal position in memory. Or, the address of b is 1A16. The address of c is at 1B16, and a is at 1C16. The example assumes that each instruction is two bytes. The first byte is the opcode and the second byte is an operand. Also, we assume that the instructions have been placed in memory starting at location 10016. All of this is naturally done in binary.

```      memory
101:    |  1A16
103:    |  1B16
104:    |  store data
105:    |  1C16
```

The initial instruction fetch cycle begins with the program pointer set to 10016 and ends with the instruction register holding the load data opcode and the program counter incremented to 10116.During decoding of this instruction the control circuitry determines that a register is to be loaded from memory. The load opcode also specifies that the address of the data is indicated by the operand.

Before it can be copied into a register, the address of the data must be determined. The program counter, which was updated at the end of the fetch cycle, contains the address of the operand. The process of fetching the operand requires that the control unit do the following:

1. Copy the contents of the program counter to the memory address register.
3. Capture the operand in the memory buffer register.
4. Increment the program counter.

Remember that the data now in the MBR (Memory Buffer Register) is not the number to be placed in the register. It is, rather, the address of the number. Using this address, the control unit can finally retrieve the data stored using the following sequence of operations:

5. Send the contents of the memory buffer register back to the memory address register.