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!
=== Formal definition === A ''random-access machine'' (RAM) is an abstract computational-machine model identical to a multiple-register [[counter machine]] with the addition of indirect addressing. At the discretion of instruction from its [[finite-state machine]]'s TABLE, the machine derives a "target" register's address either (i) directly from the instruction itself, or (ii) indirectly from the ''contents'' (e.g. number, label) of the "pointer" register specified in the instruction. By definition: A ''register'' is a location with both an ''address'' (a unique, distinguishable designation/locator equivalent to a natural number) and a ''content''{{spaced ndash}}a single natural number. For precision we will use the quasi-formal symbolism from Boolos-Burgess-Jeffrey (2002) to specify a register, its contents, and an operation on a register: * [r] means "the contents of register with address r". The label "r" here is a "variable" that can be filled with a natural number or a letter (e.g. "A") or a name. * β means "copy/deposit into", or "replaces", but without destruction of the source :: Example: [3] +1 β 3; means "The contents of source register with address "3", plus 1, is put into destination register with address "3" (here source and destination are the same place). If [3]=37, that is, the contents of register 3 is the number "37", then 37+1 = 38 will be put into register 3. :: Example: [3] β 5; means "The contents of source register with address "3" is put into destination register with address "5". If [3]=38, that is, the contents of register 3 is the number 38, then this number will be put into register 5. The contents of register 3 are not disturbed by this operation, so [3] continues to be 38, now the same as [5]. Definition: A ''direct'' instruction is one that specifies ''in the instruction itself'' the address of the source or destination register whose contents will be the subject of the instruction. Definition: An ''indirect instruction'' is one that specifies a "pointer register", the contents of which is the address of a "target" register. The target register can be either a source or a destination (the various COPY instructions provide examples of this). A register can address itself indirectly. :For want of a standard/convention this article will specify "direct/indirect", abbreviated as "d/i", as a parameter (or parameters) in the instruction: ::Example: COPY ( '''d''', A, '''i''', N ) means directly '''d''' get the source register's address (register "A") from the instruction itself but indirectly '''i''' get the destination address from pointer-register N. Suppose [N]=3, then register 3 is the destination and the instruction will do the following: [A] β 3. Definition: The contents of ''source register'' is used by the instruction. The source register's address can be specified either (i) directly by the instruction, or (ii) indirectly by the pointer register specified by the instruction. Definition: The contents of the ''pointer register'' is the ''address'' of the "target" register. Definition: The contents of the ''pointer register'' points to the ''target register''{{spaced ndash}}the "target" may be either a source or a destination register. Definition: The ''destination register'' is where the instruction deposits its result. The source register's address can be specified either (i) directly by the instruction, or (ii) indirectly by the pointer register specified by the instruction. The source and destination registers can be one.
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)