Safekipedia

Processor register

Adapted from Wikipedia · Discoverer experience

A processor register is a very fast place to store information inside a computer's processor. These tiny memory spots are much quicker to use than the main memory of the computer, making them very important for doing calculations and other tasks quickly. Some registers can only be read, while others can only be written to, and they all help the computer work faster.

Almost every computer moves data from its larger memory into registers before doing things like arithmetic operations or bitwise operations. After the work is done, the results are often saved back to the main memory. This helps the computer handle information much more efficiently.

Registers sit at the very top of the memory hierarchy, meaning they are the fastest places to store and get data. They are a key part of what makes modern computers powerful. When programs need to use the same data many times, keeping it in a register can make the program run much faster. This process of deciding which values to keep in registers is called register allocation and is done either by the compiler or by a person writing assembly language code.

Size

Registers are small storage spaces inside a computer’s processor. They are measured by how many bits they can hold, such as an 8-bit, 32-bit, 64-bit, or 128-bit register. Some processors can break this storage into smaller parts, allowing them to handle multiple pieces of data at once. This is often done by using extra registers that can map smaller storage spaces into a larger one. Processors that can perform actions on many pieces of data simultaneously are known as vector processors.

Types

A processor often has many kinds of registers, which are special storage spots that help it do its job. These registers can hold different types of information or help with different tasks.

  • User-accessible registers are the ones that programs can read and write to. These include:
    • Data registers that hold numbers, characters, or small groups of bits.
    • Address registers that hold locations in memory where data can be found.
    • General-purpose registers that can hold either data or addresses.
    • Floating-point registers that are good for storing numbers with decimals.
    • Constant registers that always hold special unchanging values.
    • Vector registers that help with processing many pieces of data at once.
    • Status registers that show whether certain conditions are true or false.
    • Special-purpose registers that keep track of important parts of a program’s state, like where the program is currently running.
    • Control registers that control how the processor works.
  • Internal registers are used only inside the processor and cannot be directly accessed by programs. Examples include:
    • The instruction register that holds the current instruction being carried out.
    • Registers that help fetch data from memory.

Some registers are special because they always return a certain value when read, like zero, which helps make things work more easily.

Examples

This table shows how many registers are used in some common computer chips. Even though these chips are different, they all follow a basic design idea called the von Neumann architecture, which was suggested by a mathematician named John von Neumann. One interesting thing is that graphics chips, known as GPUs, usually have many more registers than regular computer chips, called CPUs.

ArchitectureGPRs/data+address registersFP registers
AT&T Hobbit000stack of 7
Cray-18 scalar data, 8 address8 scalar, 8 vector
(64 elements)
40041 accumulator, 16 others000
80081 accumulator, 6 others000
80801 accumulator, 6 others, 1 stack pointer000
Z8017: 1 accumulator, 6 others, alternate set of 1 accumulator and 6 others, 2 index registers, 1 stack pointer000
18021 8-bit accumulator, 16 16-bit registers000
iAPX432000stack of 6
16-bit x86008stack of 8
(if FP present)
IA-32008stack of 8 (if FP present),
8 (if SSE/MMX present)
x86-6416 (or 32 if APX available)16 or 32
(if AVX-512 available)
Fairchild F81 accumulator, 64 scratchpad registers, 1 indirect scratchpad register (ISAR)000
COP4001 accumulator, 1 pointer000
Geode GX1 data, 1 address008
Sunplus μ'nSP8 (sp, r1-r4, bp, sr, pc)000
VM Labs Nuon000001
Nios II031008
Motorola 68002 accumulators, 1 index, 1 stack000
Motorola 68k8 data (d0–d7), 8 address (a0–a7)008
(if FP present)
MSP4300013000
SuperH0016006
Emotion Engine3(VU0)+ 32(VU1)32 SIMD (integrated in UV1)
+ 2 × 32 Vector (dedicated vector co-processor located nearby its GPU)
CUDAconfigurable, up to 255 per thread
CDC 6000 series016008
System/360, System/370, System/390, z/Architecture0164 (if FP present);
16 in G5 and later S/390 models and z/Architecture
MMIX256256
NS320xx008008
(if FP present)
Xelerated X10001032
Parallax Propeller000002
Itanium128128
SPARC031032
IBM POWER032032
PowerPC/Power ISA032032
Blackfin8 data, 2 accumulator, 6 address000
IBM Cell SPE128
PDP-10016
PDP-11007006
(if FPP present)
VAX016
Alpha031031
65021 accumulator, 2 index, 1 stack000
W65C816S001000
MeP004008
PIC microcontroller001000
AVR microcontroller032000
ARM 32-bit (ARM/A32, Thumb-2/T32)014Varies
(up to 32)
ARM 32-bit (Thumb)008016
ARM 64-bit (A64) 031032
MIPS031032
RISC-V031032
Epiphany64 (per core)

Usage

The number of registers a processor has and the tasks they can help with greatly affect how well computer programs run. Special tools that make programs faster can use these registers to improve performance. The Strahler number of an expression tree shows the smallest number of registers needed to complete certain tasks.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on Processor register, available under CC BY-SA 4.0.