At the decode stage, we have the instruction to be executed in the CIR register. There are a finite set of instructions for a processor. Each instruction will have a specific binary representation. Let’s say that our processor only acts on 8 bit instructions. The first 4 bits will be the instructions code while the last 4 bits will be the value the instruction is acting on.

Binary code

Instruction

1000

ADD

1100

LOAD

1110

JMP

1111

JMZ

1001

SUB

The instruction in our example was 1000 1010. The first four bits, 1000, corresponds to the instruction ADD. The 4 bits correspond the value we are going to add, 10. When decoded the data part of the instruction are sent to the MAR to work on. Then the instruction will execute by adding 10 to the accumulator and finally the cycle will reset.

At this point the cycle will reset and then start again. This will continue according to the instructions ran. Remember that the start of the cycle the interrupt register is checked. If the interrupt register has a flag set, then a different instruction will be run. That is, the program counter PC will point to a different part of memory.