Instruction Decoders and Combinatorial Circuits The instruction decoder is arguably the most important part of a computer's CPU. Although the CPU is often thought of as little more than a glorified calculator in which arithmetic operations are done, such math work is actually the job of the Arithmetic Logic Unit (ALU), a particular section of the CPU. The real job of the CPU is simply to follow instructions. The most fundamental operation of a computer's CPU is to receive opcodes and to execute the instructions that those opcodes correspond to. For a CPU, the first step in carrying out those instructions is to use the instruction decoder. The instruction decoder is the circuit that decodes an opcode. As an example, on the 6502 CPU, the opcode for the CLI (clear interrupt) instruction is 01011000 in binary. The CPU receives this as a set of digital logic signals on the data bus. How does it go from getting these signals to executing the procedure for the CLI instruction? Answer: The instruction decoder receives the opcode and uses it to activate the correct instruction procedure. An instruction decoder is essentially a form of combinatorial circuit. A combinatorial circuit is a circuit which has several inputs, and combines the state of all these inputs to determine what the output will be. Logic gates are combinatorial circuits, because their output depends on the state of all the inputs. Memory address decoders are also combinatorial circuits, because although they have several outputs, only one output is active at a time, and the active output will be different for every combination of inputs. (Combinatorial circuits are not to be confused with combination circuits. A "combination circit" can mean several things, but usually refers to a circuit which has both series and parallel architecture, also known as a "series-parallel" circuit.) The instruction decoder has several inputs. These inputs come directly from the data bus; Whenever the CPU has to perform an instruction, the opcode gets sent to the instruction decoder first, and the instruction decoder will process all the binary digits that make up the opcode to decide what the CPU will do next. Obviously, since each instruction has a different opcode, meaning a different combination of 1s and 0s, each possible combination of input bits for the instruction decoder means a different output from it. Exactly what format the instruction decoder's output takes may vary. In some CPUs, it may be simply a one-bit output that gets sent to a separate circuit. In such a situation, each CPU opcode has a separate physical circuit that is triggered by the output from the instruction decoder. In other CPUs, the instruction decoder's output is another set of bits which form a pointer to the instruction's location in "micro memory".