A register is a very small amount of very fast memory that is built into the CPU (central processing unit) in order to speed up its operations by providing quick access to commonly used values.
Memory refers to semiconductor devices whose contents can be accessed (i.e., read and written to) at extremely high speeds but which are held there only temporarily (i.e., while in use or only as long as the power supply remains on). Most memory consists of main memory, which is comprised of RAM (random access memory) chips that are connected to the CPU by a bus (i.e., a set of dedicated wires).
Registers are the top of the memory hierarchy and are the fastest way for the system to manipulate data. Below them are several levels of cache memory, at least some of which is also built into the CPU and some of which might be on other, dedicated chips. Cache memory is slower than registers but much more abundant. Below the various levels of cache is the main memory, which is even slower but vastly more abundant (e.g., hundreds of megabytes as compared with only 32 registers). But it, in turn, is still far faster and much less capacious than storage devices and media (e.g., hard disk drives and CDROMs).
Most registers are implemented as an array of SRAM (static random access memory) cells. SRAM is a type of RAM that is much faster and more reliable than the DRAM (dynamic random access memory), which is used for main memory because of its lower cost and smaller space consumption. The term static is employed because SRAM does not need to be electrically refreshed as does DRAM, although it is still volatile (i.e., it needs to be connected to a power supply in order to retain its contents).
Registers are normally measured by the number of bits they can hold, for example, an 8-bit register or a 32-bit register. The x86 (i.e., Intel-compatible) instruction set defines a set of eight 32-bit registers. However, CPUs that implement this instruction set generally contain many more registers than just these eight, including various specialized types. An instruction set is the aspects of a computer architecture visible to a programmer, including the native datatypes, instructions, registers, addressing modes, memory architecture, interrupt and exception handling and external input/output.
Registers can also be classified into general purpose and special purpose types. The former serve as temporary holding places for data that is being manipulated by the CPU. That is, they hold the inputs to the arithmetic/logic circuitry and store the results produced by that circuitry.
Special purpose registers store internal CPU data, such as the program counter (also termed instruction pointer), stack pointer and status register. Program counters contain the address of the next instruction to be executed. Instruction registers hold the instruction being executed by the CPU, address registers hold memory addresses and are used to access memory, and data registers are used to store integers.
Created May 7, 2006.