Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Random-access machine
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== The notion of "accumulator A" == 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" (boldface in original: Goldstine and von Neumann, 1946; p. 98 in Bell and Newell 1971). However, the accumulator comes at the expense of more instructions per arithmetic "operation", in particular with respect to what are called 'read-modify-write' instructions such as "Increment indirectly the contents of the register pointed to by register r2 ". "A" designates the "accumulator" register A: {|class="wikitable" |- style="text-align:left; font-size:9pt; vertical-align:bottom;" ! style="width:49.2; font-weight:bold; height:12px;"| Label ! style="font-weight:bold; width:70.2;"| Instruction ! style="width:4.8;"| ! style="font-weight:bold; width:24px;"| A ! style="font-weight:bold; width:47.4;"| r2 ! style="font-weight:bold; width:64.2;"| r378,426 ! style="font-weight:bold; width:267px;"| Description |- style="text-align:left; font-size:9pt; vertical-align:bottom;" | style="height:12px;"| | | | . . . | 378,426 | 17 | |- style="text-align:left; font-size:9pt; vertical-align:bottom;" | style="font-style:Italic; height:12px;"| INCi ( r2 ): | CPY ( i, r2, d, A ) | |style="font-weight:bold" | 17 | 378,426 | 17 | Contents of r2 points to r378,426 with contents "17": copy this to A |- style="text-align:left; font-size:9pt; vertical-align:bottom;" | style="height:12px;"| | INC ( A ) | |style="font-weight:bold" | 18 | 378,426 | 17 | Incement contents of A |- style="text-align:left; font-size:9pt; vertical-align:bottom;" | style="height:12px;"| | CPY ( d, A, i, r2 ) | | 18 | 378,426 |style="font-weight:bold" | 18 | Contents of r2 points to r378,426: copy contents of A into r378,426 |} If we stick with a specific name for the accumulator, e.g. "A", we can imply the accumulator in the instructions, for example, : INC ( A ) = INCA However, when we write the CPY instructions without the accumulator called out the instructions are ambiguous or they must have empty parameters: : CPY ( d, r2, d, A ) = CPY (d, r2, , ) : CPY ( d, A, d, r2 ) = CPY ( , , d, r2) Historically what has happened is these two CPY instructions have received distinctive names; however, no convention exists. Tradition (e.g. [[Donald Knuth|Knuth]]'s (1973) imaginary [[MIX (abstract machine)|MIX]] computer) uses two names called LOAD and STORE. Here we are adding the "i/d" parameter: : LDA ( d/i, r<sub>s</sub> ) =<sub>def</sub> CPY ( d/i, r<sub>s</sub>, d, A ) : STA ( d/i, r<sub>d</sub> ) =<sub>def</sub> CPY ( d, A, d/i, r<sub>d</sub> ) The typical accumulator-based model will have all its two-variable arithmetic and constant operations (e.g. ADD (A, r), SUB (A, r) ) use (i) the accumulator's contents, together with (ii) a specified register's contents. The one-variable operations (e.g. INC (A), DEC (A) and CLR (A) ) require only the accumulator. Both instruction-types deposit the result (e.g. sum, difference, product, quotient or remainder) in the accumulator. : Example: INCA = [A] +1 β A : Example: ADDA (r<sub>s</sub>) = [A] + [r<sub>s</sub>] β A : Example: MULA (r<sub>s</sub>) = [A] * [r<sub>s</sub>] β A If we so choose, we can abbreviate the mnemonics because at least one source-register and the destination register is always the accumulator A. Thus we have : :{ LDA (i/d, r<sub>s</sub>), STA (i/d, r<sub>d</sub>), CLRA, INCA, DECA, ADDA (r<sub>s</sub>), SUBA (r<sub>s</sub>), MULA (r<sub>s</sub>), DIVA (r<sub>s</sub>), etc.)
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)