In spirit, this is possible. However the book's software only allows us to use 10 differents states. This task seems to need more states.


Program: multiply.dat
  • Input: a blank, unary representation of a number, a blank, unary representation of a number, enough blanks to hold result
  • Output: unary representation of the product of two original numbers

  • Please use your browser to save the file multiply.dat to your computer. For instance, to save the program if you are using Internet Explorer as your browser, click the right mouse button on the multiply.dat link, and select "Save Target As...".

    Once you have it saved, you can run the ITM software of [DH], click on the "Open" button and specify the saved file, wherever you chose to save it on your computer.

    If that does not work, you can type the program in from scratch.

    Rule# Input State Input Symbol Output State Output Symbol Move
    11b2bR
    22121R
    32b3bL
    43X41L
    53131L
    63bcleanbR
    74141R
    84X4XR
    94b5bR
    105151R
    115X5XR
    125b6bL
    136X6XL
    14617XR
    156bRESETbR
    167X7XR
    177b8bR
    188181R
    198b91L
    209191L
    219b6bL
    Here is the general design:

  • State 1: starts in this state.
    Moves past first blank and enters state 2.
  • State 2: entered at leftmost 1 of first number.
    Advanced to the blank between the two numbers, then enters state 3.
  • State 3: entered at rightmost spot of first number
    looks for the X mark, moves to its left
    enters state 4
    If X not found, enters state ? for cleanup
  • State 4: advances to right until blank between two inputs
    then switches to state 5
  • State 5: entered at leftmost spot of second number
    advances to rightmost spot of second number
    then enters state 6.
  • State 6: entered at rightmost spot of second number
    looks for rightmost 1 in the second number
    changes that 1 to an X, then enters state 7
    if no 1's left, enter's state RESET
  • State 7: advances to right until left end of output
    then goes to state 8.
  • State 8: move to right end of output, and add a 1
    then enter state 9.
  • State 9: moves left until at rightmost spot of second number
    Returns to state 6.
  • look for 1 in first number. If none left, go to cleanup Else, change to x, then go to the blank before output Copy: back up to find leftmost 1 in the second number change to X place an additional 1 at end of output return to the beginning of output when no more 1's, change all x's back to 1's. Then go to the blank between two numbers. Cleanup: erase first original number erase second original number
    Michael Goldwasser
    Last modified: Fri Nov 16 23:17:26 CST 2001