正在加载图片...
4 I.Preliminaries Figure 1.1 if this bit Operations on bits. flip this bit zero this bit is 1,flip this bit 01011 01011 01011 if this bit flip this bit zero this bit is 1,flip this bit 01001 01001 01011 01101 01001 11011 Flipping Zeroing Testing different to an observer:one might resemble a television set with a keyboard,while the other might be buried under the dials and knobs of an automatic knitting machine. However,the outward appearance is of peripheral importance when compared to the bits and their internal arrangement.It is the bits that"sense"the external stimuli arriving from the outside world via buttons,levers,keys on a keyboard,electronic communication lines,and even microphones and cameras.It is the bits that"decide" how to react to these stimuli and respond accordingly by directing other stimuli to the outside via displays,screens,printers,loudspeakers,beepers,levers,and cranks. How do the computers do it?What is it that transforms such trivial operations on bits into the incredible feats we see computers perform?The answer lies in the central concepts of this book:the process,and the algorithm that prescribes it and causes it to take place. Some Gastronomy Imagine a kitchen,containing a supply of ingredients,an array of baking utensils, an oven,and a (human)baker.Baking a delicious raisin cake is a process that is carried out from the ingredients,by the baker,with the aid of the oven,and,most significantly,according to the recipe.The ingredients are the inputs to the process, the cake is its output,and the recipe is the algorithm.In other words,the algorithm prescribes the activities that constitute the process.The recipes,or algorithms,rel- evant to a set of processes under discussion are generally called software,whereas utensils and oven represent what is generally known as hardware.The baker,in this case,can be considered a part of the hardware(see Figure 1.2). As in the case of bit operations,the baker/oven/utensils constellation has very limited direct abilities.This cake-baking hardware can pour,mix,spread,drip,light the oven,open the oven door,measure time,or measure quantities but cannot directly bake cakes.It is the recipes-those magical prescriptions that convert the limited abilities of kitchen hardware into cakes-and not ovens or bakers,that are the subject of this bookP1: GIG PE002-01drv PE002-Harel PE002-Harel-v4.cls February 25, 2004 14:38 4 I. Preliminaries 01011 01001 01101 flip this bit flip this bit Flipping 01011 01001 01001 zero this bit zero this bit Zeroing 01011 01011 11011 if this bit is 1, flip this bit if this bit is 1, flip this bit Testing Figure 1.1 Operations on bits. different to an observer: one might resemble a television set with a keyboard, while the other might be buried under the dials and knobs of an automatic knitting machine. However, the outward appearance is of peripheral importance when compared to the bits and their internal arrangement. It is the bits that “sense” the external stimuli arriving from the outside world via buttons, levers, keys on a keyboard, electronic communication lines, and even microphones and cameras. It is the bits that “decide” how to react to these stimuli and respond accordingly by directing other stimuli to the outside via displays, screens, printers, loudspeakers, beepers, levers, and cranks. How do the computers do it? What is it that transforms such trivial operations on bits into the incredible feats we see computers perform? The answer lies in the central concepts of this book: the process, and the algorithm that prescribes it and causes it to take place. ■ Some Gastronomy Imagine a kitchen, containing a supply of ingredients, an array of baking utensils, an oven, and a (human) baker. Baking a delicious raisin cake is a process that is carried out from the ingredients, by the baker, with the aid of the oven, and, most significantly, according to the recipe. The ingredients are the inputs to the process, the cake is its output, and the recipe is the algorithm. In other words, the algorithm prescribes the activities that constitute the process. The recipes, or algorithms, rel￾evant to a set of processes under discussion are generally called software, whereas utensils and oven represent what is generally known as hardware. The baker, in this case, can be considered a part of the hardware (see Figure 1.2). As in the case of bit operations, the baker/oven/utensils constellation has very limited direct abilities. This cake-baking hardware can pour, mix, spread, drip, light the oven, open the oven door, measure time, or measure quantities but cannot directly bake cakes. It is the recipes—those magical prescriptions that convert the limited abilities of kitchen hardware into cakes—and not ovens or bakers, that are the subject of this book
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有