computer science - How to construct this turing machine? -


how can construct tms such accepts(give description only):

a + b = c

a . b = c

input of form a#b#c.

a,b , c belongs {0,1}* , positive binary unsigned integers.

i know can construct tms if input has unary representation how solve if has binary representation?

well, binary addition , multiplication bit more involved in unary case, not difficult. addition:

  1. sum 2 lowest bits. if sum 0 or one, lowest bit of result. if sum two, lowest bit 0 , have carry.
  2. proceed next-lowest bit. sum 2 , possible carry.if sum 0 or one, current bit of result. if sum two, current bit 0 , have carry. if sum three, current bit 1 , have carry.
  3. repeat 2 until bits processed.

for multiplication can use method this one. work program on tm if have in detail.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -