问题
I know that in turing machines, the (different) tapes are used for both input and output and for stack too. In a problem of adding 2 numbers using turing machine, the input is dealing with many symbols like 1,0,B(blank),+.
(Tough this questions is related to physics, I asked here since I thought they mayn't know about turing machines and their inputs.)
And my doubt is , If the input is BBBBB1111+111111BB, then in magnetic tape,
1->represented by North polarity(say).
0->represented by south polarity(say).
B->represented by No polarity.
Then, How '+' will be represented? I doesn't think that there will be some codes(like ASCII) for special symbols. Since the number and type of special symbols will be implementation dependent. Also special codes will make the algorithm more tedious.
or
Is the input symbol representation in tapes is entirely different from the above mentioned method?If yes, please explain.
回答1:
You would probably do this by having each character encoded with multiple bits. For example:
B: 00
0: 01
1: 10
+: 11
Your read head would then have size two and would always move two steps to the left or the right when making a move.
回答2:
Symbol: Representation
0:1 ; 1:11 ; 2:111 ; n:n+1 ; Blank:B
来源:https://stackoverflow.com/questions/7366085/how-input-string-is-represented-in-magnetic-tapes