What does a CPU do and why does it affect speed?

The short answer

A CPU (central processing unit) is the chip that runs your apps by repeating one short loop billions of times a second: fetch an instruction, decode it, execute it, store the result.

Animated diagram: What does a CPU do and why does it affect speed?

CPU

A CPU (central processing unit) is the chip that runs the instructions behind every app you use. It does this by repeating one short loop billions of times a second. It fetches an instruction, decodes it, executes it and stores the result. Your video call and every loading tab are that loop running over and over.

How fast that loop feels depends on more than one number. A clock sets the pace, measured in gigahertz (GHz). Modern chips also have several cores, which are separate engines running the loop. They also have cache, a small fast memory beside the core. Cache exists to cut the time the core spends waiting on main memory, called RAM (random access memory).

What a CPU actually does

First, the CPU fetches the app’s next instruction from memory. If the instruction was used recently, cache keeps it close, so the core waits less. Next, the control unit decodes the instruction, working out what it means. Then the arithmetic logic unit (ALU) executes it. The ALU is the part that does the math and logic. Finally, the result is written to a register, a small slot inside the core, or to memory.

A simple x86-64 instruction shows the idea. add rax, rbx tells the core to add the value in register rbx to the one in rax. The result is kept in rax. If rax holds 5 and rbx holds 3, rax holds 8 afterwards.

How the clock, cores and cache work together

  1. The clock sets the pace. Each tick is one cycle. 3.2 GHz means 3.2 billion cycles per second, not 3.2 billion instructions.
  2. Steps overlap like an assembly line. This is called pipelining. While one instruction executes, the next is being decoded and the one after that is being fetched. Newer cores can also finish several instructions per cycle.
  3. Cores run tasks side by side. Each core is a separate engine running the loop, so eight cores can work on eight tasks at once. With Hyper-Threading, one core can also run two threads.
  4. Cache cuts the waiting. Often used instructions and data stay in fast memory near the core. That way the core spends less time waiting on RAM.

Put together, speed comes from cycles, cores and cache together. It also depends on how much work the design finishes each cycle. When every core is busy, new work waits its turn. That’s why a video call can stutter while twenty tabs are loading.

Gigahertz is not work done

Many people think the chip with more gigahertz is always faster. It isn’t. Gigahertz counts ticks, not the work done in each tick. The work per tick is called instructions per cycle (IPC), and newer designs finish more instructions per tick. Cores, cache and the chip’s design matter too. That’s why clock speed is best compared within the same brand and generation. Clock speed isn’t one fixed number either. Modern CPUs raise their clock above the base speed and lower it to save power.

What to do

  • On Windows 11, press Ctrl+Shift+Esc to open Task Manager, then choose Performance and CPU. You’ll see Utilization, Speed, Base speed, Cores and Logical processors.
  • Don’t worry if Speed and Base speed differ. The chip raises its clock above base and lowers it to save power.
  • If a call stutters, check Utilization. If it’s near the top, close tabs and apps you don’t need so the cores have room.
  • When comparing computers, look at cores, cache and design together. Compare gigahertz only within the same brand and generation.

#CPU#Processor#HowComputersWork#PCPerformance#TechExplained#ComputerScience#TechTips#Windows11

Watch it in 60 seconds