By all means, we know for sure this is the most fundamental part of a computer. It is important and the motherboard knows that… It truly does. I am not underestimating the RAM or the cooling unit, I am stating a fact. In this article, we shall disassemble this component (theoretically) and understand how it works and its importance. Lets get right into demystification… but before all that, it is important to note that we have other chip manufacturers, not just Intel.
The processor is considered to be the brains of the computer for a very simple reason, it does all the thinking. The thinking here is figurative because, it really does not perform like the biological human brain, it just borrows from it. It is safe to say that a computer cannot be without its CPU, for the same reason we say a person is clinically dead only after their brain stops functioning – now you get its importance, right?
By definition, the central processing unit (CPU) is the electronic circuitry in a computer that carries out the instructions of a computer program by performing the arithmetic and logical operations specified by the instructions given by the computer program. There are a bunch of other definitions but let us work with that one. In the definition, I’d like you to note the following terms; computer program, arithmetic and logic. We’ll get to each one of them in a while. If you get lost in the definitions, feel free to leave a comment below.
The most fundamental step of understanding the CPU is learning it theoretically and for that, we shall divide it into two parts. I shall also cover another part of the CPU that is present in modern processors. The two major parts of a processor are the Arithmetic Logic Unit (ALU) and the Control Unit (CU). The CU behaves like a human supervisor. Instead of executing a computer program, the CU directs the ALU and memory to perform as per the instructions of a computer program using electrical signals.
The ALU is divided into two part; arithmetic and logic. When arithmetic is considered, we talk about computations involving the mathematical signs; addition, subtraction, division, multiplication and so forth. When we mention logic, we are considering bitwise logical operations. Bitwise operations are computational operations that involve one or more bit patterns. In a more simplified fashion, the logic part involves operations such as if, if..else, loops and so forth.
Finally, there is a third part of the CPU that is available for modern high end microprocessors. The sole job of this part is to translate logical addresses into physical RAM addresses allowing for security, efficiency and continuity. With that out of the way, let us understand the theory of how a CPU works.
A CPU operates in a very easy format. Three steps form a cycle and these cycles are used to measure the speed of a CPU. The three steps in each cycle are; fetch, decode, execute. Fetching requires the CPU to acquire the instructions of a program from memory where these instructions are stored in bits. From there, the instruction fetched is converted into signals that can control the other parts of the system. Once done, the final step of execution involves the connection of various parts of the CPU electrically to enable the CPU perform the desired operations. Some CPU’s may store these instructions for easier access in the future.
To the interesting bit now, the Logic Gates. There are fundamental logic gates; AND, OR and NOT. Combinations are possible from any of those; NAND, NOR, XOR and even more complex ones. I covered logical gates in more detail in this article. The processor can perform arithmetic as well as other operations using logic gates. When electric current is directed through these gates as per the instructions of the program, a specific result is produced. It is important to note that the CPU is basically a board of electric circuits, arranged in a complex and systematic format.
From what we have seen, each operation (whether logical or arithmetic) must be performed in the CPU and given back to the user as an output. Each input must go through the CPU for processing. This is to mean the computer cannot perform without. It simply cannot.
Now you know.