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!
=== Unbounded indirection and the partial recursive functions === For ''unbounded'' indirection we require a "hardware" change in our machine model. Once we make this change the model is no longer a counter machine, but rather a random-access machine. Now when e.g. INC is specified, the finite-state machine's instruction will have to specify ''where'' the address of the register of interest will come from. This ''where'' can be either (i) the state machine's instruction that provides an ''explicit label'', or (ii) the ''pointer-register'' whose ''contents'' is the address of interest. Whenever an instruction specifies a register address it now will ''also'' need to specify an additional parameter "i/d"{{spaced ndash}}"indirect/direct". In a sense this new "i/d" parameter is a "switch" that flips one way to get the direct address as specified in the instruction or the other way to get the indirect address from the pointer register (which pointer register{{spaced ndash}}in some models every register can be a pointer register{{spaced ndash}}is specified by the instruction). This "mutually exclusive but exhaustive choice" is yet another example of "definition by cases", and the arithmetic equivalent shown in the example below is derived from the definition in Kleene (1952) p. 229. :Example: CPY ( indirect<sub>source</sub>, r<sub>source</sub>, direct<sub>destination</sub>, r<sub>destination</sub> ) :Assign a code to specify direct addressing as d="0" and indirect addressing as i="1". Then our machine can determine the source address as follows: :: i*[r<sub>s</sub>] + (1-i)*r<sub>s</sub> :For example, suppose the contents of register 3 are "5" (i.e. [3]=5 ) and the contents of register 4 are "2" (i.e. [4]=2 ): :: Example: CPY ( 1, 3, 0, 4 ) = CPY ( indirect, reg 3, direct, reg 4 ) ::: 1*[3] + 0*3 = [3] = source-register address 5 ::: 0*[4] + 1*4 = 4 = destination-register address 4 :: Example: CPY ( 0, 3, 0, 4 ) ::: 0*[3] + 1*3 = 3 = source-register address 3 ::: 0*[4] + 1*4 = 4 = destination-register address 4 :: Example: CPY ( 0, 3, 1, 4 ) ::: 0*[3] + 1*3 = 3 = source-register address 3 ::: 1*[4] + 0*4 = [4] = destination-register address 2
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)