cpu
The Central Processing Unit (CPU) is the primary component of a computer responsible for executing instructions and performing calculations.
The Central Processing Unit (CPU), often referred to as the processor, is the primary hardware component of a computer responsible for interpreting and executing most of the commands and instructions from the computer's hardware and software. It acts as the 'brain' of the computer, performing arithmetic, logic, control, and input/output (I/O) operations specified by the instructions. Modern CPUs are complex integrated circuits (chips) typically containing billions of transistors. Key components include the Arithmetic Logic Unit (ALU), which performs calculations and logical operations; the Control Unit (CU), which directs the flow of operations and fetches instructions from memory; and registers, which are small, fast memory locations used to hold data temporarily during processing. The CPU's performance is measured by factors such as clock speed (measured in Hertz, indicating cycles per second), the number of cores (allowing parallel processing), cache size (fast onboard memory), and instruction set architecture (ISA), which defines the commands the CPU understands. The CPU fetches instructions from memory, decodes them, executes them, and writes results back to memory or registers, repeating this cycle millions or billions of times per second (the fetch-decode-execute cycle).
graph LR
Center["cpu"]:::main
Rel_asic["asic"]:::related -.-> Center
click Rel_asic "/terms/asic"
Rel_computer_science["computer-science"]:::related -.-> Center
click Rel_computer_science "/terms/computer-science"
Rel_operating_systems["operating-systems"]:::related -.-> Center
click Rel_operating_systems "/terms/operating-systems"
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧠 Knowledge Check
🧒 Explain Like I'm 5
The CPU is like a very fast calculator that follows a list of instructions. It's the part that does all the 'thinking' for everything you do on your computer, from moving your mouse to running a game.
🤓 Expert Deep Dive
The CPU is the engine of computation, executing instructions defined by its Instruction Set Architecture (ISA). Modern CPUs employ sophisticated techniques like pipelining, superscalar execution, out-of-order execution, and branch prediction to maximize instruction throughput and minimize latency. Pipelining breaks instruction execution into stages (fetch, decode, execute, memory access, write-back), allowing multiple instructions to be in different stages of execution simultaneously. Superscalar architectures feature multiple execution units, enabling the parallel execution of independent instructions within a single clock cycle. Out-of-order execution allows the CPU to reorder instructions dynamically to keep execution units busy, even if dependencies would normally cause stalls. Branch prediction attempts to guess the outcome of conditional branches to avoid pipeline flushes. Cache hierarchies (L1, L2, L3) are crucial for bridging the speed gap between the CPU and main memory (RAM), reducing memory access latency. Performance is a complex interplay of clock speed, Instructions Per Clock (IPC), core count, cache performance, and memory bandwidth. Vulnerabilities like Spectre and Meltdown exploit speculative execution mechanisms inherent in modern high-performance CPUs.