The CPU (Central Processing Unit)

Home Computers

Introduction

At the heart of any computer system lies the Central Processing Unit (CPU), also known as the processor. The CPU is the brain of your computer, responsible for executing most instructions that your device receives. It's essentially the "control center" where all computations take place. In simple terms, the CPU's primary function is to read and execute a series of instructions called machine code, which are stored in the computer's memory (RAM).

If you are completely in the dark about computers, it might be worth reading the "what are the components of a computer page first" and then you can deep dive into each of the components such as this page "RAM", "Storage", "what is an OS" etc.

What

What is a CPU -- maybe this should be a comment

A CPU is a simple item that takes in a list of instructions and based on the instructions at hand passes the instruction on to its own internal subcomponents which are optimized to handle the instruction in question. Each of the components are very simple, they can do only one thing, but they can do them very well and blazingly fast. The components of the CPU are:

How

How does the CPU work -- maybe this should be a comment

The CPU follows a looping mechanism in order to process the instructions it receives, the order of these instructions is:
  1. Fetch - The CPU retrieves an instruction from memory
  2. Decode - The CPU decodes the instruction to determine what operation needs to be performed.
  3. Execute: The CPU carries out the instruction, which may involve performing arithmetic operations, accessing memory, or communicating with I/O devices
  4. Store: The CPU stores any results or intermediate values in memory.
This happens on repeat over and over. **Simple drawing of this in line here** The instructions cannot happen in parallel, but they can be placed in a overlapping pattern for increased ooomph. **Drawing of this overlapping optimization here**

Note!

All of the above assumes we are talking about a modern simple microprocessor - but these have evolved over time into this. If you want to know more about where they came from here is: The Eniac - The univac - The Bomba / Alan Turings Computer What is a Transistor On the other side of this we have where they evolved to from this Single-core vs Dual-core / multi-core processors TPU - Tensor Processing Unit Cryptographic processors GPU - Graphics Processing Unit Processor architecture: 8-bit to 64-bit, arm vs x86 vs mips, risc vs cisc (https://en.wikipedia.org/wiki/Comparison_of_instruction_set_architectures#Instruction_formats)