Question:
Design a Turing machine which computes the sum of two numbers in base $2$. For example, If the input is $110x1$, The machine should return $000x111$ (which means: $6+1=7$)
My try:
At each iteration, decrease the first number by $1$, and increase the second one by $1$. Repeat this until the first number becomes $0$. (I know how to increase and decrease a number in base $2$ using a Turing machine)
Problem:
(I) I don't know what to do if the input is like $111x001$. My algorithm is not general enough to solve this one too.
(II) It seems like the numbers should have the same number of digits. But I'm not sure of that. Can we design the machine without presuming this condition?
I think your representation of $6+1$ as $110x1$ is quite reasonable. Thus, the two numbers do not have to contain the same number of digits, and no number will be preceded by any $0$'s.
Either way, you do need to solve the issue of having to (sometimes) shift the number on the right. This is necessary when the number on the right is all $1$'s, and you are trying to add one more to that.
To solve that, do the following: go to the rightmost digit of the right number. If you see a $1$ replace it with a $0$ and move left and repeat ... if you see an $x$, write a $1$ after the $x$ and add a $0$ at the end of the right number and you are done. If you see a zero change it into a $1$ and you are done.