Hubbry Logo
Central processing unitCentral processing unitMain
Open search
Central processing unit
Community hub
Central processing unit
logo
8 pages, 0 posts
0 subscribers
Be the first to start a discussion here.
Be the first to start a discussion here.
Contribute something
Central processing unit
Central processing unit
from Wikipedia
A high-end consumer CPU made by Intel: an Intel Core i9-14900KF
Inside a central processing unit: The integrated circuit of Intel's Xeon 3060, first manufactured in 2006

A central processing unit (CPU), also called a central processor, main processor, or just processor, is the primary processor in a given computer.[1][2] Its electronic circuitry executes instructions of a computer program, such as arithmetic, logic, controlling, and input/output (I/O) operations.[3][4][5] This role contrasts with that of external components, such as main memory and I/O circuitry,[6] and specialized coprocessors such as graphics processing units (GPUs).

The form, design, and implementation of CPUs have changed over time, but their fundamental operation remains almost unchanged.[7] Principal components of a CPU include the arithmetic–logic unit (ALU) that performs arithmetic and logic operations, processor registers that supply operands to the ALU and store the results of ALU operations, and a control unit that orchestrates the fetching (from memory), decoding and execution (of instructions) by directing the coordinated operations of the ALU, registers, and other components. Modern CPUs devote a lot of semiconductor area to caches and instruction-level parallelism to increase performance and to CPU modes to support operating systems and virtualization.

Most modern CPUs are implemented on integrated circuit (IC) microprocessors, with one or more CPUs on a single IC chip. Microprocessor chips with multiple CPUs are called multi-core processors.[8] The individual physical CPUs, called processor cores, can also be multithreaded to support CPU-level multithreading.[9]

An IC that contains a CPU may also contain memory, peripheral interfaces, and other components of a computer;[10] such integrated devices are variously called microcontrollers or systems on a chip (SoC).

History

[edit]
EDVAC, one of the first stored-program computers

Early computers such as the ENIAC had to be physically rewired to perform different tasks, which caused these machines to be called "fixed-program computers".[11] The "central processing unit" term has been in use since as early as 1955.[12][13] Since the term "CPU" is generally defined as a device for software (computer program) execution, the earliest devices that could rightly be called CPUs came with the advent of the stored-program computer.

The idea of a stored-program computer had already been present in the design of John Presper Eckert and John William Mauchly's ENIAC, but was initially omitted so that it could be finished sooner.[14] On June 30, 1945, before ENIAC was made, mathematician John von Neumann distributed a paper entitled First Draft of a Report on the EDVAC. It was the outline of a stored-program computer that would eventually be completed in August 1949.[15] EDVAC was designed to perform a certain number of instructions (or operations) of various types. Significantly, the programs written for EDVAC were to be stored in high-speed computer memory rather than specified by the physical wiring of the computer.[16] This overcame a severe limitation of ENIAC, which was the considerable time and effort required to reconfigure the computer to perform a new task.[17] With von Neumann's design, the program that EDVAC ran could be changed simply by changing the contents of the memory. EDVAC was not the first stored-program computer; the Manchester Baby, which was a small-scale experimental stored-program computer, ran its first program on 21 June 1948[18] and the Manchester Mark 1 ran its first program during the night of 16–17 June 1949.[19]

Early CPUs were custom designs used as part of a larger and sometimes distinctive computer.[20] However, this method of designing custom CPUs for a particular application has largely given way to the development of multi-purpose processors produced in large quantities. This standardization began in the era of discrete transistor mainframes and minicomputers, and has rapidly accelerated with the popularization of the integrated circuit (IC). The IC has allowed increasingly complex CPUs to be designed and manufactured to tolerances on the order of nanometers.[21] Both the miniaturization and standardization of CPUs have increased the presence of digital devices in modern life far beyond the limited application of dedicated computing machines. Modern microprocessors appear in electronic devices ranging from automobiles[22] to cellphones,[23] and sometimes even in toys.[24][25]

While von Neumann is most often credited with the design of the stored-program computer because of his design of EDVAC, and the design became known as the von Neumann architecture, others before him, such as Konrad Zuse, had suggested and implemented similar ideas.[26] The so-called Harvard architecture of the Harvard Mark I, which was completed before EDVAC,[27][28] also used a stored-program design using punched paper tape rather than electronic memory.[29] The key difference between the two is that Harvard architecture separates the storage and treatment of CPU instructions and data, whereas von Neumann architecture uses the same memory space for both.[30] Most modern CPUs are primarily von Neumann in design, but CPUs with the Harvard architecture are seen as well, especially in embedded applications; for instance, the Atmel AVR microcontrollers are Harvard-architecture processors.[31]

Prior to the invention of the transistor, relays and vacuum tubes (thermionic tubes) were commonly used as switching elements;[32][33] a useful computer requires thousands or tens of thousands of switching devices. The overall speed of a system is dependent on the speed of the switches. Vacuum-tube computers such as EDVAC tended to average eight hours between failures, whereas relay computers—such as the slower but earlier Harvard Mark I—failed very rarely.[13] In the end, tube-based CPUs became dominant because the significant speed advantages afforded generally outweighed the reliability problems. Most of these early synchronous CPUs ran at low clock rates compared to modern microelectronic designs. Clock signal frequencies ranging from 100 kHz to 4 MHz were very common at this time, limited largely by the speed of the switching devices they were built with.[34]

Transistor CPUs

[edit]
IBM PowerPC 604e processor

The design complexity of CPUs increased as various technologies facilitated the building of smaller and more reliable electronic devices. The first such improvement came with the advent of the transistor. Transistorized CPUs during the 1950s and 1960s no longer had to be built out of bulky, unreliable, and fragile switching elements, like vacuum tubes and relays.[35] With this improvement, more complex and reliable CPUs were built onto one or several printed circuit boards containing discrete (individual) components.

In 1964, IBM introduced its IBM System/360 computer architecture that was used in a series of computers capable of running the same programs with different speeds and performances.[36] This was significant at a time when most electronic computers were incompatible with one another, even those made by the same manufacturer. To facilitate this improvement, IBM used the concept of a microprogram (often called "microcode"), which still sees widespread use in modern CPUs.[37] The System/360 architecture was so popular that it dominated the mainframe computer market for decades and left a legacy that is continued by similar modern computers like the IBM zSeries.[38][39] In 1965, Digital Equipment Corporation (DEC) introduced another influential computer aimed at the scientific and research markets—the PDP-8.[40]

Fujitsu board with SPARC64 VIIIfx processors

Transistor-based computers had several distinct advantages over their predecessors. Aside from facilitating increased reliability and lower power consumption, transistors also allowed CPUs to operate at much higher speeds because of the short switching time of a transistor in comparison to a tube or relay.[41] The increased reliability and dramatically increased speed of the switching elements, which were almost exclusively transistors by this time; CPU clock rates in the tens of megahertz were easily obtained during this period.[42] Additionally, while discrete transistor and IC CPUs were in heavy usage, new high-performance designs like single instruction, multiple data (SIMD) vector processors began to appear.[43] These early experimental designs later gave rise to the era of specialized supercomputers like those made by Cray Inc and Fujitsu Ltd.[43]

Small-scale integration CPUs

[edit]
CPU, core memory and external bus interface of a DEC PDP-8/I, made of medium-scale integrated circuits

During this period, a method of manufacturing many interconnected transistors in a compact space was developed. The integrated circuit (IC) allowed a large number of transistors to be manufactured on a single semiconductor-based die, or "chip". At first, only very basic non-specialized digital circuits such as NOR gates were miniaturized into ICs.[44] CPUs based on these "building block" ICs are generally referred to as "small-scale integration" (SSI) devices. SSI ICs, such as the ones used in the Apollo Guidance Computer, usually contained up to a few dozen transistors. To build an entire CPU out of SSI ICs required thousands of individual chips, but still consumed much less space and power than earlier discrete transistor designs.[45]

IBM's System/370, follow-on to the System/360, used SSI ICs rather than Solid Logic Technology discrete-transistor modules.[46][47] DEC's PDP-8/I and KI10 PDP-10 also switched from the individual transistors used by the PDP-8 and KA PDP-10 to SSI ICs,[48] and their extremely popular PDP-11 line was originally built with SSI ICs, but was eventually implemented with LSI components once these became practical.

Large-scale integration CPUs

[edit]

Lee Boysel published influential articles, including a 1967 "manifesto", which described how to build the equivalent of a 32-bit mainframe computer from a relatively small number of large-scale integration circuits (LSI).[49][50] The only way to build LSI chips, which are chips with a hundred or more gates, was to build them using a metal–oxide–semiconductor (MOS) semiconductor manufacturing process (either PMOS logic, NMOS logic, or CMOS logic). However, some companies continued to build processors out of bipolar transistor–transistor logic (TTL) chips because bipolar junction transistors were faster than MOS chips up until the 1970s (a few companies such as Datapoint continued to build processors out of TTL chips until the early 1980s).[50] In the 1960s, MOS ICs were slower and initially considered useful only in applications that required low power.[51][52] Following the development of silicon-gate MOS technology by Federico Faggin at Fairchild Semiconductor in 1968, MOS ICs largely replaced bipolar TTL as the standard chip technology in the late 1970s.[53]

As the microelectronic technology advanced, an increasing number of transistors were placed on ICs, decreasing the number of individual ICs needed for a complete CPU. MSI and LSI ICs increased transistor counts to hundreds, and then thousands. By 1968, the number of ICs required to build a complete CPU had been reduced to 24 ICs of eight different types, with each IC containing roughly 1000 MOSFETs.[54] In stark contrast with its SSI and MSI predecessors, the first LSI implementation of the PDP-11 contained a CPU composed of only four LSI integrated circuits.[55]

Microprocessors

[edit]
Die of an Intel 80486DX2 microprocessor (actual size: 12 × 6.75 mm) in its packaging
Intel Core i5 CPU on a Vaio E series laptop motherboard (on the right, beneath the heat pipe)
Inside of a laptop, with the CPU removed from socket

Since microprocessors were first introduced they have almost completely overtaken all other central processing unit implementation methods. The first commercially available microprocessor, made in 1971, was the Intel 4004. The Intel 4004 was one of the first consumer-facing CPU integrating arithmetic logic unit, control unit, and register unit on a chip.[56] The first widely used microprocessor, made in 1974, was the Intel 8080. Mainframe and minicomputer manufacturers of the time launched proprietary IC development programs to upgrade their older computer architectures, and eventually produced instruction set compatible microprocessors that were backward-compatible with their older hardware and software. Combined with the advent and eventual success of the ubiquitous personal computer, the term CPU is now applied almost exclusively[a] to microprocessors. Several CPUs (denoted cores) can be combined in a single processing chip.[57]

Previous generations of CPUs were implemented as discrete components and numerous small integrated circuits (ICs) on one or more circuit boards.[58] Microprocessors, on the other hand, are CPUs manufactured on a very small number of ICs; usually just one.[59] The overall smaller CPU size, as a result of being implemented on a single die, means faster switching time because of physical factors like decreased gate parasitic capacitance.[60][61] This has allowed synchronous microprocessors to have clock rates ranging from tens of megahertz to several gigahertz. Additionally, the ability to construct exceedingly small transistors on an IC has increased the complexity and number of transistors in a single CPU many fold. This widely observed trend is described by Moore's law, which had proven to be a fairly accurate predictor of the growth of CPU (and other IC) complexity until 2016.[62][63]

While the complexity, size, construction and general form of CPUs have changed enormously since 1950,[64] the basic design and function has not changed much at all. Almost all common CPUs today can be very accurately described as von Neumann stored-program machines.[65][b] As Moore's law no longer holds, concerns have arisen about the limits of integrated circuit transistor technology. Extreme miniaturization of electronic gates is causing the effects of phenomena like electromigration and subthreshold leakage to become much more significant.[67][68] These newer concerns are among the many factors causing researchers to investigate new methods of computing such as the quantum computer, as well as to expand the use of parallelism and other methods that extend the usefulness of the classical von Neumann model.

Operation

[edit]

The fundamental operation of most CPUs, regardless of the physical form they take, is to execute a sequence of stored instructions that is called a program. The instructions to be executed are kept in some kind of computer memory. Nearly all CPUs follow the fetch, decode and execute steps in their operation, which are collectively known as the instruction cycle.

After the execution of an instruction, the entire process repeats, with the next instruction cycle normally fetching the next-in-sequence instruction because of the incremented value in the program counter. If a jump instruction was executed, the program counter will be modified to contain the address of the instruction that was jumped to and program execution continues normally. In more complex CPUs, multiple instructions can be fetched, decoded and executed simultaneously. This section describes what is generally referred to as the "classic RISC pipeline", which is quite common among the simple CPUs used in many electronic devices (often called microcontrollers). It largely ignores the important role of CPU cache, and therefore the access stage of the pipeline.

Some instructions manipulate the program counter rather than producing result data directly; such instructions are generally called "jumps" and facilitate program behavior like loops, conditional program execution (through the use of a conditional jump), and existence of functions.[c] In some processors, some other instructions change the state of bits in a "flags" register. These flags can be used to influence how a program behaves, since they often indicate the outcome of various operations. For example, in such processors a "compare" instruction evaluates two values and sets or clears bits in the flags register to indicate which one is greater or whether they are equal; one of these flags could then be used by a later jump instruction to determine program flow.

Fetch

[edit]

Fetch involves retrieving an instruction (which is represented by a number or sequence of numbers) from program memory. The instruction's location (address) in program memory is determined by the program counter (PC; called the "instruction pointer" in Intel x86 microprocessors), which stores a number that identifies the address of the next instruction to be fetched. After an instruction is fetched, the PC is incremented by the length of the instruction so that it will contain the address of the next instruction in the sequence.[d] Often, the instruction to be fetched must be retrieved from relatively slow memory, causing the CPU to stall while waiting for the instruction to be returned. This issue is largely addressed in modern processors by caches and pipeline architectures (see below).

Decode

[edit]

The instruction that the CPU fetches from memory determines what the CPU will do. In the decode step, performed by binary decoder circuitry known as the instruction decoder, the instruction is converted into signals that control other parts of the CPU.

The way in which the instruction is interpreted is defined by the CPU's instruction set architecture (ISA).[e] Often, one group of bits (that is, a "field") within the instruction, called the opcode, indicates which operation is to be performed, while the remaining fields usually provide supplemental information required for the operation, such as the operands. Those operands may be specified as a constant value (called an immediate value), or as the location of a value that may be a processor register or a memory address, as determined by some addressing mode.

In some CPU designs, the instruction decoder is implemented as a hardwired, unchangeable binary decoder circuit. In others, a microprogram is used to translate instructions into sets of CPU configuration signals that are applied sequentially over multiple clock pulses. In some cases the memory that stores the microprogram is rewritable, making it possible to change the way in which the CPU decodes instructions.

Execute

[edit]

After the fetch and decode steps, the execute step is performed. Depending on the CPU architecture, this may consist of a single action or a sequence of actions. During each action, control signals electrically enable or disable various parts of the CPU so they can perform all or part of the desired operation. The action is then completed, typically in response to a clock pulse. Very often the results are written to an internal CPU register for quick access by subsequent instructions. In other cases results may be written to slower, but less expensive and higher capacity main memory.

For example, if an instruction that performs addition is to be executed, registers containing operands (numbers to be summed) are activated, as are the parts of the arithmetic logic unit (ALU) that perform addition. When the clock pulse occurs, the operands flow from the source registers into the ALU, and the sum appears at its output. On subsequent clock pulses, other components are enabled (and disabled) to move the output (the sum of the operation) to storage (e.g., a register or memory). If the resulting sum is too large (i.e., it is larger than the ALU's output word size), an arithmetic overflow flag will be set, influencing the next operation.

Structure and implementation

[edit]
Block diagram of a basic uniprocessor-CPU computer. Black lines indicate data flow, whereas red lines indicate control flow; arrows indicate flow directions.

Hardwired into a CPU's circuitry is a set of basic operations it can perform, called an instruction set. Such operations may involve, for example, adding or subtracting two numbers, comparing two numbers, or jumping to a different part of a program. Each instruction is represented by a unique combination of bits, known as the machine language opcode. While processing an instruction, the CPU decodes the opcode (via a binary decoder) into control signals, which orchestrate the behavior of the CPU. A complete machine language instruction consists of an opcode and, in many cases, additional bits that specify arguments for the operation (for example, the numbers to be summed in the case of an addition operation). Going up the complexity scale, a machine language program is a collection of machine language instructions that the CPU executes.

The actual mathematical operation for each instruction is performed by a combinational logic circuit within the CPU's processor known as the arithmetic–logic unit or ALU. In general, a CPU executes an instruction by fetching it from memory, using its ALU to perform an operation, and then storing the result to memory. Besides the instructions for integer mathematics and logic operations, various other machine instructions exist, such as those for loading data from memory and storing it back, branching operations, and mathematical operations on floating-point numbers performed by the CPU's floating-point unit (FPU).[69]

Control unit

[edit]

The control unit (CU) is a component of the CPU that directs the operation of the processor. It tells the computer's memory, arithmetic and logic unit and input and output devices how to respond to the instructions that have been sent to the processor.

It directs the operation of the other units by providing timing and control signals. Most computer resources are managed by the CU. It directs the flow of data between the CPU and the other devices. John von Neumann included the control unit as part of the von Neumann architecture. In modern computer designs, the control unit is typically an internal part of the CPU with its overall role and operation unchanged since its introduction.[70]

Arithmetic logic unit

[edit]
Symbolic representation of an ALU and its input and output signals

The arithmetic logic unit (ALU) is a digital circuit within the processor that performs integer arithmetic and bitwise logic operations. The inputs to the ALU are the data words to be operated on (called operands), status information from previous operations, and a code from the control unit indicating which operation to perform. Depending on the instruction being executed, the operands may come from internal CPU registers, external memory, or constants generated by the ALU itself.

When all input signals have settled and propagated through the ALU circuitry, the result of the performed operation appears at the ALU's outputs. The result consists of both a data word, which may be stored in a register or memory, and status information that is typically stored in a special, internal CPU register reserved for this purpose.

Modern CPUs typically contain more than one ALU to improve performance.

Address generation unit

[edit]

The address generation unit (AGU), sometimes also called the address computation unit (ACU),[71] is an execution unit inside the CPU that calculates addresses used by the CPU to access main memory. By having address calculations handled by separate circuitry that operates in parallel with the rest of the CPU, the number of CPU cycles required for executing various machine instructions can be reduced, bringing performance improvements.

While performing various operations, CPUs need to calculate memory addresses required for fetching data from the memory; for example, in-memory positions of array elements must be calculated before the CPU can fetch the data from actual memory locations. Those address-generation calculations involve different integer arithmetic operations, such as addition, subtraction, modulo operations, or bit shifts. Often, calculating a memory address involves more than one general-purpose machine instruction, which do not necessarily decode and execute quickly. By incorporating an AGU into a CPU design, together with introducing specialized instructions that use the AGU, various address-generation calculations can be offloaded from the rest of the CPU, and can often be executed quickly in a single CPU cycle.

Capabilities of an AGU depend on a particular CPU and its architecture. Thus, some AGUs implement and expose more address-calculation operations, while some also include more advanced specialized instructions that can operate on multiple operands at a time. Some CPU architectures include multiple AGUs so more than one address-calculation operation can be executed simultaneously, which brings further performance improvements due to the superscalar nature of advanced CPU designs. For example, Intel incorporates multiple AGUs into its Sandy Bridge and Haswell microarchitectures, which increase bandwidth of the CPU memory subsystem by allowing multiple memory-access instructions to be executed in parallel.

Memory management unit (MMU)

[edit]

Many microprocessors (in smartphones and desktop, laptop, server computers) have a memory management unit (MMU), translating logical addresses into physical RAM addresses, providing memory protection and paging abilities, useful for virtual memory. The MMU is usually integrated in the processor but in some cases it is in a separate integrated circuit (IC).[72] Simpler processors, especially microcontrollers, usually do not include an MMU.

Cache

[edit]

A CPU cache is a memory used by the central processing unit (CPU) of a computer to reduce the average cost (time or energy) to access data from the main memory.[73] A cache is a smaller, faster memory, closer to a processor core, which stores copies of the data from frequently used main memory locations. Most CPUs have different independent caches, usually organized as a hierarchy of several cache levels (L1, L2, L3, L4, etc.). Each ascending cache level is typically slower but larger than the preceding level with L1 being the fastest and the closest to the CPU. At the L1 level there are usually separate instruction and data caches.

Most modern (fast) CPUs (with few specialized exceptions[f]) have multiple levels of CPU caches. The first CPUs that used a cache had only one level of cache; unlike later level 1 caches, it was not split into L1d (for data) and L1i (for instructions). Almost all current CPUs with caches have a split L1 cache. They also have L2 caches and, for larger processors, L3 caches as well. The L2 cache is usually not split and acts as a common repository for the already split L1 cache. Every core of a multi-core processor has a dedicated L2 cache and is usually not shared between the cores. The L3 cache, and higher-level caches, are shared between the cores and are not split. An L4 cache is currently uncommon, and is generally on dynamic random-access memory (DRAM), rather than on static random-access memory (SRAM), on a separate die or chip. That was also the case historically with L1, while bigger chips have allowed integration of it and generally all cache levels, with the possible exception of the last level. Each extra level of cache tends to be bigger and is optimized differently.

Other types of caches exist (that are not counted towards the "cache size" of the most important caches mentioned above), such as the translation lookaside buffer (TLB) that is part of the memory management unit (MMU) that most CPUs have.

Caches are generally sized in powers of two: 2, 8, 16 etc. KiB or MiB (for larger non-L1) sizes, although the IBM z13 has a 96 KiB L1 instruction cache.[74]

Clock rate

[edit]

Most CPUs are synchronous circuits, which means they employ a clock signal to pace their sequential operations. The clock signal is produced by an external oscillator circuit that generates a consistent number of pulses each second in the form of a periodic square wave. The frequency of the clock pulses determines the rate at which a CPU executes instructions and, consequently, the faster the clock, the more instructions the CPU will execute each second.

To ensure proper operation of the CPU, the clock period is longer than the maximum time needed for all signals to propagate (move) through the CPU. In setting the clock period to a value well above the worst-case propagation delay, it is possible to design the entire CPU and the way it moves data around the "edges" of the rising and falling clock signal. This has the advantage of simplifying the CPU significantly, both from a design perspective and a component-count perspective. However, it also carries the disadvantage that the entire CPU must wait on its slowest elements, even though some portions of it are much faster. This limitation has largely been compensated for by various methods of increasing CPU parallelism (see below).

However, architectural improvements alone do not solve all of the drawbacks of globally synchronous CPUs. For example, a clock signal is subject to the delays of any other electrical signal. Higher clock rates in increasingly complex CPUs make it more difficult to keep the clock signal in phase (synchronized) throughout the entire unit. This has led many modern CPUs to require multiple identical clock signals to be provided to avoid delaying a single signal significantly enough to cause the CPU to malfunction. Another major issue, as clock rates increase dramatically, is the amount of heat that is dissipated by the CPU. The constantly changing clock causes many components to switch regardless of whether they are being used at that time. In general, a component that is switching uses more energy than an element in a static state. Therefore, as clock rate increases, so does energy consumption, causing the CPU to require more heat dissipation in the form of CPU cooling solutions.

One method of dealing with the switching of unneeded components is called clock gating, which involves turning off the clock signal to unneeded components (effectively disabling them). However, this is often regarded as difficult to implement and therefore does not see common usage outside of very low-power designs. One notable CPU design that uses extensive clock gating is the IBM PowerPC-based Xenon used in the Xbox 360; this reduces the power requirements of the Xbox 360.[75]

Clockless CPUs

[edit]

Another method of addressing some of the problems with a global clock signal is the removal of the clock signal altogether. While removing the global clock signal makes the design process considerably more complex in many ways, asynchronous (or clockless) designs carry marked advantages in power consumption and heat dissipation in comparison with similar synchronous designs. While somewhat uncommon, entire asynchronous CPUs have been built without using a global clock signal. Two notable examples of this are the ARM compliant AMULET and the MIPS R3000 compatible MiniMIPS.[76]

Rather than totally removing the clock signal, some CPU designs allow certain portions of the device to be asynchronous, such as using asynchronous ALUs in conjunction with superscalar pipelining to achieve some arithmetic performance gains. While it is not altogether clear whether totally asynchronous designs can perform at a comparable or better level than their synchronous counterparts, it is evident that they do at least excel in simpler math operations. This, combined with their excellent power consumption and heat dissipation properties, makes them very suitable for embedded computers.[77]

Voltage regulator module

[edit]

Many modern CPUs have a die-integrated power managing module which regulates on-demand voltage supply to the CPU circuitry allowing it to keep balance between performance and power consumption.

Integer range

[edit]

Every CPU represents numerical values in a specific way. For example, some early digital computers represented numbers as familiar decimal (base 10) numeral system values, and others have employed more unusual representations such as bi-quinary coded decimal (base 2–5) or ternary (base 3). Nearly all modern CPUs represent numbers in binary form, with each digit being represented by some two-valued physical quantity such as a "high" or "low" voltage.[g]

A six-bit word containing the binary encoded representation of decimal value 40. Most modern CPUs employ word sizes that are a power of two, for example 8, 16, 32 or 64 bits.

Related to numeric representation is the size and precision of integer numbers that a CPU can represent. In the case of a binary CPU, this is measured by the number of bits (significant digits of a binary encoded integer) that the CPU can process in one operation, which is commonly called word size, bit width, data path width, integer precision, or integer size. A CPU's integer size determines the range of integer values on which it can directly operate.[h] For example, an 8-bit CPU can directly manipulate integers represented by eight bits, which have a range of 256 (28) discrete integer values.

Integer range can also affect the number of memory locations the CPU can directly address (an address is an integer value representing a specific memory location). For example, if a binary CPU uses 32 bits to represent a memory address then it can directly address 232 memory locations. To circumvent this limitation and for various other reasons, some CPUs use mechanisms (such as memory management or bank switching) that allow additional memory to be addressed.

CPUs with larger word sizes require more circuitry and consequently are physically larger, cost more and consume more power (and therefore generate more heat). As a result, smaller 4- or 8-bit microcontrollers are commonly used in modern applications even though CPUs with much larger word sizes (such as 16, 32, 64, even 128-bit) are available. When higher performance is required, however, the benefits of a larger word size (larger data ranges and address spaces) may outweigh the disadvantages. A CPU can have internal data paths shorter than the word size to reduce size and cost. For example, even though the IBM System/360 instruction set architecture was a 32-bit instruction set, the System/360 Model 30 and Model 40 had 8-bit data paths in the arithmetic logical unit, so that a 32-bit add required four cycles, one for each 8 bits of the operands, and, even though the Motorola 68000 series instruction set was a 32-bit instruction set, the Motorola 68000 and Motorola 68010 had 16-bit data paths in the arithmetic logical unit, so that a 32-bit add required two cycles.

To gain some of the advantages afforded by both lower and higher bit lengths, many instruction sets have different bit widths for integer and floating-point data, allowing CPUs implementing that instruction set to have different bit widths for different portions of the device. For example, the IBM System/360 instruction set was primarily 32 bit, but supported 64-bit floating-point values to facilitate greater accuracy and range in floating-point numbers.[37] The System/360 Model 65 had an 8-bit adder for decimal and fixed-point binary arithmetic and a 60-bit adder for floating-point arithmetic.[78] Many later CPU designs use similar mixed bit width, especially when the processor is meant for general-purpose use where a reasonable balance of integer and floating-point capability is required.

Parallelism

[edit]
Model of a subscalar CPU, in which it takes fifteen clock cycles to complete three instructions

The description of the basic operation of a CPU offered in the previous section describes the simplest form that a CPU can take. This type of CPU, usually referred to as subscalar, operates on and executes one instruction on one or two pieces of data at a time, that is less than one instruction per clock cycle (IPC < 1).

This process gives rise to an inherent inefficiency in subscalar CPUs. Since only one instruction is executed at a time, the entire CPU must wait for that instruction to complete before proceeding to the next instruction. As a result, the subscalar CPU gets "hung up" on instructions which take more than one clock cycle to complete execution. Even adding a second execution unit (see below) does not improve performance much; rather than one pathway being hung up, now two pathways are hung up and the number of unused transistors is increased. This design, wherein the CPU's execution resources can operate on only one instruction at a time, can only possibly reach scalar performance (one instruction per clock cycle, IPC = 1). However, the performance is nearly always subscalar (less than one instruction per clock cycle, IPC < 1).

Attempts to achieve scalar and better performance have resulted in a variety of design methodologies that cause the CPU to behave less linearly and more in parallel. When referring to parallelism in CPUs, two terms are generally used to classify these design techniques:

Each methodology differs both in the ways in which they are implemented, as well as the relative effectiveness they afford in increasing the CPU's performance for an application.[i]

Instruction-level parallelism

[edit]
Basic five-stage pipeline. In the best case scenario, this pipeline can sustain a completion rate of one instruction per clock cycle.

One of the simplest methods for increased parallelism is to begin the first steps of instruction fetching and decoding before the prior instruction finishes executing. This is a technique known as instruction pipelining, and is used in almost all modern general-purpose CPUs. Pipelining allows multiple instructions to be executed at a time by breaking the execution pathway into discrete stages. This separation can be compared to an assembly line, in which an instruction is made more complete at each stage until it exits the execution pipeline and is retired.

Pipelining does, however, introduce the possibility for a situation where the result of the previous operation is needed to complete the next operation; a condition often termed data dependency conflict. Therefore, pipelined processors must check for these sorts of conditions and delay a portion of the pipeline if necessary. A pipelined processor can become very nearly scalar, inhibited only by pipeline stalls (an instruction spending more than one clock cycle in a stage).

A simple superscalar pipeline. By fetching and dispatching two instructions at a time, a maximum of two instructions per clock cycle can be completed.

Improvements in instruction pipelining led to further decreases in the idle time of CPU components. Designs that are said to be superscalar include a long instruction pipeline and multiple identical execution units, such as load–store units, arithmetic–logic units, floating-point units and address generation units.[79] In a superscalar pipeline, instructions are read and passed to a dispatcher, which decides whether or not the instructions can be executed in parallel (simultaneously). If so, they are dispatched to execution units, resulting in their simultaneous execution. In general, the number of instructions that a superscalar CPU will complete in a cycle is dependent on the number of instructions it is able to dispatch simultaneously to execution units.

Most of the difficulty in the design of a superscalar CPU architecture lies in creating an effective dispatcher. The dispatcher needs to be able to quickly determine whether instructions can be executed in parallel, as well as dispatch them in such a way as to keep as many execution units busy as possible. This requires that the instruction pipeline is filled as often as possible and requires significant amounts of CPU cache. It also makes hazard-avoiding techniques like branch prediction, speculative execution, register renaming, out-of-order execution and transactional memory crucial to maintaining high levels of performance. By attempting to predict which branch (or path) a conditional instruction will take, the CPU can minimize the number of times that the entire pipeline must wait until a conditional instruction is completed. Speculative execution often provides modest performance increases by executing portions of code that may not be needed after a conditional operation completes. Out-of-order execution somewhat rearranges the order in which instructions are executed to reduce delays due to data dependencies. Also in case of single instruction stream, multiple data stream, a case when a lot of data from the same type has to be processed, modern processors can disable parts of the pipeline so that when a single instruction is executed many times, the CPU skips the fetch and decode phases and thus greatly increases performance on certain occasions, especially in highly monotonous program engines such as video creation software and photo processing.

When a fraction of the CPU is superscalar, the part that is not suffers a performance penalty due to scheduling stalls. The Intel P5 Pentium had two superscalar ALUs which could accept one instruction per clock cycle each, but its FPU could not. Thus the P5 was integer superscalar but not floating point superscalar. Intel's successor to the P5 architecture, P6, added superscalar abilities to its floating-point features.

Simple pipelining and superscalar design increase a CPU's ILP by allowing it to execute instructions at rates surpassing one instruction per clock cycle. Most modern CPU designs are at least somewhat superscalar, and nearly all general purpose CPUs designed in the last decade are superscalar. In later years some of the emphasis in designing high-ILP computers has been moved out of the CPU's hardware and into its software interface, or instruction set architecture (ISA). The strategy of the very long instruction word (VLIW) causes some ILP to become implied directly by the software, reducing the CPU's work in boosting ILP and thereby reducing design complexity.

Task-level parallelism

[edit]

Another strategy of achieving performance is to execute multiple threads or processes in parallel. This area of research is known as parallel computing.[80] In Flynn's taxonomy, this strategy is known as multiple instruction stream, multiple data stream (MIMD).[81]

One technology used for this purpose is multiprocessing (MP).[82] The initial type of this technology is known as symmetric multiprocessing (SMP), where a small number of CPUs share a coherent view of their memory system. In this scheme, each CPU has additional hardware to maintain a constantly up-to-date view of memory. By avoiding stale views of memory, the CPUs can cooperate on the same program and programs can migrate from one CPU to another. To increase the number of cooperating CPUs beyond a handful, schemes such as non-uniform memory access (NUMA) and directory-based coherence protocols were introduced in the 1990s. SMP systems are limited to a small number of CPUs while NUMA systems have been built with thousands of processors. Initially, multiprocessing was built using multiple discrete CPUs and boards to implement the interconnect between the processors. When the processors and their interconnect are all implemented on a single chip, the technology is known as chip-level multiprocessing (CMP) and the single chip as a multi-core processor.

It was later recognized that finer-grain parallelism existed with a single program. A single program might have several threads (or functions) that could be executed separately or in parallel. Some of the earliest examples of this technology implemented input/output processing such as direct memory access as a separate thread from the computation thread. A more general approach to this technology was introduced in the 1970s when systems were designed to run multiple computation threads in parallel. This technology is known as multi-threading (MT). The approach is considered more cost-effective than multiprocessing, as only a small number of components within a CPU are replicated to support MT as opposed to the entire CPU in the case of MP. In MT, the execution units and the memory system including the caches are shared among multiple threads. The downside of MT is that the hardware support for multithreading is more visible to software than that of MP and thus supervisor software like operating systems have to undergo larger changes to support MT. One type of MT that was implemented is known as temporal multithreading, where one thread is executed until it is stalled waiting for data to return from external memory. In this scheme, the CPU would then quickly context switch to another thread which is ready to run, the switch often done in one CPU clock cycle, such as the UltraSPARC T1. Another type of MT is simultaneous multithreading, where instructions from multiple threads are executed in parallel within one CPU clock cycle.

For several decades from the 1970s to early 2000s, the focus in designing high performance general purpose CPUs was largely on achieving high ILP through technologies such as pipelining, caches, superscalar execution, out-of-order execution, etc. This trend culminated in large, power-hungry CPUs such as the Intel Pentium 4. By the early 2000s, CPU designers were thwarted from achieving higher performance from ILP techniques due to the growing disparity between CPU operating frequencies and main memory operating frequencies as well as escalating CPU power dissipation owing to more esoteric ILP techniques.

CPU designers then borrowed ideas from commercial computing markets such as transaction processing, where the aggregate performance of multiple programs, also known as throughput computing, was more important than the performance of a single thread or process.

This reversal of emphasis is evidenced by the proliferation of dual and more core processor designs and notably, Intel's newer designs resembling its less superscalar P6 architecture. Late designs in several processor families feature chip-level multiprocessing, including the x86-64 Opteron and Athlon 64 X2, the SPARC UltraSPARC T1, IBM POWER4 and POWER5, as well as several video game console CPUs like the Xbox 360's triple-core PowerPC design, and the PlayStation 3's 7-core Cell microprocessor.

Data parallelism

[edit]

A less common but increasingly important paradigm of processors (and indeed, computing in general) deals with data parallelism. The processors discussed earlier are all referred to as some type of scalar device.[j] As the name implies, vector processors deal with multiple pieces of data in the context of one instruction. This contrasts with scalar processors, which deal with one piece of data for every instruction. Using Flynn's taxonomy, these two schemes of dealing with data are generally referred to as single instruction stream, multiple data stream (SIMD) and single instruction stream, single data stream (SISD), respectively. The great utility in creating processors that deal with vectors of data lies in optimizing tasks that tend to require the same operation (for example, a sum or a dot product) to be performed on a large set of data. Some classic examples of these types of tasks include multimedia applications (images, video and sound), as well as many types of scientific and engineering tasks. Whereas a scalar processor must complete the entire process of fetching, decoding and executing each instruction and value in a set of data, a vector processor can perform a single operation on a comparatively large set of data with one instruction. This is only possible when the application tends to require many steps which apply one operation to a large set of data.

Most early vector processors, such as the Cray-1, were associated almost exclusively with scientific research and cryptography applications. However, as multimedia has largely shifted to digital media, the need for some form of SIMD in general-purpose processors has become significant. Shortly after inclusion of floating-point units started to become commonplace in general-purpose processors, specifications for and implementations of SIMD execution units also began to appear for general-purpose processors in the mid-1990s. Some of these early SIMD specifications – like HP's Multimedia Acceleration eXtensions (MAX) and Intel's MMX – were integer-only. This proved to be a significant impediment for some software developers, since many of the applications that benefit from SIMD primarily deal with floating-point numbers. Progressively, developers refined and remade these early designs into some of the common modern SIMD specifications, which are usually associated with one instruction set architecture (ISA). Some notable modern examples include Intel's Streaming SIMD Extensions (SSE) and the PowerPC-related AltiVec (also known as VMX).[k]

Hardware performance counter

[edit]

Many modern architectures (including embedded ones) often include hardware performance counters (HPC), which enables low-level (instruction-level) collection, benchmarking, debugging or analysis of running software metrics.[83][84] HPC may also be used to discover and analyze unusual or suspicious activity of the software, such as return-oriented programming (ROP) or sigreturn-oriented programming (SROP) exploits etc.[85] This is usually done by software-security teams to assess and find malicious binary programs.[86]

Many major vendors (such as IBM, Intel, AMD, and Arm) provide software interfaces (usually written in C/C++) that can be used to collect data from the CPU's registers in order to get metrics.[87] Operating system vendors also provide software like perf (Linux) to record, benchmark, or trace CPU events running kernels and applications.

Hardware counters provide a low-overhead method for collecting comprehensive performance metrics related to a CPU's core elements (functional units, caches, main memory, etc.) – a significant advantage over software profilers.[88] Additionally, they generally eliminate the need to modify the underlying source code of a program.[89] Because hardware designs differ between architectures, the specific types and interpretations of hardware counters will also change.

Privileged modes

[edit]

Most modern CPUs have privileged modes to support operating systems and virtualization.

Cloud computing can use virtualization to provide a virtual central processing unit[90] (vCPU) for separate users;[91] vCPU is not to be confused with a virtual private server (VPS).

A host is the virtual equivalent of a physical machine, on which a virtual system is operating.[92] When there are several physical machines operating in tandem and managed as a whole, the grouped computing and memory resources form a cluster. In some systems, it is possible to dynamically add and remove from a cluster. Resources available at a host and cluster level can be partitioned into resources pools with fine granularity.

Performance

[edit]

The performance or speed of a processor depends on, among many other factors, the clock rate (generally given in multiples of hertz) and the instructions per clock (IPC), which together are the factors for the instructions per second (IPS) that the CPU can perform.[93] Many reported IPS values have represented "peak" execution rates on artificial instruction sequences with few branches, whereas realistic workloads consist of a mix of instructions and applications, some of which take longer to execute than others. The performance of the memory hierarchy also greatly affects processor performance, an issue barely considered in IPS calculations. Because of these problems, various standardized tests, often called "benchmarks" for this purpose – such as SPECint – have been developed to attempt to measure the real effective performance in commonly used applications.

Processing performance of computers is increased by using multi-core processors, which essentially is plugging two or more individual processors (called cores in this sense) into one integrated circuit.[94] Ideally, a dual core processor would be nearly twice as powerful as a single core processor. In practice, the performance gain is far smaller, only about 50%, due to imperfect software algorithms and implementation.[95] Increasing the number of cores in a processor (i.e. dual-core, quad-core, etc.) increases the workload that can be handled. This means that the processor can now handle numerous asynchronous events, interrupts, etc. which can take a toll on the CPU when overwhelmed. These cores can be thought of as different floors in a processing plant, with each floor handling a different task. Sometimes, these cores will handle the same tasks as cores adjacent to them if a single core is not enough to handle the information. Multi-core CPUs enhance a computer's ability to run several tasks simultaneously by providing additional processing power. However, the increase in speed is not directly proportional to the number of cores added. This is because the cores need to interact through specific channels, and this inter-core communication consumes a portion of the available processing speed.[96]

Due to specific capabilities of modern CPUs, such as simultaneous multithreading and uncore, which involve sharing of actual CPU resources while aiming at increased utilization, monitoring performance levels and hardware use gradually became a more complex task.[97] As a response, some CPUs implement additional hardware logic that monitors actual use of various parts of a CPU and provides various counters accessible to software; an example is Intel's Performance Counter Monitor technology.[9]

Overclocking

[edit]
Nvidia-Asus Tuf GPUs that have OG (original) and OC (overclockable) on them

Overclocking is a process of increasing the clock speed of a CPU (and other components) beyond their rated speeds. Increasing a component's clock rate causes it to perform more operations per second.[98] Overclocking might increase CPU temperature and cause it to overheat, so most users do not overclock and leave the clock speed unchanged. Some versions of components (such as Intel's U version of its CPUs or Nvidia's OG GPUs) do not allow overclocking.

See also

[edit]

Notes

[edit]

References

[edit]
[edit]
Revisions and contributorsEdit on WikipediaRead on Wikipedia
from Grokipedia
A central processing unit (CPU), also known as a processor or , is the primary electronic circuitry in a computer system responsible for executing instructions from programs by performing arithmetic, logical, control, and operations. Often referred to as the "" of the computer, the CPU interprets and processes from , enabling all computational tasks such as calculations, data comparisons, and task coordination. In modern systems, CPUs are typically implemented as integrated circuits on a single chip, containing billions of transistors that allow for high-speed operation measured in gigahertz (GHz). The core architecture of a CPU consists of three main components: the arithmetic logic unit (ALU), the control unit (CU), and registers. The ALU performs basic arithmetic operations like addition and subtraction, as well as logical operations such as comparisons (e.g., greater-than or equal-to). The control unit directs the flow of data and instructions by fetching them from , decoding them, and coordinating execution with other hardware components. Registers serve as high-speed temporary storage locations within the CPU for holding instructions, addresses, and intermediate results during processing. This , which separates processing from , underpins most general-purpose computers today. The concept of a CPU traces its origins to 19th-century mechanical designs, such as Charles Babbage's , which proposed a "mill" for computation controlled by punched cards and supported by a store. Theoretical foundations were advanced by Alan Turing's 1936 , which formalized the stored-program concept essential to modern CPUs. The first electronic stored-program computer, the Manchester "Baby" in 1948, demonstrated practical implementation, evolving from vacuum tube-based systems to integrated circuits. A pivotal milestone occurred in 1971 with the , the first commercially available single-chip featuring 2,300 s and capable of 92,000 instructions per second. Subsequent generations introduced multi-core designs, 64-bit processing, and increased densities, enabling contemporary CPUs to handle complex multitasking in devices from smartphones to supercomputers.

Overview

Definition and function

A central processing unit (CPU), often simply called a processor, is the primary electronic circuitry in a computer that executes instructions from programs by performing the fundamental fetch-decode-execute cycle, thereby transforming input data into output results. This process enables the CPU to serve as the "brain" of the system, managing computations and coordinating overall operations. The CPU's core functions encompass arithmetic operations, such as addition, subtraction, multiplication, and division, handled by dedicated hardware; logical decisions, including comparisons, AND/OR/NOT operations, and bitwise manipulations; data movement, which involves transferring information between internal registers, cache, and ; and management, such as jumping to conditional branches or looping through sequences of instructions to direct program execution. These functions collectively allow the CPU to process complex tasks efficiently, from simple calculations to orchestrating multitasking environments. The CPU interacts closely with system to fetch instructions and operands, relying on high-speed caches and registers for quick access, while communicating with (I/O) devices—such as keyboards, displays, and storage drives—through standardized buses that transmit address signals (to locate ), signals (to carry information), and control signals (to synchronize operations). This bus-mediated connectivity ensures seamless flow across the computer system, preventing bottlenecks in instruction processing. The term "central processing unit" and its underlying concept trace their origins to the , first articulated in John von Neumann's 1945 "First Draft of a Report on the ," which proposed a stored-program design featuring a for arithmetic and control functions separate from and I/O. In a von Neumann machine, the CPU occupies a central position, linked bidirectionally to main for program and data storage, and to peripheral I/O devices, all interconnected via shared buses as depicted in this simplified :

+----------------+ Buses (Address, [Data](/page/Data), Control) +----------------+ | | <---------------------------------------> | | | CPU | | Main Memory | | | | (RAM/Storage) | +----------------+ +----------------+ ^ ^ +----------------+ +----------------+ | I/O | | Secondary | | Devices | | Storage | | (e.g., Keyboard,| | (e.g., Disk) | | Display) | +----------------+ +----------------+

+----------------+ Buses (Address, [Data](/page/Data), Control) +----------------+ | | <---------------------------------------> | | | CPU | | Main Memory | | | | (RAM/Storage) | +----------------+ +----------------+ ^ ^ +----------------+ +----------------+ | I/O | | Secondary | | Devices | | Storage | | (e.g., Keyboard,| | (e.g., Disk) | | Display) | +----------------+ +----------------+

This architecture underscores the CPU's role in sequentially processing instructions while accessing shared resources.

Types and classifications

Central processing units (CPUs) are classified by their (ISA), which defines the set of instructions available to programmers and influences performance, power efficiency, and complexity. Complex Instruction Set Computing (CISC) architectures, such as x86 used in many desktop and server processors, feature a large number of instructions that can perform multiple operations in a single command, allowing for more compact code but requiring more complex hardware to decode and execute them. In contrast, Reduced Instruction Set Computing (RISC) architectures, exemplified by in mobile and embedded systems, employ a smaller set of simpler, fixed-length instructions that execute in fewer clock cycles, promoting pipelining efficiency and lower power consumption at the cost of potentially longer code sequences. This dichotomy emerged in the to balance software density against hardware simplicity. CPUs are further categorized by their level of integration, reflecting how elements are packaged for different applications. Discrete CPUs consist of standalone processor chips that interface with separate and peripheral components via external buses, commonly found in early personal computers and high-performance servers for modularity and upgradability. integrate the full CPU functionality onto a single , enabling compact designs since the 1970s and dominating general-purpose computing. Embedded processors adapt microprocessor designs for resource-limited environments like appliances and automotive systems, prioritizing low power and real-time performance over raw speed. System-on-chip (SoC) variants extend this by combining the CPU core with , interfaces, and accelerators on one die, optimizing for mobile devices and IoT where space and efficiency are critical. Special-purpose classifications address CPUs tailored for domain-specific tasks beyond general computing. Digital signal processors (DSPs) incorporate hardware optimized for mathematical operations on signals, such as multiply-accumulate instructions for audio and image processing, achieving higher throughput than general CPUs for repetitive numerical workloads. Graphics processing units (GPUs), often serving as co-processors, feature thousands of simpler cores for parallel computations, excelling in vectorized tasks like rendering and but relying on a host CPU for orchestration. Application-specific integrated circuits () customize CPU-like logic for singular functions, such as cryptocurrency mining, offering superior efficiency and speed for fixed algorithms at the expense of flexibility. These variants complement general-purpose CPUs in heterogeneous systems to handle specialized workloads. The evolution from single-core to multi-core and many-core designs has transformed CPU scalability to exploit parallelism amid from clock speed increases. Single-core processors dominated until the mid-2000s, limited by power walls and heat dissipation, prompting the shift to multi-core architectures where multiple processing units share resources to boost throughput for threaded applications. Homogeneous multi-core systems employ identical cores for uniform task distribution, as in most consumer CPUs, ensuring balanced performance but underutilizing specialized needs. Heterogeneous designs integrate diverse cores—such as high-performance and energy-efficient ones—on the same chip, adapting dynamically to workloads like for better overall efficiency. Many-core processors, with dozens or hundreds of cores, extend this for data-center and AI applications, emphasizing massive parallelism over per-core complexity. Classification metrics often revolve around ISA levels and microarchitecture, providing a framework to evaluate design trade-offs. The ISA level specifies the abstract interface, including opcodes, registers, and addressing modes, which remains stable across implementations to ensure software compatibility. Microarchitecture, the internal realization of the ISA, varies implementations like out-of-order execution or branch prediction to optimize for speed, power, or area, allowing the same ISA (e.g., x86) to support diverse hardware generations. These layers enable abstraction, where ISA defines "what" instructions do, while microarchitecture handles "how" they execute efficiently.

Historical development

Early computational devices

The development of early computational devices laid the foundational concepts for modern central processing units (CPUs) by introducing mechanical, electromechanical, and early electronic mechanisms for performing calculations and controlling operations. In 1837, conceived the , a mechanical general-purpose computer designed to execute programmable instructions using punched cards for input and control. This device featured a "mill" analogous to an (ALU) for performing operations and a "store" for holding data and instructions, representing an early conceptual stored-program system, though it was never fully built due to technological limitations of the era. Advancing to electromechanical designs, completed the Z3 in 1941, recognized as the first functional, freely programmable digital computer based on binary logic and using approximately 2,300 electromechanical relays for switching operations. The Z3 employed binary arithmetic to perform floating-point calculations and was programmed via punched film tape, enabling it to solve complex engineering problems like aerodynamic simulations, but its relay-based architecture limited speed and reliability compared to later electronic systems. The vacuum tube era marked a shift to electronic computing, exemplified by the ENIAC (Electronic Numerical Integrator and Computer), completed in 1945 as the first general-purpose electronic digital computer, utilizing 18,000 vacuum tubes for high-speed arithmetic and logic functions. Programming ENIAC required manual reconfiguration through plugboards and switches rather than stored instructions, allowing it to perform 5,000 additions per second but occupying 1,800 square feet, consuming 150 kilowatts of power, and suffering frequent tube failures that reduced reliability. Building on these efforts, the EDSAC (Electronic Delay Storage Automatic Calculator) ran its first program in May 1949 at the University of Cambridge, introducing practical stored-program execution where instructions and data resided in the same mercury delay-line memory, facilitated by an initial orders assembler for symbolic programming. A pivotal concept emerged in John von Neumann's 1945 report on the , articulating the stored-program principle where programs and data are stored interchangeably in high-speed memory using binary representation, enabling flexible computation and . Binary arithmetic, as implemented in devices like the Z3 and , provided an efficient basis for digital logic by representing numbers with two states (0 and 1), contrasting earlier decimal systems. These early machines, however, were hampered by enormous size, excessive power demands, heat generation, and low reliability—such as vacuum tubes burning out every few hours—necessitating the eventual transition to more efficient technology.

Transistor and integrated circuit eras

The invention of the in 1947 at Bell Laboratories marked a pivotal shift from vacuum tubes to semiconductor-based electronics in computing. On December 16, 1947, physicists and Walter Brattain demonstrated the first using , achieving current amplification without the fragility and heat issues of vacuum tubes. , their colleague, refined this into the more practical junction transistor by early 1948, enabling the creation of smaller, more reliable logic gates essential for digital circuits. This breakthrough dramatically reduced the size, power consumption, and failure rates of computational components, paving the way for transistorized computers that outperformed their vacuum-tube predecessors in reliability and efficiency. The first transistorized computers emerged in the mid-1950s, replacing discrete vacuum tubes with individual s for logic functions. In 1954, Bell Laboratories completed (Transistor Digital Computer) under a U.S. contract, becoming the world's first fully transistorized computer with approximately 700 point-contact transistors and over 10,000 diodes handling airborne tasks. This system demonstrated transistors' viability for real-time applications, operating at speeds up to 1 MHz while consuming far less power than tube-based machines. By 1959, introduced the 7090, a large-scale scientific computer using approximately 50,000 discrete transistors for its core logic, marking one of the earliest commercial successes of transistor technology in . These machines highlighted transistors' ability to enable faster clock rates—such as 1 MHz for and approximately 0.46 MHz for the 7090—and modular designs, influencing subsequent CPU architectures. A major advancement came with the (IC), which combined multiple and components on a single chip, further miniaturizing CPU designs. In September 1958, at fabricated the first IC prototype—a germanium chip integrating a , resistors, and capacitors—demonstrating monolithic construction that eliminated discrete wiring and reduced costs. In 1959, at developed the planar process, using passivation and to create stable, mass-producible ICs on a flat surface, which improved yield and scalability. These innovations slashed component counts, enabling denser logic integration and lower manufacturing expenses, fundamentally transforming CPU fabrication from hand-wired assemblies to automated processes. The 1960s saw the rise of small-scale integration (SSI), where ICs packed 10 to 100 transistors per chip, allowing CPUs to incorporate multiple logic functions without relying on discrete components. This era's computers, such as the 1966 Apollo Guidance Computer (AGC) developed by MIT and for , utilized around 5,600 SSI ICs to achieve compact, radiation-hardened processing for navigation. The AGC's design, with its 16-bit word length and 2.048 MHz clock, exemplified SSI's impact by fitting essential arithmetic and control logic into a 70-pound unit, far smaller than equivalent vacuum-tube systems. By the 1970s, medium-scale integration (MSI) with 100 to 1,000 transistors per chip and large-scale integration (LSI) exceeding 1,000 transistors enabled even greater density, supporting complex CPU subsystems on fewer chips. MSI/LSI chips facilitated preliminary CPU designs, such as custom logic arrays for calculators that prefigured the Intel 4004, by integrating registers, ALUs, and control units to boost performance while cutting assembly costs. These advancements increased transistor counts to thousands per system, allowing clock speeds to reach several MHz and laying the groundwork for fully integrated processors.

Microprocessor introduction

The advent of the marked a pivotal shift in by integrating the central processing unit (CPU) onto a single chip, enabling compact, affordable, and versatile computational devices. The first commercially available , the , was developed in 1971 by a team led by Ted Hoff and at Intel Corporation, initially designed for the 141-PF calculator. This 4-bit processor contained approximately 2,300 transistors and operated at a clock speed of 740 kHz, performing basic arithmetic and logic operations while interfacing with custom chips for a specific application. By consolidating CPU functions into one , the 4004 reduced manufacturing complexity and costs compared to earlier multi-chip designs, laying the groundwork for programmable general-purpose . Subsequent developments rapidly expanded microprocessor capabilities and applications. In 1972, Intel introduced the 8008, the world's first 8-bit programmable with around 3,500 transistors, targeted at embedded control systems like the Computer Terminal Corporation's Datapoint 2200. This was followed by the more powerful in 1974, featuring improved instruction sets and higher performance, which powered the MITS —the first commercially successful kit released in 1975 and instrumental in sparking the home computing revolution. Advancing to 16-bit architectures, the debuted in 1978 as the foundation of the x86 , enabling broader memory addressing and compatibility that persists in modern processors. Concurrently, Motorola's 68000, introduced in 1979, offered a 16/32-bit design with 68,000 transistors and was selected for Apple's Macintosh computer in 1984, influencing and personal systems. These innovations profoundly democratized by transitioning from bespoke, expensive custom logic circuits to standardized, programmable instruction set architectures (ISAs), drastically lowering costs and enabling widespread adoption in personal computers, embedded devices, and . The microprocessor's rise facilitated the personal boom of the and , making powerful accessible beyond mainframes and minicomputers to hobbyists, businesses, and eventually households. This accessibility was amplified by , Gordon E. Moore's 1965 observation that the number of transistors on an would roughly double every year (later revised to every two years), driving exponential improvements in performance and density that sustained the proliferation of microprocessors. Overall, microprocessors transformed from a specialized enterprise tool into a ubiquitous technology, powering diverse applications from desktop PCs to microcontrollers in appliances.

Instruction processing

Fetch phase

The fetch phase initiates the instruction cycle in a central processing unit (CPU) by retrieving the next instruction from , setting the stage for subsequent processing stages. This phase assumes that a program has been loaded into and relies on the (PC), a dedicated register that stores the of the forthcoming instruction. The PC, as one of the CPU's essential registers, ensures sequential execution by pointing to the correct location in . In the fetch process, the CPU transmits the address held in the PC over the address bus to the system, while simultaneously sending a read signal via the to request the . The targeted —typically the instruction cache in modern designs or main RAM if the cache misses—responds by placing the instruction onto the data bus, allowing the CPU to load it into the (IR). Following the transfer, the PC increments by the length of the fetched instruction, usually , to prepare for the next cycle. This interaction with the memory interface minimizes latency through cache hierarchies, where faster on-chip caches serve most fetches to avoid slower main access. To enhance efficiency in pipelined processors, the fetch phase often incorporates instruction prefetching, where the CPU anticipates and retrieves multiple sequential instructions ahead of time, buffering them to sustain pipeline flow and mask . Data integrity during fetching is maintained via mechanisms, such as parity bits for basic checks or error-correcting codes (ECC) that identify and repair single-bit errors in retrieved instructions from or cache. In pipelined systems, ECC processing may introduce minor delays, but it ensures reliable operation by correcting errors on-the-fly without halting the fetch entirely. As an illustrative example in a basic , the fetch phase loads the complete instruction—including the and any immediate operands—directly into the IR from a unified space shared with data. The output of this phase, the raw instruction in the IR, directly feeds into the subsequent decode phase for interpretation.

Decode phase

In the decode phase of the CPU's instruction processing cycle, the retrieves the instruction from the (IR) and analyzes its binary encoding to determine the intended operation and required resources. The portion of the instruction, typically the leading bits, is decoded to identify the specific command, such as addition, branching, or load/store, enabling the generation of control signals that configure the processor's and activate relevant hardware units like the (ALU) or registers. This process ensures the CPU understands the semantics of the instruction before proceeding to execution. Operand handling occurs concurrently during decoding, where the CPU parses the remaining bits of the instruction to classify operands as immediate values (constants embedded directly in the instruction), register identifiers (specifying sources or destinations in the register file), or memory references (requiring address computation). For memory-based operands, the decode stage calculates the effective address using specified addressing modes, such as register indirect or displacement, by combining base registers, offsets, and immediates as dictated by the instruction format. Register operands are read from the register file in this stage to prepare data for subsequent operations, while immediate values are sign-extended if necessary to match the processor's word size. In Complex Instruction Set Computing (CISC) architectures, such as x86, the decode phase often employs to handle the complexity of variable-length, multifaceted instructions. The indexes into a microcode control store, which translates the macro-instruction into a sequence of primitive micro-operations (micro-ops) that simpler hardware can execute, effectively breaking down operations like string manipulation or into ALU accesses, shifts, and conditional branches. This microcode-driven approach allows CISC processors to support a rich instruction set without exponentially increasing in the decoder. Pipelined CPUs integrate detection into the decode stage to maintain throughput by identifying potential s early. hazards, particularly read-after-write (RAW) dependencies where an instruction requires results from a prior uncompleted instruction, are detected by comparing source register specifiers in the current instruction with destination registers in stages ahead. Upon detection, the controller may the fetch and decode stages by inserting bubbles (no-operation cycles) or enable forwarding from later registers to the dependency without delay. Control hazards from es are also evaluated here, with the target computed and logic consulted to decide whether to continue sequential fetching. The decode phase culminates in the emission of control signals that set up the execute stage, directing data routing between registers, the ALU, and interfaces while specifying operation types (e.g., add, compare) and write-back destinations. These signals, generated by hardwired logic in Reduced Instruction Set Computing (RISC) designs or via in CISC, ensure precise orchestration of resources without performing any arithmetic or access. The control unit's role in producing these signals is fundamental to seamless instruction flow.

Execute phase

In the execute phase, the CPU performs the operation indicated by the decoded instruction, utilizing its functional units to process data and update system state. The arithmetic logic unit (ALU) executes arithmetic operations, such as addition or subtraction, and logical operations, such as AND, OR, or bitwise shifts, on operands sourced from registers. The results of these computations are stored in designated registers or written to memory locations, completing the data processing for the instruction. For instructions like , the execute phase evaluates status flags—such as zero (Z), carry (C), overflow (V), and negative (N)—generated from prior ALU operations to determine the next execution path. If a conditional branch condition is satisfied, the (PC) is loaded with the target address; otherwise, the PC increments by the instruction length, typically 4 bytes in 32-bit architectures, to advance to the sequential next instruction. Input/output (I/O) instructions during this phase facilitate data transfer between CPU registers and peripheral devices, often through port-mapped I/O or memory-mapped I/O mechanisms, enabling communication with external hardware like keyboards or displays. At the conclusion of the execute phase, the PC is finalized to address the subsequent instruction, and updated status flags are stored in the flags register to influence future conditional operations. For instance, in an ADD instruction adding the contents of two source registers (e.g., R1 and R2), the ALU computes the sum, writes it to the destination register (e.g., R0), and sets flags like the if the result equals zero or the if an overflow occurs during .

Core components

Control unit

The (CU) is a fundamental component of the central processing unit (CPU) that directs the processor's operations by generating timing and control signals to coordinate the fetch-decode-execute cycle. It interprets instructions fetched from , decodes their requirements, and orchestrates the necessary actions across the CPU's subsystems to ensure orderly execution of . By acting as the processor's conductor, the CU manages data flow between components without performing computations itself, enabling the CPU to complex sequences of operations efficiently. Control units are designed in two main architectures: hardwired and microprogrammed. Hardwired control employs circuits and finite state machines to produce control signals directly from the instruction opcode and current state, providing rapid response times since signals are generated without accesses, though modifications require hardware redesigns. Microprogrammed control, conversely, stores sequences of microinstructions in a dedicated control (typically ROM), where a sequencer fetches and executes these microinstructions to generate signals; this method offers flexibility for implementing intricate instruction sets and facilitating emulation or updates via , albeit with performance overhead from the microinstruction fetch cycle. Key functions of the include , handling, and sequencing logic. It leverages the CPU's system clock to produce synchronized timing pulses, ensuring that fetch, decode, and execute phases occur in across components during each machine cycle. For handling, the CU detects incoming requests from peripherals or software, suspends the current instruction stream by saving state in registers, and redirects execution to a handler routine before resuming normal operation upon completion. Sequencing logic, implemented via state machines in hardwired designs or sequencers in microprogrammed ones, determines the progression of control signals based on instruction type, processor flags, and prior outcomes, maintaining the integrity of the instruction pipeline. The evolution of control units reflects advancements in processor complexity, progressing from rudimentary state machines in early von Neumann architectures that handled basic sequential instructions to sophisticated schedulers in modern superscalar designs. These advanced units manage dynamic instruction dispatching and resource arbitration to support and , significantly enhancing throughput in environments. The interacts seamlessly with other CPU elements by issuing enable signals to the ALU for operation selection, controlling access for data loading and storage, and driving and control buses for external and I/O coordination. These signals are essential in the decode phase to interpret opcodes and route resources accordingly.

Arithmetic logic unit

The arithmetic logic unit (ALU) is the computational core of a central processing unit (CPU) responsible for performing arithmetic and logical operations on data. It processes binary inputs from registers or memory, executing functions such as addition, subtraction, and bitwise manipulations to produce results that are stored back or used for further computations. The ALU receives two operands, typically denoted as A and B, and applies a selected operation (op) to generate an output result, expressed fundamentally as result=AB\text{result} = A \oplus B, where \oplus represents the decoded function. This unit forms the basis for all numerical and logical processing in the CPU, enabling everything from simple calculations to complex algorithm execution. Key components of the ALU include adders for arithmetic summation, shifters for bit manipulation, and logic gates such as AND, OR, and XOR for bitwise operations. Adders, often implemented as full adders, handle carry propagation across bits, while shifters perform left or right shifts to multiply or divide by powers of two. A flag register, or status register, accompanies these components to store condition flags like zero (indicating a result of all zeros), carry (from the most significant bit), overflow (for signed arithmetic exceeding representable range), and sign (the most significant bit of the result). These flags support conditional branching and error detection in program flow. The ALU supports a range of operations, including integer arithmetic such as addition, subtraction, multiplication, and division, as well as bitwise logic (AND, OR, XOR) and comparisons (equality, greater than, less than). Subtraction is typically implemented by inverting one operand and adding one, using two's complement representation for signed integers. Comparisons generate flags without storing the full result, often by performing subtraction and checking the zero or sign flags. Floating-point operations, requiring higher precision and specialized handling, are generally delegated to a separate floating-point unit (FPU), though some designs integrate basic extensions into the ALU. ALU design primarily employs for instantaneous operation selection via multiplexers, contrasting with used in pipelined or state-dependent extensions. To accelerate , carry-lookahead adders (CLAs) precompute carry bits using generate (Gi=AiBiG_i = A_i B_i) and propagate (Pi=AiBiP_i = A_i \oplus B_i) signals, allowing parallel carry generation across bits rather than sequential ripple propagation. This reduces delay in wide ALUs, where the carry-out for bit ii is Ci=Gi+PiCi1C_i = G_i + P_i C_{i-1}. Data width varies from 8-bit in early microprocessors to 64-bit or more in modern CPUs, matching the processor's word size for efficient handling of large integers; for example, 64-bit ALUs support operations on operands up to 26412^{64} - 1 in unsigned form. Control signals from the CPU's dictate the operation, ensuring the ALU executes the appropriate function on demand.

Registers and addressing units

The register file serves as a small, high-speed array of storage locations integrated into the central processing unit (CPU), designed to hold operands and intermediate results during instruction execution. It consists primarily of general-purpose registers (GPRs), which are versatile storage units accessible by most instructions for data manipulation, and special-purpose registers dedicated to system functions. In the ARMv8-A architecture's AArch64 execution state, there are 31 GPRs (X0 through X30), each 64 bits wide, providing flexible temporary storage for operands in data-processing operations. Similarly, the x86-64 architecture defines 16 GPRs (RAX, RBX, RCX, RDX, RSI, RDI, RBP, RSP, and R8 through R15), each also 64 bits, enabling efficient handling of integer and pointer operations in 64-bit environments. Special registers include the program counter (PC), which stores the memory address of the next instruction to fetch; the stack pointer (SP), which maintains the address of the top of the call stack for managing subroutine calls, returns, and local variables; and the instruction register (IR), a temporary holding area for the currently fetched and decoded instruction within the pipeline. In ARMv8-A, the SP is a dedicated 64-bit register (often aliased with X31 in certain contexts), while the PC operates as a special register not directly writable like GPRs, and the IR is internal to the decode stage. Addressing modes determine how instructions specify the location of , enabling flexible access to in registers, immediate values, or without requiring separate address-calculation instructions. Common modes include immediate addressing, where the operand value is embedded directly in the instruction word; direct addressing, using an absolute specified in the instruction; indirect addressing, where a register holds the of the operand; and indexed addressing, which adds an offset (immediate or from another register) to a base register to compute the effective address. These computations are performed using dedicated circuits within the CPU, allowing efficient operand location during the decode and execute phases; for instance, in architectures, load/store instructions support offset, pre-indexed, and post-indexed modes that leverage register-based indexing for array access or stack operations. The (AGU) is specialized hardware that accelerates these calculations by computing effective addresses in parallel, often as a separate stage or port to reduce latency in access instructions. In x86 processors, the AGU handles complex addressing like base-plus-index-plus-scale for vectorized access, integrating seamlessly with load/store units to minimize dependencies on the . Within the CPU pipeline, the plays a critical role in managing data flow and resolving hazards, particularly through techniques like to eliminate false dependencies. dynamically maps architectural registers (visible to software) to a larger pool of physical registers, preventing write-after-read (WAR) and write-after-write (WAW) hazards by allowing without stalling for register availability. This approach, common in superscalar processors, expands the effective register capacity beyond the architectural limit—such as providing 128 or more physical registers in modern designs to support dozens of in-flight instructions—while the core remains compact. The PC register, for example, increments automatically after each fetch to point to the subsequent instruction address. Overall, the offers limited on-chip storage, typically 128 to 512 bytes for GPRs and specials in baseline configurations (e.g., 16 × 64-bit GPRs in yield 128 bytes), in stark contrast to the gigabytes available in off-chip main memory, prioritizing speed over capacity to sustain high instruction throughput.

Memory and performance subsystems

Memory management unit

The Memory Management Unit (MMU) is a dedicated hardware component within the central processing unit responsible for translating virtual addresses generated by software into physical addresses in main memory, while enforcing to isolate processes and prevent unauthorized access. This translation enables systems, allowing programs to operate in a contiguous abstracted from the physical layout. The MMU achieves this by consulting page tables—data structures maintained by the operating system that map virtual page numbers (VPNs) to physical page numbers (PPNs)—and combining the PPN with the page offset from the virtual address to form the . Core functions of the MMU include performing page table lookups during memory accesses and caching these mappings in a (TLB), a small, high-speed cache typically organized as fully associative with entries for recent translations to minimize latency. On a TLB hit, the MMU retrieves the physical address directly in one or two cycles; on a miss, it initiates a page table walk, traversing the hierarchy (e.g., one to four levels in multilevel paging) to fetch the page table entry (PTE), which includes validity bits, protection flags, and the PPN. For protection, the MMU supports paging, which divides memory into fixed-size pages (commonly 4 KB) for non-contiguous allocation and isolation, and segmentation, which uses variable-sized segments defined by base and bound registers to group related code or data logically while checking bounds to avert overflows. These mechanisms operate in distinct modes—user mode for application code and kernel mode for the OS—ensuring processes cannot access each other's memory or kernel structures; violations trigger exceptions. If a PTE indicates an invalid page or permission breach (e.g., write to read-only), the MMU generates a , invoking the OS handler to load the page from disk or terminate the process. MMUs were first integrated into CPUs in the , with the PDP-11 series from establishing a foundational architecture that divided the 16-bit into eight 8 KB segments for mapping and protection across kernel, , and user modes, enabling expansion beyond 64 KB while supporting split instruction and data spaces. This design influenced subsequent systems by embedding translation hardware directly on-chip, reducing reliance on external components. However, address translation incurs overhead, as each access may require multiple cycles for walks—typically 1–4 references in single-level paging, escalating to dozens of cycles on TLB misses and contributing up to 16% of execution time in scale-out workloads due to cache interference and walk latency. In modern designs, MMUs incorporate optimizations like support for large pages (e.g., 2 MB or 1 GB) to cover more with fewer TLB entries, reducing miss rates and walk frequency, though limited hardware coverage can increase overhead by up to 54% in others. For virtualization, nested paging—implemented via Intel's Extended Page Tables (EPT) or AMD's Nested Page Tables (nPT)—enables two-dimensional from guest virtual addresses through guest physical to host physical addresses, avoiding frequent traps but introducing up to 6× more PTE lookups (24 accesses versus 4 in native paging) and 2.4× slowdowns; mitigations include huge pages to alleviate this in environments.

Cache hierarchy

The cache hierarchy refers to the multi-level structure of small, fast on-chip memories integrated into modern CPUs to bridge the speed gap between the processor core and slower off-chip main memory. These caches store frequently accessed data and instructions, leveraging the principle of to minimize average access latency. Temporal locality exploits the tendency of programs to reuse recently accessed data soon after, while spatial locality capitalizes on accesses to nearby memory locations in the near future. This organization allows the CPU to achieve high performance by serving most requests from fast local storage rather than slower (DRAM). Caches are typically organized into three levels: L1, L2, and L3, all implemented using (SRAM), which provides lower latency and higher speed than DRAM but at the cost of smaller capacity and higher density requirements. The L1 cache is the smallest and fastest, positioned closest to each core, and is usually split into separate instruction (L1i) and (L1d) caches to allow simultaneous access for fetching and execution. Typical L1 sizes range from 32 KB to 64 KB per core, enabling sub-nanosecond access times. The L2 cache is larger and unified, holding both instructions and data, often dedicated per core or shared among a small cluster, with sizes commonly between 256 KB and 2 MB per core. The L3 cache, or last-level cache, is the largest in the , shared across all cores on the chip, and can reach 100 MB or more in multi-core designs to capture broader working sets. Cache organization relies on associativity to map memory blocks (cache lines, typically 64 bytes) to storage locations, balancing hit rate, access speed, and hardware complexity. In a direct-mapped cache, each block maps to exactly one location, offering simplicity and low latency but suffering from conflict misses when multiple blocks compete for the same slot. Set-associative caches divide the cache into sets, allowing multiple blocks (ways, often 2–8) per set, which reduces conflicts while keeping lookup feasible via parallel tag comparisons. Fully associative caches permit any block to map anywhere, maximizing flexibility and hit rates but requiring slower, more power-hungry searches across the entire cache. Most modern CPU caches employ set-associative designs, with L1 often 8-way and L3 16–20-way, to optimize for both speed and efficiency. Cache management involves policies for handling writes and ensuring consistency across cores. Write-through policies update both the cache and main memory on every write, ensuring immediate consistency but increasing memory bandwidth usage. Write-back policies defer memory updates until the cache line is evicted or flushed, reducing traffic through coalescing writes but risking data loss if not managed carefully, and are prevalent in performance-oriented designs. In multi-core systems, cache coherence protocols like MESI (Modified, Exclusive, Shared, Invalid) maintain a consistent view of data by tracking line states and invalidating or updating copies on shared bus snooping or directory-based mechanisms. The MESI protocol, developed at the University of Illinois, enables efficient write-back operation by distinguishing dirty (Modified) lines from clean shared ones, minimizing unnecessary traffic. A cache miss, where requested data is absent, imposes a significant penalty by stalling the core until data is fetched from a lower level or main , often taking tens to hundreds of cycles depending on the level. This can degrade performance substantially in latency-sensitive workloads, as the CPU waits idle during the transfer. To mitigate misses, hardware prefetching mechanisms anticipate future accesses based on patterns like sequential strides, proactively loading data into the cache ahead of , thereby hiding latency and improving throughput without explicit software intervention.

Clock and power mechanisms

The clock signal in a central processing unit (CPU) is generated by a quartz crystal oscillator, which vibrates at a precise frequency to produce periodic electrical cycles that synchronize the processor's operations. These oscillators typically operate in the gigahertz (GHz) range for modern CPUs, providing the timing reference for fetching, decoding, and executing instructions across multiple pipeline stages. The throughput of instructions is quantified using cycles per instruction (CPI), a metric that measures the average number of clock cycles required to complete one instruction, influencing overall performance as lower CPI values indicate higher efficiency. To balance performance and energy efficiency, CPUs employ techniques such as dynamic voltage and frequency scaling (DVFS), which dynamically adjust the operating frequency and supply voltage based on demands. DVFS reduces power consumption by lowering voltage and frequency during periods of low activity, as power dissipation scales quadratically with voltage and linearly with frequency, enabling significant savings—up to 18% in some systems—without proportionally impacting throughput. This mechanism is particularly vital in battery-powered or thermally constrained environments, where it prevents excessive heat generation while maintaining computational adequacy. In contrast to synchronous designs reliant on a global clock, asynchronous CPU architectures use clockless logic that employs handshaking protocols between circuit components to coordinate data flow and completion signals. These designs activate only the necessary logic gates on demand, reducing average power usage and eliminating clock-related overheads like skew and . A notable example is the AMULET series, which implements the ARM instruction set asynchronously and achieves rapid start-stop capabilities with lower energy per operation compared to clocked equivalents. Power delivery to the CPU is managed through voltage regulator modules (VRMs) integrated on the , which convert and stabilize the input voltage from the power supply to the precise levels required by the processor core, often below 1V for modern nodes. VRMs consist of buck converters with multiple phases to handle high currents efficiently, ensuring stable operation under varying loads. To mitigate overheating, CPUs incorporate throttling, a feedback mechanism that automatically reduces clock or core activity when internal temperatures exceed safe thresholds, thereby capping power draw and preserving reliability. Key metrics for CPU power management include (TDP), which specifies the maximum heat dissipation a processor is engineered to produce under typical workloads, guiding cooling solution design. For instance, many desktop CPUs, such as certain models, have a TDP of 65W, balancing performance for general tasks while allowing for adequate thermal headroom in standard chassis configurations.

Parallelism and optimization

Instruction-level parallelism

Instruction-level parallelism (ILP) refers to the ability of a processor to execute multiple instructions from a single thread concurrently, thereby increasing throughput without requiring multiple threads. This parallelism is exploited through hardware techniques that overlap or reorder instruction execution while preserving the program's semantic correctness. Key methods include pipelining, superscalar execution, and out-of-order processing, each addressing different aspects of instruction dependencies and resource utilization. Pipelining divides instruction execution into sequential stages—such as fetch, decode, execute, access, and write-back—allowing overlapping operations where a subsequent instruction begins before the previous one completes. This overlap increases instruction throughput to approach one instruction per clock cycle in ideal conditions, though hazards can reduce efficiency. For instance, in a five-stage , the fetch stage of instruction n+1n+1 occurs simultaneously with the decode stage of instruction nn. Seminal work on quantitative analysis of pipelined architectures highlights how this technique scales performance by reducing the cycle time per instruction. Superscalar architectures extend pipelining by incorporating multiple execution pipelines or issue units, enabling the simultaneous dispatch of independent instructions to different functional units in the same cycle. The , introduced in 1993, was the first superscalar implementation for the x86 architecture, featuring two integer pipelines that could process up to two , along with a . This design doubled the potential throughput over scalar processors like the 80486. Out-of-order execution further enhances ILP by dynamically reordering instructions at runtime, using structures like reservation stations to dispatch ready instructions to functional units regardless of their original sequence. Pioneered by in the , this approach employs and a common data bus to track dependencies and forward results efficiently, preventing stalls from data hazards. In modern implementations, reservation stations buffer instructions and operands, allowing execution as soon as sources are available. Dependencies between instructions limit ILP and manifest as hazards: true data hazards include read-after-write (RAW), write-after-read (), and write-after-write (WAW), while false hazards arise from name dependencies without actual data conflicts. RAW hazards occur when an instruction reads a register before a prior write completes, potentially causing incorrect values; WAR and WAW involve write ordering issues. Hardware handles true RAW hazards via bypassing (forwarding) paths that route results directly from execution units to dependent instructions, bypassing the register file and reducing stalls by up to two cycles in a typical . False hazards, such as WAR and WAW, are resolved through , which maps architectural registers to physical ones to eliminate name conflicts without altering data flow. Control hazards from branches disrupt pipeline flow by altering the , leading to misprediction penalties of 10–20 cycles in deep . Branch mitigates this by speculatively fetching instructions based on predicted outcomes; static methods use fixed rules (e.g., always taken for backward branches), while dynamic schemes adapt using history tables. A common dynamic predictor employs a 2-bit saturating counter per , incrementing toward "taken" (11) on taken branches and toward "not taken" (00) otherwise, achieving 90–95% accuracy in typical workloads by that resists single flips. The seminal two-level adaptive predictor, building on such counters, indexes pattern history tables with global branch outcomes for correlated . Very long instruction word (VLIW) architectures represent an alternative for ILP, where compilers explicitly pack multiple independent operations into long instructions for parallel execution, offloading scheduling from hardware to software. The Intel Itanium processor (2001) adopted an explicitly parallel instruction computing (EPIC) variant of VLIW, bundling three 41-bit operations into 128-bit instructions with dependency hints, enabling up to six operations per cycle but relying heavily on compiler optimization. Despite these advances, ILP faces fundamental limits from sequential code portions and dependency chains, as quantified by , which states that the speedup from parallelizing a fraction pp of a program is bounded by 1/(1p+p/N)1 / (1 - p + p/N), where NN is the degree of parallelism; even high ILP yields diminishing returns if sequential bottlenecks persist.

Thread-level and data parallelism

Thread-level parallelism enables a CPU to execute multiple independent threads concurrently, improving throughput on multi-threaded applications by distributing workloads across processing units. (SMP) is a foundational approach where multiple identical processors share a common memory space and operating system, allowing threads to run in parallel while maintaining coherence through hardware mechanisms like cache snooping. Hyper-Threading Technology, introduced by in 2002 with the processor family, implements (SMT) to simulate additional logical cores on a single physical core, duplicating architectural states such as registers while sharing execution resources to boost utilization without significantly increasing die size or power consumption. Multi-core processors advanced thread-level parallelism by integrating multiple independent cores on a single die, with AMD's in 2005 marking an early commercial desktop implementation of true dual-core architecture, enabling across distinct processing units for enhanced in consumer workloads. Modern scalability in multi-core designs is achieved through architectures, as pioneered by in and families, where smaller modular dies are interconnected to form high-core-count processors, improving yield, reducing costs, and allowing flexible scaling for and desktop applications. Data parallelism complements thread-level approaches by processing multiple data elements simultaneously using a single instruction, primarily through (Single Instruction, Multiple Data) extensions. In x86 architectures, Intel's (SSE), introduced with the Pentium III, provide 128-bit vector operations for packed floating-point and integer data, while (AVX) extend this to 256-bit vectors for more efficient parallel computations in and scientific tasks. ARM processors employ as their SIMD extension, offering 128-bit vector registers to handle parallel operations on integers, floating-point, and fixed-point data, accelerating tasks like and inference on mobile and embedded systems. To coordinate parallel execution, synchronization mechanisms such as locks ensure for shared resources, preventing race conditions by allowing only one thread to access critical sections at a time, while barriers enforce collective waiting until all threads reach a designated point before proceeding. In large-scale multi-core systems, (NUMA) architectures introduce latency variations based on memory proximity to cores, requiring NUMA-aware to minimize remote access overheads and optimize thread placement for coherent data sharing across nodes. These parallelism techniques find application in workloads like , where threads handle independent scene elements across cores, and AI training, where data batches are processed in parallel via SIMD and multi-threading to accelerate model optimization on multi-core CPUs.

Asynchronous and specialized designs

Asynchronous CPU designs, also known as clockless or self-timed processors, operate without a global , relying instead on local handshaking protocols to coordinate data flow between components. This event-driven approach allows circuits to activate only when needed, potentially reducing power consumption compared to synchronous designs that continuously toggle regardless of activity. Pioneering work in this area includes the Caltech Asynchronous (CAM), developed in the late 1980s as the first single-chip asynchronous processor, which demonstrated self-timed logic for instruction execution and using bundled-data signaling. These designs offer several advantages, including lower (EMI) due to the absence of periodic clock edges that generate noise, and adaptive operating speeds that adjust dynamically to workload and process variations without fixed clock rates. However, they face challenges in , as ensuring correct ordering and completion of operations across distributed components requires complex mechanisms, which can increase design overhead and verification difficulty. In pipelines, asynchronous elements can enhance flexibility by decoupling stages from a rigid clock, allowing data-dependent timing similar to self-timed logic while maintaining compatibility with synchronous cores; for instance, asynchronous arbiters and buffers have been integrated to handle variable latency without stalling the entire . Specialized CPU designs extend these principles to application-specific architectures, such as reconfigurable processors that incorporate FPGA-like logic blocks directly into the CPU fabric for on-the-fly customization of compute units, enabling efficient handling of domain-specific tasks like without external accelerators. Neuromorphic processors represent another specialization, mimicking neural structures with asynchronous, event-based computation; IBM's TrueNorth chip, released in 2014, features 1 million neurons and 256 million synapses in a scalable, low-power that processes asynchronously, consuming just 65 mW while supporting real-time AI inference. Modern examples include RISC-V-based systems with custom ISA extensions for asynchronous peripherals, such as interfaces supporting parallel memory accesses via handshaking protocols, which allow the CPU to interface with event-driven I/O without clock synchronization overhead.

Operating modes and evaluation

Privilege and security modes

Privilege and security modes in central processing units (CPUs) define hierarchical execution states that isolate user applications from system resources, preventing unauthorized access and ensuring operational stability. These modes trace their origins to the 1970s by , which implemented kernel mode for full hardware control and user mode to restrict access to privileged instructions and memory, laying the foundation for modern protection mechanisms. In x86 architectures, privilege is structured into four rings (0–3), with ring 0 (kernel/supervisor mode) granting unrestricted access to hardware and instructions, while ring 3 (user mode) limits operations to prevent interference with the system; intermediate rings 1 and 2 are rarely used in contemporary designs. The current privilege level is tracked via the code segment register, and access violations trigger exceptions like general protection faults. ARM processors employ a similar model with four exception levels: EL0 for unprivileged user applications, EL1 for operating system kernels, EL2 for hypervisors, and EL3 for the most privileged secure firmware, where higher levels supersede lower ones in authority. Mode transitions occur through system calls, interrupts, and exceptions to enable secure interactions between privilege levels. In x86, a system call via SYSENTER or SYSCALL instructions from ring 3 invokes a software , prompting the CPU to save the user state, switch to ring 0 using the , and execute a kernel handler; returns use IRET or SYSRET to restore the prior mode. Hardware interrupts from peripherals follow the same path, vectoring through the to kernel handlers without allowing direct user escalation. In , synchronous exceptions from system calls elevate the exception level, with asynchronous interrupts or faults similarly routing to higher-level handlers, and returns via ERET instructions that demote the level while preserving isolation. Hardware enforces these protections via the , which checks privilege during address translation and generates traps for violations, such as unauthorized memory access from lower rings. Security enhancements include the No eXecute (NX) bit in x86 processors, which designates pages as non-executable to block malicious code execution from data regions, a feature integrated since early 64-bit CPUs to mitigate exploits. CPUs also facilitate (ASLR) through virtual addressing, enabling OSes to randomize memory layouts for added exploit resistance. extensions like VT-x introduce VMX root mode for hypervisors (highest privilege) and non-root mode for guest OSes, supporting nested privilege controls via VM entry and exit operations. Contemporary advancements extend these modes with hardware-isolated environments, such as , which create secure enclaves—protected memory regions accessible only to authorized code, shielding sensitive computations from even kernel-level access and enhancing confidentiality in multi-tenant systems. More recent advancements include Intel's Trust Domain Extensions (TDX), introduced in 2021, which enable hardware-isolated virtual machines with memory encryption and attestation for , and AMD's Secure Encrypted Virtualization with Secure Nested Paging (SEV-SNP), enhanced in 2022, providing similar protections against hypervisor attacks.

Performance metrics

Performance metrics for central processing units (CPUs) provide quantitative measures to evaluate computational capabilities, focusing on speed, efficiency, and resource utilization across various workloads. Key metrics include millions of (MIPS), which quantifies the number of machine instructions a CPU can execute in one second, offering a basic indicator of processing power. However, MIPS has limitations as it does not account for instruction complexity or workload variations, potentially misleading comparisons between architectures. Floating-point operations per second (FLOPS) measures the rate of arithmetic calculations on real numbers, essential for scientific and graphics-intensive tasks, with higher values indicating better handling of floating-point computations. The (SPEC) benchmarks, such as SPEC CPU 2017, assess compute-intensive performance through suites of integer and floating-point workloads, providing standardized scores for processor comparison across hardware platforms. Several factors influence these metrics, including instructions per cycle (IPC), which represents the average number of instructions executed per clock cycle and reflects architectural efficiency in utilizing stages. Latency, the time to complete specific operations like memory access, and throughput, the rate of processing data streams, are also critical, varying based on CPU , cache design, and application demands. These factors are workload-dependent; for instance, branch-intensive programs may suffer from prediction errors, reducing effective IPC. Hardware performance counters enable detailed profiling by tracking events such as cycle counts, retired instructions, and branch mispredictions directly from CPU hardware registers. Tools like Linux perf utilize these counters to analyze bottlenecks, offering insights into real-time execution dynamics without relying solely on aggregate metrics. Benchmark suites like CoreMark evaluate embedded and general-purpose CPU performance through a mix of list processing, matrix manipulation, and state machine tasks, yielding scores that normalize for core efficiency. Geekbench provides cross-platform assessments of single-core and multi-core capabilities via workloads simulating everyday computing, such as image processing and machine learning inference. Real-world benchmarks, derived from actual applications like video encoding, better capture practical performance than synthetic ones, which may overemphasize peak theoretical rates but overlook overheads like I/O waits. Comparisons often distinguish single-thread performance, emphasizing per-core speed for sequential tasks, from multi-thread scores, which scale with core count for parallel workloads; for example, modern CPUs show 2-4x gains in multi-thread metrics over predecessors due to increased cores. Generational improvements, such as those in the mid-2010s in mobile CPUs over seven years (as analyzed in ), have delivered up to 3x uplifts at similar power levels through enhanced IPC and parallelism.

Enhancement techniques

Overclocking refers to the practice of increasing a CPU's clock beyond its manufacturer-specified limits to achieve higher . This is typically accomplished by adjusting the multiplier or base clock (BCLK) in the system's / settings, where the core is calculated as BCLK multiplied by the multiplier. For unlocked processors, such as Intel's K-series or AMD's non-locked models, users can raise the multiplier directly, while BCLK adjustments affect the entire system, including RAM and PCIe devices, requiring careful tuning to maintain stability. Effective demands enhanced cooling solutions, such as air coolers, liquid cooling, or extreme methods like for record attempts, to dissipate the additional heat generated. However, pushing frequencies too high can lead to system instability, , accelerated hardware degradation, or permanent damage due to and thermal stress. Overclocking originated in the and but gained widespread popularity in the early with Intel's processors, when enthusiasts began modifying jumpers to select higher clock speeds on compatible boards, effectively turning slower CPUs into faster variants without hardware alterations. This era marked the birth of as a , driven by the desire to extend the life of aging hardware amid rapid advancements in processor speeds. By the mid-1990s, techniques evolved to include simple multiplier unlocks on chips like the for 486 systems, laying the groundwork for modern practices. To validate an overclock's stability, users commonly employ stress testing software like Prime95, which performs intensive mathematical computations to push the CPU to its limits and detect errors or crashes. Tests are run for extended periods, often 24 hours or more, under high-priority settings to simulate worst-case loads and ensure reliability without real-world application mismatches. Undervolting complements by reducing the CPU's operating voltage below stock levels, which lowers power consumption and heat output while maintaining or even improving through better thermal headroom. This technique is particularly beneficial for , extending battery life in laptops and reducing costs in desktops, without sacrificing clock speeds if the quality allows stable operation at lower voltages. Proper undervolting requires monitoring tools to avoid instability from insufficient voltage, but it enhances overall system by minimizing thermal degradation. In contemporary designs, automated enhancement features like and AMD Precision Boost provide safe, dynamic within predefined power and thermal limits. opportunistically increases core frequencies above the base clock during lighter workloads, balancing performance with energy efficiency by scaling based on available power budget. Similarly, 's Precision Boost 2 adjusts clock speeds in real-time across processors, leveraging per-core sensors to maximize frequency while adhering to safe operational envelopes. These technologies represent manufacturer-sanctioned enhancements, eliminating much of the risk associated with manual .

References

Add your contribution
Related Hubs
Contribute something
User Avatar
No comments yet.