Accumulator (computing)
This article needs additional citations for verification. (February 2024) |
In a computer's central processing unit (CPU), the accumulator is a register in which intermediate arithmetic logic unit results are stored.
Without a register like an accumulator, it would be necessary to write the result of each calculation (addition, multiplication,
Accessing memory is slower than accessing a register like an accumulator because the technology used for the large main memory is slower (but cheaper) than that used for a register. Early electronic computer systems were often split into two groups, those with accumulators and those without.
Modern computer systems often have multiple general-purpose registers that can operate as accumulators, and the term is no longer as common as it once was. However, to simplify their design, a number of special-purpose processors still use a single accumulator.
Basic concept
Mathematical operations often take place in a stepwise fashion, using the results from one operation as the input to the next. For instance, a manual calculation of a worker's weekly payroll might look something like:
- look up the number of hours worked from the employee's time card
- look up the pay rate for that employee from a table
- multiply the hours by the pay rate to get their basic weekly pay
- multiply their basic pay by a fixed percentage to account for income tax
- subtract that number from their basic pay to get their weekly pay after tax
- multiply that result by another fixed percentage to account for retirement plans
- subtract that number from their basic pay to get their weekly pay after all deductions
A computer program carrying out the same task would follow the same basic sequence of operations, although the values being looked up would all be stored in computer memory. In early computers, the number of hours would likely be held on a
Accumulators dramatically improve performance in systems like these by providing a scratchpad area where the results of one operation can be fed to the next one for little or no performance penalty. In the example above, the basic weekly pay would be calculated and placed in the accumulator, which could then immediately be used by the income tax calculation. This removes one save and one read operation from the sequence, operations that generally took tens to hundreds of times as long as the multiplication itself.
Accumulator machines
An accumulator machine, also called a
Modern CPUs are typically 2-operand or 3-operand machines. The additional operands specify which one of many
The characteristic that distinguishes one register as being the accumulator of a
ADD memaddress
that adds the value read from memory location memaddress to the value in the accumulator, placing the result back in the accumulator. The accumulator is not identified in the instruction by a register number; it is implicitHistory of the computer accumulator
Any system that uses a single "memory" to store the result of multiple operations can be considered an accumulator.
Historical convention dedicates a register to "the accumulator", an "arithmetic organ" that literally accumulates its number during a sequence of arithmetic operations:
- "The first part of our arithmetic organ ... should be a parallel storage organ which can receive a number and add it to the one already in it, which is also able to clear its contents and which can store what it contains. We will call such an organ an Accumulator. It is quite conventional in principle in past and present computing machines of the most varied types, e.g. desk multipliers, standard IBM counters, more modern relay machines, the ENIAC" (Goldstine and von Neumann, 1946; p. 98 in Bell and Newell 1971).
Just a few of the instructions are, for example (with some modern interpretation):
- Clear accumulator and add number from memory location X
- Clear accumulator and subtract number from memory location X
- Add number copied from memory location X to the contents of the accumulator
- Subtract number copied from memory location X from the contents of the accumulator
- Clear accumulator and shift contents of register into accumulator
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 register/memory (e.g. "LDA r") and store accumulator to register/memory (e.g. "STA r"). Knuth's model has many other instructions as well.
Notable accumulator-based computers
The 1945 configuration of ENIAC had 20 accumulators, which could operate in parallel.[4]: 46 Each one could store an eight decimal digit number and add to it (or subtract from it) a number it received.[4]: 33 Most of IBM's early binary "scientific" computers, beginning with the vacuum tube IBM 701 in 1952, used a single 36-bit accumulator, along with a separate multiplier/quotient register to handle operations with longer results. The IBM 650, a decimal machine, had one 10 digit distributor and two ten-digit accumulators; the IBM 7070, a later, transistorized decimal machine had three accumulators. The IBM System/360, and Digital Equipment Corporation's PDP-6, had 16 general-purpose registers, although the PDP-6 and its successor, the PDP-10, call them accumulators.
The 12-bit PDP-8 was one of the first minicomputers to use accumulators, and inspired many later machines.[5] 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 had 8 general-purpose registers, along the lines of the System/360 and PDP-10; most later CISC and RISC machines provided multiple general-purpose registers.
Early
References
- ^ "HC16 Overview". Freescale.com. Archived from the original on 28 September 2007. Retrieved 2008-09-22.
- ^ J. Presper Eckert, "A Survey of Digital Computer Memory Systems", IEEE Annals of the History of Computing, 1988, pp. 15-28.
- ^ "The Feasibility of Ludgate's Analytical Machine".
- ^ ISBN 9780262334419.
- ^ Programmed Data Processor-1 Manual (PDF), Maynard, Massachusetts: Digital Equipment Corporation, 1961, p. 7: PDP-1 system block diagram, archived (PDF) from the original on 2022-10-09, retrieved 2014-07-03
- ISBN 978-0-13-238310-3.
- Goldstine, Herman H., and von Neumann, John, "Planning and Coding of the Problems for an Electronic Computing Instrument", Rep. 1947, ISBN 0-07-004357-4}. A veritable treasure-trove of detailed descriptions of ancient machines including photos.