How input string is represented in magnetic tapes?

喜你入骨 提交于 2019-12-25 01:48:48

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!