How Computers Compute Pt.1

Processing, Internal Registers and Boolean Logic

The CPU

  • In this post I’ll be discussing, at a basic level, the processes and systems by which a computer carries out its operations.

  • Computers at their core operate via processors. These processors are what allow computers to compute and process data.

  • CPU stands for Central Processing Unit and is often referred to as the brains of a computer

  • Modern CPUs come in a square shape and are often referred to as chips. Inside this square chip there are thousands of transistors (switches) which are responsible for processing data that represents an on or off state, binary 1s and 0s.

  • CPUs also have pins which act as the inputs and outputs which are responsible for sending and receiving data in the form of instructions and functions. This comes and goes as complex strings of binary data that the CPU processes and uses to function.

  • In many modern CPUs we can have billions of tiny transistors acting as switches and in some commercial grade CPUs this number even reaches into the trillions.

Internal Register

  • The transistors, acting as electrical switches, are used to build what are called Internal Registers. These can be seen as small high-speed storage locations which allow for the holding and retrieval of information. This information is then used for a wide array of functions such as electrical transmission, logical operations, storage of memory and instructions.

Boolean Logic

  • A significant function that takes place inside a CPU is the creation of logic circuits which can be configured and stacked on top of each other to carry out complex computations.

  • These logic gates carry out a type of digital calculation called Boolean logic which takes specific data inputs, collates them depending on the chosen logic and outputs a desired bit of information.

  • This can be demonstrated by looking at 2 common logic gates used which are AND gates and OR gates. An AND gate has 2 inputs A and B and 1 output C. In order for C to output a 1 (on) output both of our inputs A and B have to also be 1. If 1 or both of those inputs are 0 then our output will also be 0. This is the Boolean logic that takes place within an AND gate. This series of options can also be represented in what are called Truth tables which show the various input options and what will be produced as an output. In the context of Boolean logic, 1s and 0s can often also be referred to as true and false respectively. An OR gate also has 2 inputs and an output. In the case of an OR gate, in order for the output to be true we can have either input A or B or both be true (1/on) to output 1. If both inputs are false (0/off) then our output will also be 0/off.

  • The stacking of logic gates can be used to create desired outputs. We can stack them to perform some basic computations like addition, subtraction, storage of data and more. This stacking is more commonly known as circuits, whereby the outputs of one or more logic gates can become inputs for another logic gate and combined to create our desired outputs.