In a computer's central processing unit (CPU), an accumulator is a register in which intermediate arithmetic and logic results are stored. Without a register like an accumulator, it would be necessary to write the result of each calculation (addition, multiplication, shift, etc.) to main memory, perhaps only to be read right back again for use in the next operation. Access to main memory is slower than access to a register like the accumulator because the technology used for the large main memory is slower (but cheaper) than that used for a register.
The canonical example for accumulator use is summing a list of numbers. The accumulator is initially set to zero, then each number in turn is added to the value in the accumulator. Only when all numbers have been added is the result held in the accumulator written to main memory or to another, non-accumulator, CPU register.
An accumulator machine, also called a 1-operand machine, or a CPU with accumulator-based architecture, is a kind of CPU in which—although it may have several registers—the CPU always stores the results of most calculations in one special register—typically called "the" accumulator of that CPU. Historically almost all early computers were accumulator machines; and many microcontrollers still popular as of 2008 (such as the Freescale 68HC12 and the PICmicro) are accumulator machines.
Modern CPUs are typically 2-operand or 3-operand machines—the additional operands specify which one of many general purpose registers (also called "general purpose accumulators"[1]) are used as the source and destination for calculations. These CPUs are not considered "accumulator machines".
The characteristic which distinguishes one register as being the accumulator of a computer architecture is that the accumulator (if the architecture were to have one) would be used as an implicit operand for arithmetic instructions. For instance, a CPU might have an instruction like:
ADD memaddress
This instruction would add the value read from the memory location at memaddress to the value from the accumulator, placing the result in the accumulator. The accumulator is not identified in the instruction by a register number; it is implicit in the instruction and no other register can be specified in the instruction. Some architectures use a particular register as an accumulator in some instructions, but other instructions use register numbers for explicit operand specification.
Historical convention dedicates a register to "the accumulator", an "arithmetic organ" that literally accumulates its number during a sequence of arithmetic operations:
Just a few of the instructions are, for example (with some modern interpretation):
No convention exists regarding the names for operations from registers to accumulator and from accumulator to registers. Tradition (e.g. Donald Knuth's (1973) hypothetical MIX computer), for example, uses two instructions called LOAD ACCUMULATOR from memory/register (e.g. "LDA r") and STORE ACCUMULATOR in register/memory (e.g. "STA r"). Knuth's model has many other instructions as well.
The 12-bit PDP-8 was one of the first minicomputers to use accumulators, and inspired many later machines.[citation needed] The PDP-8 had but one accumulator. The HP 2100 and Data General Nova had 2 and 4 accumulators. The Nova was created when this follow-on to the PDP-8 was rejected in favor of what would become the PDP-11. The Nova provided four accumulators, AC0-AC3, although AC2 and AC3 could also be used to provide offset addresses, tending towards more generality of usage for the registers. The PDP-11 introduced what is generally considered to be a more elegant and contemporary model of truly general registers, numbered R0-R7 or more, and also adopted by most RISC machines such as Power PC. The 4 bit Intel 4004 and 8 bit Intel 8080 microprocessors had single accumulators.
The most common instruction set architecture today, the Intel x86 uses the 32-bit EAX register (or one of its subcomponents AX or AL, or part or all of the separate 32-bit EDX register for multiplication of large numbers) but for other arithmetic instructions EAX is one of several registers that can be specified. For instance, MUL ecx will multiply the contents of 32-bit register ECX by those of EAX and split the result between EAX and EDX (for 64 bits total, avoiding overflow). ADD, however, accepts two arguments: ADD ecx, edx will add ECX and EDX and place the result in ECX, and likewise for most registers.[2] The x86-64 64-bit variation of x86 has been generalized to 16 general registers, finally being free of the original accumulator based model.
This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.
stock | retire | vm
Why are we here?
All text is available under the terms of the GNU Free Documentation License
This page is cache of Wikipedia. History