YP.1.6 Computers as Universal Computational Devices(双语)

from:

[1] Introduction to Computing System, from Bits and Gates to C and Beyond. Yale N. Patt and Sanjay J. Patel. McGraw-Hill Higher Education.(英)

[2] 计算系统基础_陈道蓄_第一章引言http://resource.jingpinke.com/details?uuid=ff808081-22c93527-0122-c936e141-1a96&objectId=oid:ff808081-22c93527-0122-c936e141-1a97 (中)

1.6 Computers as Universal Computational Devices

It may seem strange that an introductory textbook begins by describing how computers work. After all, mechanical engineering students begin by studying physics, not how car engines work. Chemical engineering students begin by studying chemistry, not oil refineries. Why should computing students begin by studying computers?

The answer is that computers are different. To learn the fundamental principles of computing, you must study computers or machines that can do what computers can do. The reason for this has to do with the notion that computers are universal computational devices.Let's see what that means. 

Before modern computers, there were many kinds ofcalculating machines. Some wereanalog machines—machines that produced an answer by measuring some physical quantity such as distance or voltage. For example, a slide rule计算尺 is an analog machine that multiplies numbers by sliding one logarithmically对数 graded ruler next to another. The user can read a logarithmic "distance" on the second ruler. Some early analog adding machines worked by dropping weights on a scale. The difficulty with analog machines is that it is very hard to increase their accuracy. 

This is why digital machines—machines that perform computations by manipulating afixed finite set of digits or letters—came to dominate computing. You are familiar with the distinction between analog and digital watches. An analog watch has hour and minute hands, and perhaps a second hand. It gives the time by the positions of its hands, which are really angular measures. Digital watches give the time in digits. You can increase accuracy just by adding more digits. For example, if it is important for you to measure time in hundredths of a second, you can buy a watch that gives a reading like 10:35.16 rather than just 10:35. How would you get an analog watch that would give you an accurate reading to one one-hundredth of a second? You could do it, but it would take a mighty long second hand! When we talk about computers in this book, we will always

mean digital machines

Before modern digital computers, the most common digital machines in the West wereadding machines. In other parts of the world another digital machine, theabacus, was common. Digital adding machines were mechanical or electromechanical devices that could perform a specific kind of computation: adding integers. There were also digital machines that could multiply integers. There were digital machines that could put a stack of cards with punched names in alphabetical order. The main limitation of all of these machines is that they could do only one specific kind of computation. If you owned only an adding machine and wanted to multiply two integers, you had some pencil and paper work to do.

This is why computers are different. You can tell a computer how to add numbers. You can tell it how to multiply. You can tell it how to alphabetize a list or perform any computation you like. When you think of a new kind of computation, you do not have to buy or design a new computer. You just give the old computer a new set of instructions (or program) to carry out the computation. This is why we say the computer is auniversal computational device.Computer scientists believe thatanything that can be computed, can be computed by a computer provided it has enough time and enough memory. When we study computers, we study the fundamentals of all computing. We learn what computation is and what can be computed.

The idea of a universal computational device is due toAlan Turing. Turing proposed in 1937 that all computations could be carried out by a particular kind of machine, which is now called aTuring machine. He gave a mathematical description of this kind of machine, but did not actually build one. Digital computers were not operating until 1946. Turing was more interested in solving on paper, writing symbols according to certain rules when other symbols are present, and so on. He abstracted these actions and specified a mechanism that could carry them out. He gave some examples of the kinds of things that these machines could do. One Turing machine could add two integers; another could multiply two integers.

 

Figure 1.4 provides what we call "black box" models of Turing machines that add and multiply. In each case, the operation to be performed is described in the box. The data on which to operate is shown as input to the box. The result of the operation is shown as output from the box. A black box model provides no information as to exactly how the operation is performed, and indeed, there are many ways to add or multiply two numbers.

Turing proposed that every computation can be performed by some Turing machine. We call thisTuring's thesis.Although Turing's thesis has never been proved, there does exist a lot of evidence to suggest it is true. We know, for example, that various enhancements one can make to Turing machines do not result in machines that can compute more.

Perhaps the best argument to support Turing's thesis was provided by Turing himself in his original paper. He said that one way to try to construct a machine more powerful than any particular Turing machine was to make a machine that could simulate all Turing machines. You would simply describe toUthe particular Turing machine you wanted it to simulate, say a machine to add two integers, giveUthe input data, andUwould compute the appropriate output, in this case the sum of the inputs. Turing then showed that there was, in fact, a Turing machine that could do this, so even this attempt to find something that could not be computed by Turing machines failed.

 

Figure 1.5 further illustrates the point. Suppose you wanted to compute g (e+f )  You would simply provide toUdescriptions of the Turing machines to add and to multiply, and the three inputs,e,, andg. U would do the rest. 

In specifying U, Turing had provided us with a deep insight: He had given us the first description of what computers do. In fact, both a computer (with as much memory as it wants) and a universal Turing machine can compute exactly the same things. In both cases you give the machine a description of a computation and the data it needs, and the machine computes the appropriate answer. Computers and universal Turing machines can compute anything that can be computed because they are programmable

This is the reason that a big or expensive computer cannot do more than a small, cheap computer. More money may buy you a faster computer, a monitor with higher resolution, or a nice sound system. But if you have a small, cheap computer, you already have a universal computational device.

1.6  作为通用计算设备的计算机

    学习机械工程的学生首先学习物理,而不是学习汽车引擎如何工作。学习化学工程的学生首先学习化学,而不是原油精炼。但是学习计算专业的学生首先却要学习计算机,为什么?

     为了学习计算的基本原理,你必须学习计算机(机器)。这个原因与计算机是通用计算设备的概念有关。我们来看看通用计算设备意味着什么。

     在现代计算机出现之前,已经出现了许多种计算机器。其中有些是模拟机,即通过测量一些物理量(如距离或电压)得出结果的机器。例如,计算尺就是一个模拟机,它依靠两个标有对数的尺子的相对移动来做乘法。使用者可以在第二个尺子上读到一个对数“距离”。一些早期的模拟加法机器通过在一个天平上滴重进行工作。模拟机器的难题是很难提高它们的精度

     这就是为什么数字机(那些处理固定的有限的数字或字母的机器)开始支配计算的原因。你应当很熟悉模拟手表与数字手表的区别。模拟手表有时针、分针,和秒针。它依靠针的位置指示时间,事实上就是根据角度的测量。数字手表用数字指示时间,你可以靠增加位数来增加精度。例如,如果测量百分之一秒对你很重要,你可以买一块显示10:35.16而不是10:35的手表。但是如何让一块模拟手表指示百分之一秒的精度呢?或许可以做到,但是必须有一根非常长的秒针。当我们在本书中讨论计算机时,我们指的是数字机。

     在现代计算机出现之前,数字加法器是可以进行加法的机械或电子设备,它只能执行一种特定的运算——加数字。也有做乘法运算的乘法器。还有一些将一叠卡片按字母排序打孔的机器。所有这些机器的主要限制是它们只能做一种特殊运算。如果你只有一台加法器而你想做乘法,那么你需要用笔和纸做。

    这就是为什么计算机是不同的。你可以告诉计算机如何加数字。你也可以告诉计算机如何作乘法。你还可以告诉计算机如何排序或者做任何你想做的计算。当你想做一种新的计算时,你不必重新购买或设计一台新计算机。你只要给原有的计算机一串新指令或程序去进行计算。这就是为什么我们称计算机为通用计算设备的原因。计算机科学家认为一台计算机能做任何可以计算的事,只要它有足够的时间与存储器当我们学习计算机时,我们学习所有计算的基础。我们学习什么是计算以及什么可以被计算

    通用计算设备的想法要归功于阿兰·图灵。图灵在1937年提出所有计算都可以由一种特殊的机器完成,这种机器现在被称作图灵机。他给出了这种机器的数学描述,但没有真正实现它。数字计算机直到1946年才被建成。图灵对解决哲学问题更感兴趣:为计算下定义。他开始观察当人们进行计算时的种种行为,包括在纸上做标记,根据某种规则符号,等等。他将这些行为进行抽象并得出一种可以实现它们的机制。他给出了这些机器可以做的工作的一些例子。一种图灵机可以计算两个数的和,另一种可以计算两个数的积。

    图1.4给出了加法和乘法图灵机的黑盒模型。在每种情况下,将要执行的操作在盒中描述。将要计算的数据描述为盒子的输入。计算的结果被描述为盒子的输出。黑盒没有提供关于如何进行具体的计算的信息,实际上,有很多方法可以实现加或乘两个数。

    图灵提出每种计算都能被某种图灵机实现。我们把这种理论称为“图灵论题”。尽管图灵的论题从未被证实过,但确实存在许多证据表明它是正确的。例如,我们知道,对图灵机所作的种种提升并不意味着机器能做更多的计算。

    也许支持图灵论题的最好论据是图灵自己提供的。他说,建立一种比任何特定的图灵机功能更强大的机器就是建立一种可以模拟所有图灵机的机器U。你可以向U描述你想要它模拟的特定的图灵机,比如一个使两个数相加的机器,向U输入数据,U就会计算恰当的输出——在这种情况下是两个输入值的和。图灵又证明了实际上存在一种这样的图灵机,即使是寻找图灵机所不能做的计算的尝试也是失败的。

图1.5进一步显示了这一点。假设你想计算g*(e+f),你只需要提供给U图灵机加和乘操作,再输入三个操作数:e、f和g。U图灵机将会做剩下的计算。

为了表示U图灵机,图灵展现了他深刻的洞察力:他第一次为我们描述了计算机能够做什么。事实上,一台计算机(不管拥有多大的存储器)和一台通用图灵机在计算同样一件事上效果是一样的。对这两种机器,你只要告诉它要做的操作和操作数,那么机器将会计算出同样适当的结果。也就是说,计算机和通用图灵机能够计算任何只要能够计算的事,这是因为它们都是属于可编程的。

这就是为什么一台容量大而且昂贵的计算机不会比一台容量小而且便宜的计算机做更多的事情。有再多的钱也许会使你拥有一台速度更快的计算机,一个质量更高的显示器,或者是一个更好的系统,但是如果你拥有一台小容量而且便宜的计算机,那么你也就拥有了一台所谓的通用计算设备了。


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值