The CPU is the computational unit of a computer. It executes a sequence of instructions, which is provided directly or indirectly by the programmer. Instructions are programmed into the CPU and selected at the time when they are needed. The implementation of the instruction set can be different for a different type of CPU. An example of an instruction would be “read the contents of location x in memory”.

This instruction needs to be encoded in such a way that the CPU understands the instruction. In the basis, a computer operates with current flowing through the device. If we can manipulate the current, we can encode a message. For example, a high current would be 1 and a low current would be 0. With transistors and logic gates, chip/circuit designers encode different operations into a CPU.

For our example, let us assume that the operation “READ” is encoded as “00110010”, followed by the location. The current through the device is manipulated by the circuit, as the chip designer has implemented. For a certain point in time, the CPU get either a low current (bit==0) or a high current (bit==1). This process is regulated by the clock. The decoder component within the CPU would select the correct instruction and execute it. In the image below, a visualisation is given on how instructions are encoded in a computer.

image

Keywords

  • Instruction - the order given to the CPU to execute
  • Instruction set - the list of available instructions and their encodings in a CPU
  • Clock - the mechanism in the CPU which regulates when the new bit-value