Sub topic 4
CPU basics: architectures, cores, threads, and cache
This chapter assumes you can name the main parts of a PC, know what GHz and GB mean, and follow ESD safety rules. It covers what a CPU is made of, how architectures differ, how cores and threads add up, and how cache hides memory delay. Sockets, features, and cooling come in later chapters.
What the CPU does
The central processing unit (CPU) runs program instructions. It fetches an instruction from memory, decodes it, executes it, and writes back the result. This is the fetch-decode-execute cycle. A clock signal paces the cycle, and clock speed is measured in GHz (billions of cycles per second).
Clock speed alone does not predict performance. Two CPUs at 3.5 GHz can differ a lot because of how much work each does per cycle (instructions per clock, or IPC), how many cores they have, and how large their caches are.
Architectures: x86, x64, and ARM
An architecture (also called an instruction set architecture, or ISA) defines the instructions a CPU understands. Software built for one ISA will not run natively on another.
| Architecture | Typical use | Notes |
|---|---|---|
| x86 (32-bit) | Older PCs | Addresses at most 4 GB of RAM |
| x64 (x86-64, AMD64) | Modern desktops, laptops, servers | Runs 64-bit and 32-bit software; supports far more than 4 GB of RAM |
| ARM | Phones, tablets, some laptops, single-board computers | Power efficient, so common in battery devices |
Intel and AMD both make x86-64 CPUs. ARM designs are licensed to many manufacturers. The A+ exam expects you to match architecture to device type and to know that a 64-bit operating system needs a 64-bit CPU.
Two related terms often appear together:
- CISC (complex instruction set computing) describes x86, which has many varied instructions.
- RISC (reduced instruction set computing) describes ARM, which uses a smaller, simpler instruction set.
Because of this difference, an ARM device cannot run a standard x86 desktop program unless the operating system translates or emulates it.
Cores
A core is an independent processing unit inside the CPU package. Each core has its own execution hardware and can run one stream of instructions at a time. A multicore CPU puts several cores on one chip.
Common names are dual-core (2), quad-core (4), hexa-core (6), and octa-core (8). Server and workstation chips can have dozens.
More cores help when software can split work into parallel tasks, such as video encoding, compiling code, or running many programs at once. A single-threaded program uses only one core, so a higher clock speed or better IPC helps it more than extra cores.
Some modern CPUs mix two core types. Performance cores handle heavy work. Efficiency cores handle background tasks with less power. The operating system scheduler decides which core runs which task.
Threads and simultaneous multithreading
A thread is a sequence of instructions that the operating system schedules. Simultaneous multithreading (SMT) lets one physical core run two threads at the same time by filling idle execution slots. Intel calls its version Hyper-Threading. AMD calls it SMT.
The operating system sees each thread as a logical processor. A 6-core CPU with SMT shows 12 logical processors.
SMT is not the same as doubling the cores. The two threads share one core's resources, so the typical gain is a modest fraction, not 100%.
Cache
CPU cores are much faster than RAM. Without help, a core would wait many cycles for each memory read. Cache is a small amount of very fast memory built into the CPU that keeps copies of recently used data and instructions.
Cache is organized in levels:
- L1 is the smallest and fastest. Each core has its own, usually split into instruction and data parts. Sizes are tens of KB.
- L2 is larger and slightly slower. It is often per core. Sizes range from hundreds of KB to a few MB.
- L3 is the largest and slowest cache. It is usually shared by all cores. Sizes range from several MB to hundreds of MB.
When the core finds the data it needs in cache, that is a cache hit. When it must go to RAM, that is a cache miss, which costs far more time. Programs that reuse the same data benefit most from a big cache.
Cache is built from SRAM, which is fast but takes more chip area and power than the DRAM used for system memory. That is why cache is measured in MB while RAM is measured in GB.
Checking CPU details
You can verify a CPU's model, core count, and thread count from the operating system. On Windows, PowerShell can query it.
Get-CimInstance Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors
Get-CimInstance Win32_PhysicalMemory | Select-Object Manufacturer, Capacity, Speed, DeviceLocatorThe first command lists the CPU name, its physical cores, and its logical processors. The second lists each installed memory module with its capacity, speed, and slot. On Linux, use these commands.
lscpu
sudo dmidecode -t memorylscpu shows the model, architecture, cores, threads per core, and cache sizes. dmidecode -t memory lists each memory slot with its module type, size, and speed.
Worked example: reading a spec
Suppose a listing says: "8-core, 16-thread, 3.6 GHz base, 4.9 GHz boost, 32 MB L3 cache, 64-bit."
- 8 cores and 16 threads means SMT is supported, and the OS shows 16 logical processors.
- Base clock is the guaranteed speed under sustained load. Boost clock is the higher speed a core can reach briefly when power and temperature allow.
- 32 MB of L3 is shared by all eight cores.
- 64-bit means it runs a 64-bit OS and addresses more than 4 GB of RAM.
Common errors and edge cases
- Confusing threads with cores. A 4-core, 8-thread CPU is not an 8-core CPU. Count physical cores for true parallel hardware.
- Expecting more cores to speed up everything. Single-threaded tasks gain nothing from extra cores.
- Installing 64-bit software on a 32-bit OS or CPU. It will not run. A 32-bit OS also uses only about 4 GB of RAM, even if more is installed.
- Comparing GHz across architectures. A 3 GHz ARM chip and a 3 GHz x86 chip are not equivalent. Compare benchmarks instead.
- Assuming boost speed is constant. Boost depends on cooling and power. Poor cooling lowers sustained speed (thermal throttling).
- Ignoring SMT settings. SMT can be turned off in BIOS/UEFI, so the logical processor count can drop to the core count.
Exercise
A technician sees "Cores: 6" and "Logical processors: 12" in Task Manager. What does this indicate, and does the machine have the processing power of 12 cores?
Show answer
The CPU has 6 physical cores with SMT (Hyper-Threading) enabled, so each core runs two threads and the OS shows 12 logical processors. It does not have the power of 12 cores, because paired threads share one core's resources and the gain is only a modest fraction.
Exercise
Put these in order from fastest and smallest to slowest and largest: L3 cache, L1 cache, system RAM, L2 cache.
Show answer
L1 cache, L2 cache, L3 cache, system RAM.
Exercise
A customer wants to install a 64-bit program on a PC with a 32-bit x86 CPU. Will it work, and why?
Show answer
No. A 32-bit CPU cannot run a 64-bit operating system or 64-bit software, because it does not support the x64 instruction set.