November 22, 2022
CPU vs. GPU: What's the Difference?
The CPU and GPU are both essential components in modern computers. Here’s what you need to know when comparing a CPU vs. GPU.
The primary difference between a CPU and GPU is that a CPU handles all the main functions of a computer, whereas the GPU is a specialized component that excels at running many smaller tasks at once. The CPU and GPU are both essential, silicon-based microprocessors in modern computers. In this guide, we get into detail about what a CPU and GPU is and what makes them alike and distinct. Here’s what you need to know when comparing a CPU vs. GPU.
What is a Central Processing Unit (CPU)?
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.
CPUs have a few universal features. For a deeper look on CPUs, check out our guide on how to choose a CPU:
- Cores - A core is basically a CPU’s processor. Back in computing antiquity, processors had just one core. Now, computers commonly have anywhere from two to 64 cores. The more cores a CPU has, the better its performance and efficiency.
- Simultaneous multithreading/hyperthreading - Simultaneously multithreading (known as hyperthreading in Intel processors) is where processing is delegated to multiple software threads, rather than given to a single core. This allows for more work to be done simultaneously, effectively turning one core into two “logical” cores.
- Cache - CPUs have their own ultra-fast memory built right in, which is faster than any RAM or type of SSD. The CPU cache is arranged from L1-L3, with L1 being the fastest — the CPU will store information it needs quickly there.
- Memory Management Unit (MMU) -The MMU is responsible for all memory and caching operations. Typically integrated into the CPU, it acts as the middleman between the CPU and RAM during the fetch-decode-execute cycle, shuttling data back and forth as necessary. It also translates virtual addresses provided by software to physical addresses used by RAM.
- Control Unit - The control unit orchestrates the operations of the CPU. It tells the RAM, logic unit, and I/O devices how to act according to the instructions received.
What is a Graphics Processing Unit (GPU)?
A GPU, also known as a graphics card or video card, is the computer component that renders images and video. They are either independent from the motherboard (discrete) and have their own memory (vRAM) or soldered to it (integrated) and share memory with the CPU. Typically, integrated GPUs have lesser performance than discrete GPUs since they are smaller and share resources with the CPU.
With the increasing ability of computers to run 3D graphics and other intense workloads, having the CPU handle everything began to decrease performance. There came a need for a dedicated microprocessor to handle some of the burden. A GPU is like a specialized CPU and is particularly well suited for multitasking. In fact, CPUs used to do the job that GPUs do today.
Rather than processing tasks serially (in order) like a CPU, a GPU breaks up tasks and runs them in parallel. GPUs have many more cores than CPUs, although they are smaller. With the additional cores, GPUs can handle many more mathematical and geographical calculations at once with greater efficiency, whereas CPUs are more restricted due to the fact it is a more “generalist” component.
Differences Between a CPU and GPU
|Generalist component- Handles main processing functions of a computer||Specialized component - Handles graphic and video rendering|
|Core count- 2-64 (most CPUs)||Core count- thousands|
|Runs processes serially||Runs processes in parallel|
|Better at processing one big task at a time||Better at processing several smaller tasks at a time|