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:
- sum 2 lowest bits. if sum 0 or one, lowest bit of result. if sum two, lowest bit 0 , have carry.
- 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.
- repeat 2 until bits processed.
for multiplication can use method this one. work program on tm if have in detail.
Comments
Post a Comment