What Is a CPU? What It Does Inside Your Computer and Phone

14 min read · Updated: October 23, 2026

A CPU (central processing unit) is the part of a computer that runs programs. It takes a program's instructions one at a time and carries them out: it calculates, and it reads and writes data. Each instruction is simple, such as "add" or "compare." But the CPU repeats them billions of times a second. Apps on computers and phones, and the controls in cars and home appliances, all run on these simple steps, piled up.

What you'll learn

  • What a CPU actually does (fetching and running instructions, over and over)
  • What numbers like "3 GHz" and "8 cores" mean, and why they alone do not decide speed
  • How the CPU's role differs from that of memory, storage and the GPU
  • Why PC apps do not run as-is on phones (different instruction sets)

Prerequisites: none. Knowing that a transistor is "a tiny switch flipped by electricity" makes the second half easier to read.

In everyday life

You tap a photo on your phone to zoom in. A spreadsheet adds up a column. An air conditioner turns down its fan to match the room temperature. Behind each of these actions, a CPU is at work.

Spec sheets for computers and phones list numbers such as "up to 3.5 GHz" and "8 cores" side by side. The words "x86" and "Arm" also appear in the news. This article walks through what a CPU actually does, and explains these numbers and words along the way.

A CPU's job is to carry out instructions

In short, a CPU's job is to run programs. A program is a task for the computer, broken down into very small steps and listed in order. Each of these steps is called an "instruction."

The instructions a CPU can handle directly are surprisingly simple. Typical kinds include:

  • Load and store: bring a number in from memory; put a number back into memory
  • Calculate: add or subtract two numbers, and so on
  • Compare: check which of two numbers is larger, or whether they are equal
  • Jump: change where the next instruction comes from, based on a comparison

Take this task as an example: when a button is pressed, add 1 to the number on the screen. Inside the CPU, this becomes a series of three instructions: load the number, add 1, and store it back. Deciding whether the button was pressed takes a "compare" plus a "jump." Photo editing and games, too, come down to huge combinations of instructions like these.

The instructions a CPU receives are written not in letters but as strings of 0s and 1s. A program in this form is called "machine code." Programs written by people are converted into machine code before the CPU runs them. To keep things simple, we have listed only typical kinds of instructions here.

Fetch, decode, execute, repeat

The series of instructions sits in a part called memory. Memory stores many numbers, each at a numbered location called an address. The CPU names an address to read or write what is stored there.

A program's instructions and the data it uses are kept side by side in the same memory. That is why the same machine can do a completely different job just by loading a different program. This design is called the von Neumann architecture, and almost all computers today follow it.

A CPU repeats three stages, over and over:

  1. Fetch: bring the next instruction in from memory
  2. Decode: work out what that string of 0s and 1s is telling it to do
  3. Execute: do the calculation or comparison, reading or writing data in memory if needed
The CPU's cycle: fetch an instruction from memory, decode it, execute it, and repeat CPU ① Fetch from memory ② Decode what to do? ③ Execute add, compare back to ① and repeat read instruction read/write data Memory Instruction: load Instruction: add 1 Instruction: store Data: 41 Data: 7 ①–③ repeat billions of times a second
The CPU fetches one instruction from memory (①), decodes it (②) and executes it (③). While executing, it reads or writes data if needed, then goes back to ①. What this figure leaves out: how the CPU tracks the next instruction, its small internal storage spots, and tricks for running several instructions at once.

A small storage spot inside the CPU remembers the address of the next instruction to fetch. It is called the "program counter." Normally, it moves to the next address after each instruction. Only a "jump" instruction rewrites it to a different address. Loops, and branches that depend on a condition, are built this way.

Real CPUs do not wait for one instruction to finish all three stages before starting the next. They overlap the stages, like an assembly line. This is called pipelining. Many CPUs also work on several instructions at the same time. Even so, they are designed so the result is the same as running the program one instruction at a time, in order.

Clock speed: what does "3 GHz" mean?

The circuits inside a CPU move their work forward a little at a time, in step with a signal that arrives at regular intervals. This signal is called the "clock." It is an electrical signal that switches on and off in a steady rhythm.

Clock frequency, or clock speed, is how many times this signal arrives per second. Its unit, the hertz (Hz), means "times per second," and giga (G) means a billion. So 3 GHz means the signal arrives 3 billion times per second. The time between signals is only about 0.33 nanoseconds (a nanosecond is one billionth of a second).

How many instructions a CPU can finish per clock tick depends on its design. This number of instructions per clock is called IPC, short for instructions per cycle. Roughly, the number of instructions run per second is "clock frequency × IPC." At the same frequency, a CPU with twice the IPC runs twice as many instructions in the same time.

Also, today's CPUs keep raising and lowering their frequency to match the workload and temperature. The "up to … GHz" on a spec sheet is the ceiling under good conditions. The CPU does not always run that fast.

Cores: several units that run instructions

One complete set of circuits that fetches and runs instructions is called a "core." Older CPUs had one core per chip (a part with circuits built onto a small slab of silicon). Today, almost all CPUs have several cores. An 8-core CPU can work on eight tasks (series of instructions) at the same time.

Cores multiplied because it became hard to keep raising the clock frequency. A higher frequency needs a higher voltage, and power use and heat then rise steeply. In the mid-2000s, the frequencies of PC CPUs stalled at a few GHz. So chipmakers turned to adding cores instead of raising frequency.

Many phone CPUs mix large, high-performance cores with small, low-power cores. For example, the CPU of the iPhone 15 Pro (2023) has 6 cores. Apple's specs list 2 performance cores and 4 efficiency cores. Light work, such as receiving email, goes to the small cores to save battery.

How the CPU differs from memory and storage

A CPU has some storage spots inside, but only a tiny amount. While the CPU works, programs and data mostly sit in memory (main memory). This is what a spec sheet means by "8 GB of memory." Today's memory is usually DRAM. It is fast to read and write, but it loses its contents when the power is turned off.

Storage, on the other hand, keeps photos and apps even when the power is off. The "256 GB" of a phone and a computer's SSD are storage. When you launch an app, its contents are loaded from storage into memory. The CPU then runs the instructions in memory.

From the CPU's point of view, even memory is far away, and reading from it means waiting. So the CPU keeps copies of often-used data in a small, fast storage area right next to it. This is called the cache. The difference between memory and storage is explained in more detail in "Memory vs Storage: What's the Difference?."

Where is the CPU?

In a PC, the CPU is often made as a separate chip. Recently, though, more PCs are built the same way as phones.

In a phone, the CPU is not a separate part. It sits inside a single chip that combines the CPU, the circuits that draw images, the communication circuits and more. This chip is called an SoC (system on a chip). Putting everything on one chip makes it smaller and saves power. Chips such as the M1, which Apple has used in Macs since 2020, are also SoCs.

Cars and home appliances have CPUs too. Most come in the form of a microcontroller: one chip with a CPU plus a small memory and input/output circuits. Microcontrollers handle tasks like the heat of a rice cooker, the fan speed of an air conditioner, and a car's engine and brakes. According to IEEE Spectrum (2021), some luxury cars have more than 150 such control computers.

The table in "MCU vs. MPU" compares microcontrollers with CPUs for PCs.

CPU vs. GPU

Besides the CPU, computers and phones have another computing part, called the GPU. The GPU was first built to draw pictures on the screen. That job means computing the colors of millions of dots on the screen, all with the same steps, at once.

The difference between a CPU and a GPU lies in the kind of work each one is good at. A CPU has a fairly small number of powerful cores. It is good at quickly handling varied work with many branches, one task at a time. A GPU lines up thousands of simple calculation circuits. It is good at doing the same calculation on large amounts of data all together. GPUs are widely used for AI because much of AI computing is "the same calculation, repeated a huge number of times."

Neither one is better; they split the work. Usually, the CPU organizes the overall job and hands suitable calculations to the GPU. The table in "CPU vs. GPU" compares them.

A CPU is made of transistors

A CPU's circuits are built by connecting huge numbers of transistors, tiny switches flipped by electricity. Combining switches gives circuits that make simple decisions, such as "output 1 if both inputs are 1." These are called "logic circuits."

Combine logic circuits further, and you get circuits that add numbers written in 0s and 1s (binary), and circuits that remember numbers. Combine these in many layers, and you get a CPU that fetches, decodes and executes instructions. "What Is a Transistor?" explains how transistors work. With the "logic circuit simulator," you can build logic circuits and try them out.

The number of transistors in CPUs has grown enormously over time. Intel's 4004, released in 1971, was one of the earliest CPUs on a single chip (a microprocessor). It had about 2,300 transistors. Apple's M1, announced in 2020, has about 16 billion. Note, though, that the M1 figure counts the whole chip, including the GPU and more, not just the CPU part.

Instruction sets: x86 vs. Arm

Which instructions does a CPU have, and which string of 0s and 1s stands for each one? This agreement is called the instruction set. Its formal name is "instruction set architecture" (ISA). An instruction set is a contract between software and the CPU. CPUs with the same instruction set can run the same machine code, even if their circuits and speeds differ.

Two instruction sets are the most widely used. One is "x86," which goes back to the 8086 that Intel announced in 1978. It is used in many Windows PCs and servers. The other is "Arm." According to Arm's annual report for the fiscal year ended March 2024, Arm's share of smartphone CPUs has been above 99% for many years.

This difference is one reason PC apps do not run as-is on phones. Programs written by people are usually converted into machine code by a conversion tool before they are distributed. At that point, the developer picks which instruction set the machine code is for. To an Arm CPU, x86 machine code is a meaningless string of 0s and 1s.

The same program becomes different machine code for each instruction set Program written by a person converted for each instruction set x86 machine code Arm machine code Runs Runs x86 CPU Arm CPU x86 machine code does not run as-is on an Arm CPU
The same program is converted into different machine code for each instruction set. What this figure leaves out: operating system differences, running machine code made for another instruction set by translating it, and converting to machine code right before running.

This is a simplified explanation, though. In reality, the operating system (OS) also differs. The OS is the basic software that manages the whole computer. Even on the same CPU, a Windows app does not run as-is on Android. On the other hand, with a translation mechanism, apps made for another instruction set can run.

For example, starting in 2020, Apple switched the CPUs in its Macs from Intel chips to its own Arm-based chips. At the same time, it provided "Rosetta 2," which translates apps made for Intel chips so they can run. Another approach is to ship one app that contains machine code for both, and Apple recommends this approach to app developers.

Common misconceptions

Myth: The CPU is the computer's "brain" and thinks for itself

In fact, a CPU does not understand what its instructions mean. It just carries them out exactly as written. Apps seem smart because the programs people wrote are well made. With AI, too, CPUs and GPUs run calculation steps that were built from large amounts of data. Also, most programs and data live outside the CPU, in memory and storage. The "brain" analogy easily suggests that the CPU thinks and remembers, so this article does not use it.

Myth: A CPU with a higher GHz number is always faster

In fact, clock speed alone does not decide speed. Instructions finished per clock (IPC), the number of cores and time spent waiting for memory all have a big effect. Between CPUs of different designs, the one with the lower frequency is often faster. Within the same product series, frequency can serve as a rough guide. Across makers or generations, the reliable way to compare is to measure with programs close to your own use (benchmarks).

Myth: Doubling the cores makes everything twice as fast

In fact, only the parts that can be split up to run at the same time get faster. Parts that must wait for an earlier result before moving on do not speed up with more cores. This limit is called Amdahl's law. With the "Amdahl's law calculator," you can change the share that can be split and the number of cores to see the effect.

By the numbers

ItemNumberFor comparison
One clock tick at 3 GHzAbout 0.33 nanosecondsEven light travels only about 10 cm in that time
Clock of the Intel 4004 (1971)Up to 740 kHz (740,000 times per second)Today's CPUs, at a few GHz, are clocked thousands of times higher
Transistor countAbout 2,300 in the 4004; about 16 billion in the M1 (2020)About 7 million times more in about 50 years
CPU cores in the iPhone 15 Pro (2023)6 cores2 performance + 4 efficiency
Arm's share of smartphone CPUsOver 99%Arm's annual report for the fiscal year ended March 2024

Light travels about 300,000 km per second. Divide that into 3 billion parts, and each part is about 10 cm. Signals inside the CPU must pass through its circuits within this short time.

The table shows that while the clock rose thousands of times, the transistor count rose about 7 million times. CPUs did not get faster through frequency alone. A big part came from using the extra transistors for more cores and caches, and for finishing more instructions per clock.

Learn more

Read next

Articles in the series “How computers work”

  1. How Do Computers Use Binary? Calculating with 0 and 1
  2. What Is a CPU? What It Does Inside Your Computer and Phone
  3. Why Are GPUs Used for AI? Matrix Math and Memory Explained
  4. What Is an Operating System? What an OS Actually Does
  5. How Does CPU Cache Work? Hit Rate, Lines and Locality
  6. What Is an NPU? The AI Engine in Phones and PCs Explained
  7. What Is an FPGA? A Chip You Can Rewire After It's Made
  8. What Is an ASIC? Custom Chips vs CPUs and FPGAs Explained
  9. How Compilers Work: From Source Code to Machine Code
  10. What Is a Logic Gate? AND, OR, NOT and How Gates Compute
  11. What Is RISC-V? The Open Instruction Set Explained
  12. What Is an Algorithm? Search, Sorting and Big-O Explained
  13. What Is a Database? Tables, SQL and Indexes Explained
  14. What Is Git? Version Control Basics and Git vs GitHub

Questions on this topic: CPUs and architecture

Sources

All explainers