Académique Documents
Professionnel Documents
Culture Documents
Construct a Turing machine which computes the multiplication of two unary numbers by giving
the complete formal definition and transition functions.
Due date: 03/10/16
State,Symbol
start, 1
State,SymbolToWrite,
Direction
move1right, W, R
comment
# mark first bit of 1st argument
move1right, 1 move1right, 1, R
move1right, _ mark2start, _, R
mark2start, 1 move2right, Y, R
move2right, 1 move2right, 1, R
move2right, _ initialize, _, R
initialize, _
backup, 1, L
backup, _
backup, _, L
backup, 1
backup, 1, L
# ditto
backup, Z
backup, Z, L
# ditto
backup, Y
backup, Y, L
# ditto
backup, X
nextpass, X, R
backup, W
nextpass, W, R
# ditto
nextpass, _
finishup, _, R
nextpass, 1
findarg2, X, R
findarg2, 1
findarg2, 1, R
findarg2, _
findarg2, _, R
findarg2, Y
testarg2, Y, R
testarg2, _
cleanup2, _, L
testarg2, 1
findans, Z, R
findans, 1
findans, 1, R
findans, _
atans, _, R
atans, 1
atans, 1, R
atans, _
backarg2, 1, L
backarg2, 1
backarg2, 1, L
backarg2, _
backarg2, _, L
# ditto
backarg2, Z
testarg2, Z, R
backarg2, Y
testarg2, Y, R
# ditto
cleanup2, 1
cleanup2, 1, L
cleanup2, _
cleanup2, _, L
cleanup2, Z
cleanup2, 1, L
cleanup2, Y
backup, Y, L
finishup, Y
finishup, 1, L
finishup, _
finishup, _, L
finishup, X
finishup, 1, L
finishup, W
almostdone, 1, L
almostdone, _ halt, _, R