Often compared to the “brains” of your device, the central processing unit, or CPU, is a silicon chip that is attached to a socket on the motherboard. The CPU is responsible for everything you can do on a computer, executing instructions for programs from your system’s memory via billions of microscopic transistors with instructions from software. It’s like having billions of on-off switches that control the flow of electricity, translating tasks into 0’s and 1’s.
Most modern processors are capable of anywhere from 1-5 billion operations per second. Usually, memory is accessed from RAM in order, but it can be fetched out of order, hence the random in random access memory.
The core functionality of the CPU is to fetch instructions from random access memory, or RAM, and then decoding and executing the instructions. They run processes serially, meaning one after the other.
Here's a rundown of the basic functions of a CPU:
- Fetch - The CPU sends an address to RAM (or other program memory) and retrieves an instruction, which could be a number or series of numbers, a letter, an address, or other piece of data back, which the CPU then processes. Within these instructions from RAM are number/numbers representing the next instruction to be fetched.
- Decode - Once the CPU has data, it has an instruction set it can act upon the data with. Some of the more common instructions include loading a number from RAM, adding numbers together, logical functions like Boolean logic, storing a number from the CPU back to the RAM, taking device input or outputting data to a device, comparing numbers, or jumping to a RAM address.
- Execute - Finally, the instruction gets passed to the instruction decoder, which converts the instruction into electrical signals sent to various parts of the CPU to be acted upon. The process begins again once the next instruction is fetched.