A TM that can perform division on two positive unary numbers is developed based on the concept that “division is extended subtraction”. That concept and the implementation steps have been clearly described in the notes “Turing Machines and Equivalent Models-II’’. The main body of this TM is shown in the first figure below and the portions that perform Step 3 and Step 4 are shown in the second and the third figures separately. Your tasks here is to fill out the blanks in the second and the third figures so that these two portions can be connected to the proper nodes of the main body of the TM correctly.
(n (current) m) 0 Portion of the 0, R TM for Step 3
Start
A A, L1 X
A, R
7 0
1, R
0
B, R
0
X, R
O, R
0, L
7 0
0, R
B B, R B, R
1, R
1, R
1, L X, L
1, L
1, R
Q, R
Portion of the TM for Step 4 n > (current m)
1, R
1, R
n < current m
(n > (current) m)
0, 1
Q Q, R
0, L
X, R
1, L
1, R
Q, R
1 1, L
1 1, R
1
1, R
1, L
1, R