A register is a device for storing data.
The term is also used in Australia (and, I think, in Britain), as an abbreviation for cash register, a device for tracking retail sales and known to Americans as a till
Historically, a register was a sign, on which people could write, often with chalk.
In computers, a memory data register or memory address register are a form of electronic abacus, a memory location that can be loaded or stored, and operated upon very quickly by software or a microprogram, using an arithmetic and logic unit of a CPU.
Most modern computer designs have a small set of registers. These are volatile memory locations that can be accessed ten to a hundred times more quickly than normal memory, with special instruction addressing modes for accessing them. For instance the Intel 80386 family of processors have eight 32 bit registers for normal use. RISC processors (such as SUNs SPARC line) tend to have much more (64 is common). Because of the speed disparity between normal memory and registers, manipulation of data in registers is much preferred and proper use of them is instrumental in generating optimal machine code instructions. Registers are at the top of the Memory hierarchy, i.e. there is no faster way to store data in a computer system.
There are several kinds of registers:
- Data registers are used to store integer numbers.
- Floating point registers are used to store floating point numbers.
- Address registers hold memory addresses and are used to access memory.
- Constant registers which hold read-only values (e.g. zero or one).
- Vector registers which hold data for Single Instruction Multiple Data (SIMD) instructions.
- Special purpose registers which store e.g. the stack pointer or processor status words.
If a register can store both data and addresses it is called a general purpose register.
Two different approaches to registers have been pursued.
The first was to have an electronically-controlled switch for each possible state of each digit of the register. Any one switch, when on, turns off all the other switches. This system is stable, and is standard engineering practice.
The other method is to map several states to the charge in one capacitor. This approach can sometimes be used to save money. For example, most digital cameras use a charge coupled device as their sensor. Capacitors are the standard way to store data in electronic random-access computer storage.
One of the more significant developments of computer architecture was the discovery that binary numbers were the least expensive form for fast electronic storage. A ten state device needs ten switches. One can encode the same ten states as eight switches encoding four binary bits. Ten is greater than eight, therefore a decimal storage unit is more expensive than a binary unit.