How Computers Compute Pt.2

Inner Functions of a Processor and Instruction Sets

  • Progressing on from my previous post regarding how computers compute, I will go into more detail on the functions taking place inside processors and how they operate.

  • If we think of the pins on a processor as transmitting data via electricity, and that transmission being dependent on the on/off state of the data being received by as well as sent from the processor, we can build a picture.

  • As an example we can look at the data coming into the pins of a processor, it could be 5V (1/on) or 0V (0/off). If we imagine a series of these on or off states going into 8 pins, and the series being 10110011, this can be converted into a hex number (0xB3) that can be easily stored. This stored information can then be used to convert back to the voltage states mentioned, then these can be used to compute the data within the circuits and give us our desired outputs.

Instruction Sets

  • In order for us to know what to tell the processor, i.e. what data and inputs to give the processor in order to carry out the processes we want it to, each processor has what are called instruction sets. These instruction sets have series of code which are programmed to perform specific functions that allow us to give specific instructions via inputs in order to perform these functions.

  • As an example we can see a simplified set of instructions which could do the following: MOVA - Moves data into A register with the instruction code 11110011, MOVB - Moves data into B register with the instruction code 11110111, ADD - Add A and B registers into A register with code 11000011 and NOP - No operation with code 11111111.

  • These instruction sets can be stored in an external memory and then our processor can run them from there. An example of an operation which uses this setup would be to add numbers together. Our external memory can store the above-mentioned instructions sets which perform certain move functions for our desired numbers, as well as the numbers themselves. The external memory also has pins which can be used to connect to the CPU and interacted with via circuitry. These instruction sets and number combinations can then be intentionally programmed to move the numbers from the external storage into the CPU, combined and added together sequentially to achieve desired outputs.

  • It should be noted that this is a very rudimentary explanation of what would actually take place inside a processor and there are many more procedures that take place for smooth operation such as clocking, stacks and instructions pointers.