An accumulator is a register in a computer’s central processing unit (CPU) that stores mathematical information, such as additions, subtractions, etc. For example, when adding a list of numbers, each number is entered into the accumulator and added together. Once all numbers have been inputted into the accumulator, they are stored on the computer in the register. Without an accumulator, each calculation would have to be inputted manually.
An accumulator machine, or a 1-operand machine, is a kind of CPU that has one main register, or “the” accumulator of the computer, that stores most information. A computer may have multiple registers for information, but in an accumulator machine most calculations are stored in a specific register. Most early computers were accumulator machines, and many microcontrollers of the current century are essentially just complex accumulator machines.
In order to distinguish a particular register as the accumulator of the computer, it must be used as an implicit operand for mathematical calculations. For example, if a CPU has an instruction to add a calculated result from a particular address (i.e. rdaddress), then the accumulator would read the value from the memory location at rdaddress and add it to its memory. Also, the accumulator would not be identified in the instruction; instead, it is an implicit and is the only register that can be specified in the instruction.
Example instructions for accumulators include:
-Clear accumulator and add 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.
Comments