磁带中输入字符串的表示方式? [英] How input string is represented in magnetic tapes?

查看:115
本文介绍了磁带中输入字符串的表示方式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道在巡回演出的机器中,(不同的)磁带既用于输入,输出,也用于堆栈.在使用图灵机将两个数字相加的问题中,输入要处理许多符号,例如1,0,B(blank),+.

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.)

我的疑问是, 如果输入为BBBBB1111 + 111111BB, 然后用磁带

And my doubt is , If the input is BBBBB1111+111111BB, then in magnetic tape,

1->以北极表示(例如).
0->以南极表示(例如).
B->以无极性表示.

1->represented by North polarity(say).
0->represented by south polarity(say).
B->represented by No polarity.

然后, "+"将如何表示? 我不认为会有一些特殊符号的代码(例如ASCII). 由于特殊符号的数量和类型将取决于实现.特殊的代码也将使算法更加繁琐.

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.

磁带中的输入符号表示形式是否与上述方法完全不同?如果是,请解释.

Is the input symbol representation in tapes is entirely different from the above mentioned method?If yes, please explain.

推荐答案

您可以通过将每个字符编码为多个位来实现.例如:

You would probably do this by having each character encoded with multiple bits. For example:

B: 00
0: 01
1: 10
+: 11

您的读取头的大小将为2,并且在移动时始终会向左或向右移动两步.

Your read head would then have size two and would always move two steps to the left or the right when making a move.

这篇关于磁带中输入字符串的表示方式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆