Sei sulla pagina 1di 11
1 Introduction » 1.1 DIGITAL SYSTEMS IN THE WORLD AROUND US Meet Arianna, Arisnna is a five-year-old girl who lives in California, She's a cheerful, omt- going kid who loves to read, play soccer, dance, and tell jokes that she makes up herself ‘One day, Arianna’s family was criving home from a soccer game. She was in the micle of excitedly talking about the game when suddenly the van in which she was riding was clipped by a car that had crossed over to the wrong side of the highway. Although the accident wasn't particularly bad, the impact caused aaloove items from the rear of the van to project forward inside te van, stiking Arianna in the back of the head. She became Umcanscions ‘Arianna was rushed to 2 hospital, Doctors immediately noticed that her breathing ‘was very Weak—a common situation after a severe blow to the head—so they put her ‘onto a ventilator, which is a medical cevice that assists with breathing. She had sustained brain trauma during the blow to the head, ané she remained unconscious for several weeks. All her vital signs were stable, except she continned to require breathing assis- tance from the ventilator. Patient» in such a situation sometimes recover, and sometimes they don’t. When they do recover, sometimes that recovery takes many months. 2» 1 Introduction Thanks to the advent of modem portable ventilators, Arianna’s parents were given the option of taking her home while they hoped for her recovery. an option they chase, In addition to the remote monitoring of vital signs and the daily at-home visits by a murse and respiratory therapist, Arianna was surrounded by her parents, brother, sister, cousins, other family, and friends. For the majority of the day, someone was holding her hand, singing to her, whis peting, in her ear, or encouraging her to recover. Her sister slept nearby. Some siudies show that such human interaction can indeed increase the chances of recovery. ‘And recover sho did, Several months later, with her mom siting at her side, Arianna opened hier eyes. Later Grat day, she Was transported hack to the hospital. She was weaned from the ventilator, Then, after a lengthy time of recovery and rehabilitation, Arianna finally went home. ‘Today, sia-year-old Arianna shows few signs of the accident that nearly took her lite. What does this story have to do with digital design” Arianna’s recovery was aided by a portable ventilator device, whose invention was possible thanks to digital cir- cuits, Over the past three decades, the amount of digital ‘reuitry that can be stored on a single computer chip has reaseal Crammaically—by nearly 100,000 Lines, believe it or not. Thus, ventilators, along with simast averything else that runs on electricity, ean take advantage of incredibly powerful and fast yet inexpensive digital circuits. The venti- letor in Arianna’s case was the Pulmonetics LTV 1000 ventilator Whereas a ventilator of the early 199s might have been the size of a lange copy machine and cost about $100,000, the LTV 1000 is not much bigges or heavier than this textbook and casts only 2 few thousand dollars—smrall enough, and inexpensive enoagh, to be carried in medical rescue helicopters and ambulances for life-saving situations, aun even to be sent hore with a patient, The digital circuits side contimuily monitor the patient’s Areathing, snd provide just the right amount of air pressure and volume to the patient. Every breath that the device delivers requires. miliions of computations for proper celivery, computations which are carried out by the digital circuits inside (One indicator ofthe rate tha new inventions are deselect dhe mocha of ve atene granted: Inecrty 200,000 a 2a clone from about 500,009 renal ‘epplications). ital Systems in the World Around Us = 3 Portable ventilators help aot only trauma vie tims, but even more commonly hep patients with debilitating diseases, like multiple sclerosis, w gain mobitity. Today, such people can move about in a wheelchsir, and hence do things like attend school visit museums, and take part in a family picnic, cexperioneing a far better quality of life than was fea- sible just « decade age when those people would have been confined to a bed connected to a large, heavy, expensive ventilator. For example, the young girl pictured on the left will likely require a venti- ator for the rest of her life—but she will be able to move about in her wheelchair quite freely, rather than being mostly confined :0 her home. ‘The FTV 1000 ventilatnr deserthed ahove was conceived and designed by a small group of people, pictured oa the left, who sought to build a portable ‘and reliable ventilarcr in order to help people like Arianna and thousands of others like bet (as well ay 1 make some good money doing so!). Those designers probably started off like you, reading text- books and taking courses on digital design, programming, clectronies, and/or other subjects. ‘The ventilator is just one of literally iens of thousands of useful devices that have ‘come about and continue to be created thanks to the era of digital circuits. If you stop and think about haw many devices in the world are made pnssible hecanse of digital cients, you may be quite surprised, A few such devices include: Phoio courtesy of Puliaonetice ‘Antilock brakes, airbags, autofocus cameras, automatic teller machinzs, aircraft controllers ‘and navigarors, camcorders. cash registers, zell phones, computer networks, credit card readers, cruise controllers, defibrillator, cigtal cameras, DVD players, eleetric card readers, clcctronic games, electronic pianos, fax mochinas, fingorprint identifiers, hearing aids, home security systems, modems, pacemakers, pegers, personal computers, personal digital assis- tants, photocopiers, portable music players, robotic arms, scanners, televisions, thermostat coatrollers, TY set-top bones, veniilaters, video game conscles—the list goes on, ‘Those devices wore created by hundreds of thousends of designers, including com- puter scientists, computer cngincers, clectrical engineers, mechanical engineers, and ‘thers, working with people like scientists, doctors, business peuple, and teachers. One ‘hing that seems clear is that new devices will continue to be invented for the foreseeable future—devices that in another decade will be hundreds of times smaller, cheaper, and more powerful than today’s cevices, enabling new applications that we can barely dresm of. Already, we see new applications that seem futuristic but that exist today, ke tiny digitsl-citcuit-controlled medicine dispensers implanted under the skin, voic2-controlled appliances, robotic self-guiding household vacuum cleaners, laser-guided automobile cruise control, handheld phones with full Intemet access, and more. What's not clear is what new and exciting applications will be developed in the future, or who those devices vill benefit. Future designers, like yourscif perhaps, will kelp determine that 4 1 Introduction > 1.2 THE WORLD OF DIGITAL SYSTEMS Digital versus Analog A digual signal, also krown as a discrete signal, is a signal thar at any time ean have one of 4 finite s2t of possible values. In contrast, an anaiag signal can heve ane of an infinite mumber of possible values, and is also known as a continuous signal. A signal is just some physical phenomenon that has a unique value at every instant of time. An everyday example of an analog signal is the temperature outside, because physical temperature is a continuous value—the temperature may be $2.356666... degrees. An everyday example of a digital signal is the number of fingers you hold up, because the value must be cither 0,1, 2, 3,4, 5,6, 7, 8, 9, or 10—a Bite set of values. fa fact, the term “digital” comes from the Latin word for “digit” (digits), meening finger. In computing systems, the most common digital signals are those that esn have one of only two possible values, like on or off (often represented as 1 of 0). Such a two-valued representation is known as a binary representation. A digital systein is 2 system that takes digital inputs and generctes digital outputs. A digital circuit is a connection of digital com ponents that together comprise a digital system. In this textbook, the term “digital” will refer to systems with binary-valued signals. A single binary signal is known as a binary ‘nary digit). Digital electronics became extremely popular in the il-1900s after te invention of the transistor, an elecic switel shat can be turned va or ofl using another electric signal. We'll describe transistors further in the nest chapter, Digital Ci The most well-known use of digttal cireuits in the world around us 1s peob- ably to build the microprocessors that serve as the brain of general-purpose ‘computers, like the personal computer or laptop computer that you might have at home, illustrated in Figure 1.1(a). Genemal-purpese computers are also used as servers, which operate behind the scenes to implement banking, airline reservation, web search, payroll, and similar such systems. General- purpoe computers (ake digital input datas such ay letters and numbers received from files or keybourds, and output new digital data, such as new Figure 1.1 (a)General-parpose letters and! numbers stored in files or displayed on a monitor. Leaming alsout computer (b) Embedded systems About 100,000 wrique nev digial digital design is therefors usefal in understanding how computers work ‘under the hood,” and hence has beea requited learning for most computing ‘and clectrical engineering majors for decades. Based on material in upcoming chapters, we'll design a simple computer in Chapter 8. Digital Circuits are the Basis for Much More Incteasingly, digital cireuits are being used for much move than imple- menting general-purpose computers. More and more mew applications convert analog signals to digital ones, and run those digital sigaals through ‘customized digital circuits, 10 achieve numerous benefits. Such applications, such as those m Figure 1.1(b), include cell phones, automobile engine con- trollers, TV setop boxes, music instruments, digital cameras and camcorders, video game consoles, and so on. Digital circuits found inside applications other then general purpose compucers are often called embedded systems, because those digital systems are embedded inside another elce- feats were designed m 208 onic device. 12 The World of Digital Systems = 5 The world is mosily analog, and therefore many applications were previ ously implemented with analog circuits. However, many implementations have changed or ure changing over to digital implementations, To uader- stand why, notice that although the world is mostly analog, humans often benefit from converting analog signals to digital signals before "pro- cessing” that information, For example, a car horn is actually an analog signal—the volume can take on infinite possible values, and the volume varies over tine due to variations in the baltery strength, winperatare, etc But humans neglect those variations, and instead “digitize” the sound heart into ane of two vaities: the car horn 1s “otf,” oF the car horn 8 “on” (get out of the way!) Converting analog phenomena to digital for use with digital circuits can also vicld bencfits. Let's examine a particular cxample—aucio which erectoe recording. Audio is clearly an analog signal, with infinite possible fre- currentin tte rearty wie quencies and volumes. Consider recording an audia signal like music Figure 1.2 An ‘amicrophone log audio with through a microphone, so that the music can later be played over speakers in an electronic stereo system. One type of microphone, a dynamic microphone, works based on a principle of electromegnetism—moving a aunt nar a wine Causes Changing Current {aml hence voltage) in the wire, 29 illustrated in Figure 1,2, The more the magnet moves. the higher the voltage on the wire. A micro- phone thus has a small membrane sttached to a magnet near a wire—when sound hits the membrane, the magnet moves, causing current in the wire. Likewise, a speaker works on the same principle in reversc—a changing current in a wire will cause a nearby magnet to move, which if attached to a membrane will ereate sound. (If you get a chence, open up aan old speaker—you'll find a strong magnet inside.) If the microphoae is attached directly th the speaker (rough an smplifier that strengthens the microphane’s ouput current), then no digitization 1s required for sound to be captured by the microphone and played by the speaker, But what if the sound should be saved on some sort of media 50 that a song can be recorded now and played back later? The sound can be recorded using analog methods or digital methods, but digital methods Ive many advanlages One advantage of digital metitods is lack of detericration in quality over time. In the 1970s and. 1980s, the audio cassette tape, an analog method, was a common method for recording and playing songs. Audio tape contains on its surface huge numbers of mag- netic patticles that con be moved to particular orientations using a magnet. Thess pauticles hold that orientation even afier the magnct is removed. Thus, magnetism can be used to change the tape’s magnetic particles, some of them up, some higher, some down, ete. This is similar ta how you ean spike: your hair, some up, some: sideways, some down using hair gel. The possible orientations of the tapes magnetic particles, and your hair, are infinite, so the tape is Gefinitely anulog. Recording onto « tape is done by passing the tape under a “head” that generates a megnetic field based on the cleetric current on the wire coming Gow a microphone. The tape’s magnetic particles would thus be inoved to particular orientations. To play a recorded song back, one would pass the tape under the head agam, butt this time the head operates in reverse, generating current on & wire based con the changing magnetic field of the moving tape. That current then gets amplified and sont to the speakers, 6 > 1 Introduction ‘analog signet igtized signal 0991 1019"1111191101000 microprione or Ne 0c01101011111101101009 read from laoe, CD, ete. analog signal 2» reproduced from 7 agiizes signal ‘ool ot to! 10! 11111141 !01!10!10/00 time » [Oo speaker Figure 1.3 Analog-digital conversion: (a) Converting an analog signal toa digital signal, (b) ‘comerting a digital signal to an analog signal. Notice some quality loss in the reproduced ‘signal —the signal (in blue) in (b) roughly follows but Goes not exactly match she signal in (a). A problem with audio tope is that the orientations of the pauticles on the cape's surface change over time—just like a spiked hairéo in the moming eventually fla:tens out throughout the day. Thus, audio tape quality deteriorates over me. Such deterioration is 1 problem with many analog systems. tizing the audio can reduce such deterioration. Digitized audio works as shown in Figure 1,3(a). The figure sows an analog signal on a wire during a periad of time, We sample that signal at paricular time intervals, shown hy the dashed lines, Assuming the analog signal can range from 0 Volts to 3 Volts, and that we plan to store each sample using two bits, then we must round cach sample to the nearest Volt (0, 1, 2, or 3). Each sample appears as a point in the figure, We can store 0 Volts 2s the bw bils 00, | Voll as the two hits 07. 2 Volts as the two bits 10, and 3 Volts as the two hits 17. Thus, the shown analog signal would be converted into the following digital signal: 0001101911111101101C00. This process is called analog-to-digital conversion or Just digitization. To record this digital signal, we just need to store 0s and 1s on the recording media. Regular audio tape could be used, recording a short beep to represent a 1 and no beep to represent a 0, for exanaple. While the audio signal oa the tape will deterio- rate over time, we can still certainly tell the difference between a beep and no beep. just like we can tell the difference between a ear horn being on or off. A slightly quieter beep is still a beep. You've likely heard digitized data communicated using a manner siunilar to such beeps when you've picked up 4 plone being used by a computer und -ven hetter thin auclio tape, the digital signal could he recorried or a fax machine. ing 1.2 The World of Digital Systems = 7 a medic specifically designed to store 05 and 15, For example, the surface of a CD (compact disc) or DVD (digital video disc) can be configured to reflect a laser beam to ia senyor citer strongly or weakly, thus storing 2s wad 9 easily, Likewise, lard disks in computers use magneile particle orlentatton to store 93 and 1s, maxing such dis similar to tape, but enabling fasier access to random parts of the disk since the head move sideways across the top of the spinning disk. ‘To play back this digitized audio signal, the digital value of each sampling period can simply be converted to an analog signal, as in Figure 1.3(b). The process is known digital-to-analog conversion. ‘The. reproduced signal is not an exact replica of the original analog signal. ‘The faster the analog signal is sampled and the more bits used for each sample, the closer the reproduced analog signal will be to the original analog signal—at some point, humars can’t notice the difference between an original audio signal and one that has been digitized and thea converted back to analog, Another advantage of digitized audio is compression. Suppose that each sample will be siored with fen bits, rather than just two bits, to achicve beiter quality due to less rounding. The result is many more bits for the same aucio the signal in Figure 1.3 has eleven samples, and at ten bits per sample, one hundred ten bits would be required (o Sore the audio. Sampling thousands of timey a second results in huge numbers of bits, However, suppose that a particular audio recording has many samples that have the value 9990000000 or the value 1121111112. We could compress the digital file by creating new words using the following scheme: if the first bit of a word is 9, the next bit being 0 means the word should be expanded to the sample 06¢¢000000; the nest bit being 1 means the word should be expanced fo 1111111111. So 00 is shorthand for 0000000000 because the first bit is 9 and the next bit is 0, and 02 is shorthand for 1911117711. If instead tha first hit af a word is a 7, then the next ten hits represent the actual sample. So for 70000001111, the first bit is i, and thus the actual sample is the next ten bits, or 2000002122. Using this compression scheme, the digitized signal “0000009000 oo00CC0000 0000901111 1111111111” would be com- pressed (“OO 00 10000001211 01” The reeviver, which must know the compression scheme, would decompress that compressed signal into the original uncompressed digitized signal ‘There are many other schemes that ean be used to com press digitized audio. Perhaps the mostly widely known audio compression scheme is known as MP3, which is popular for compressing digitized songs. A typical song might require mary teny of megabytes uncompressed, but compressed usually only requites about 3 or 4 megabytes, Thanks to compression (combined with higher-capacity disks), foday’s portable music players can store tens of thousands of songs—a capability undreamt of by most people in the 1990s. Digitized audio is widely used not only in music recording, but also in voiee commmu- nications, For cxample, digital cellular telephones, called cell phones or mobile phones, digitize a person’s voice and then compress the digital signal before wansmitting that s ‘zation enables far more cell phones to operate in a particular region than is possible using analog cell phones. Pictures and video can be digitized in a manner similar to that described for audio, Digital cameras and video recorders, for example, store pictures and video in compressed digital form. Digitized audio, pictures, and video are just a few of the thousands of past and fiature applications that henefit from digitization of analog phenomena. As shawn in 8 > 1 Introducton ‘Satelltes Portable muse players Cell ohones: vn payers Cameras Vito, recorders Musial ster Tvs ™ ——— 1998 Ig97 1399 2001 200320052007 14 More ard more analog prociicts ace becoming primarily digital, 15 Pro ng Primarily digi Figure 1.4, over the past decade numerous products that were previously analog have converted primstily w digital technology. Portable music switched from cassette tapes to digital CDs in the middle 1990s, and recently 10 MP3s and other digital formats. Early cell phones used anslog communication, but in the late 1980s digital communication, similar in idea to that shown in Figure | inant, In the early 20005, analog VHS video players gave way 10 digital video dise (DVD) players, and then to hard-drive-based digital video recorders (DVRs). Portable video cameras have begun io digitize video before storing the video oato tape or 2 hard drive, while still picture cameras have eliminated’ film and stare photos on d decades, such ay clocks aml watches, houseliold hermontals, nu mometers (which now work in the ear rather tha engine controllers, gasoline pumps, hearing aids, and more, Many other devices were never analog, instead being introduced in digital form from the very scart. For example, Musical instruments are increasingly digital-based, with electronic drums, keyboards, and electric guitars including more digital processing, Analog TV is also giving way to digital TV. Ifundreds of other devices aave converted from analog to éigital in past nt video games have been digital since their inception. The ubove devices use digitization, and digitization requires that phenomena be enended into “5 and 05 Computations using digital circ digitized into 1s and Cs, The next section describes how to encode items digitally. ‘The telephnove, patented by Alexander Graliam Bellin the late 1800s (though invented by Anionic Meucei), operates using the electromagnetic principle described carlies—your speech creates sound waves that move a ‘membrane, which moves a magnet, which creates ‘current on 3 noarby wire. Run that wire to somewaer= {fac away, put a magnet connected to a membrane near that wire, and the membrane ‘will move, producing sound waves that sound like you talking. Much of the {clephore system today digitizes the audio to impcowe quality and quantity of audio transmissions over long distances. A couple of interesting facts about the Aelephore: + Balicve it or not, Western Union setually turned down Bell's iniial proposal to develop the telephone, pethaps thinking that the then-popular Ielegraph was all poople needed. + Bell nd his sistant Wawson disagreed_on ow 1 answer the hone: Watson wanted Helle” which won, ‘but Bell wanted “Hoy hoy” instead. (Fans of the TV show The Simpsons may have noticed that Homer's boss, Mr Buras, sarswers the plaaae wih “hoy hoy.) An carly-styie telephone. ‘Soares of some of the above material: www phe ong, sranserpt of “The Telephone”) layers, for example, became dom- a cards perature thei inder the tongue or other places), car 50 requna that numbers he 12 The Worid of Digtal Systems = 9 Digital Encodings and Binary Numbers—0s and 1s analog Dightal System digital iit ta ata Dek elect signa actustors and thar outputs Se Figure 15 A typical digital system. lemperature sensor Dotoood) “us 23 cegrees" Figure 16 t4eat that oumpwts digital dara ‘The previous section showed an example of a digital system, which involved digitizing an audio signal into bits that could then be processed using a digital circuit to achieve several benefits, Those bits encoded the data of imterest. Encoding data into bits is a central task in digital systems. Same of the data to process may already be in digital form, while other dia may be in anclog form (e.g., cudio, video, temperature) and thus require conversion to digital data first, as illustrated at the top of Figure 1.5. A digital system takes digital data as input, and produces digital data as output. Encoding Analog Phenomena Any analog phenomena can be digitized, and hence applications that digitize analog pheaomena exist in x wide variety of domains. Automobiles digitize information about the engine temperature, car speed, fuel level, etc., so that an on-chip computer can monitor and control the vehicle. The ventilator introduced eariier digitizes the measure of the cir flowing into the patient, so that a computer can make calculations on how much additional flow te provide. Digitizing analog phenomena requires: ‘+ Asensor that measures the analog physical phenomena and converts the measured value to an analog electrical signal. One example is the microphone (which mea- sures sound) in Figure 1.3. Other examples include video capture devices (which ‘measure light), thermometers (which measure temperature), and speedometers (owhich measure speed) + An analog-to-digital converter that converts the electrical signal into binary encodings. The converter must sample (measure) the electrical signal at a partic- ular rate and convert each sample to some value of bits. Such a converter was featured in Figure 1.3, anc is shown as the A2D component in Figure 1.5. Likewise, a digital-to-analog converter (shown as 124 in Figure 15) converts bits back to an electrical signal, and an actuator converts that electrical signal back to phys- ical phenomena, Sensors and actuotors together represent types of devices known us trunsducers—devices that convert ye foun of energy to anether Many examples in this book will utilize idealized sensors that themselves directly output digitized data, For instance, an example might use a temperature sensor that reads the present temperature and sets its 8-bit output to an encoding representing the tempora- tare ass binary number, as in Figure 1.6 (sce next sections for binary aumber encudings). Encoding Digital Phenomena Other phenomena are inherently digital. Such phenomena can only take on one value at a time from a finite set of values. Some digital phenomena can take on only one of two pos- sible values at a time, and thus can be straightforwardly encoded as a single bit. For ‘example, the following types of sensors may output an electrics signal that takes an one of two values at a time: 10 1 Introduction + Motion sensor: outputs « positive voltage (say +3 V) when motion is sensed, O volts when no motion is sensed. V when dark. + Button (sensor): ontputs = positive voltage when the button is pressed, (0. when ‘not pressed. + Light sensor: outputs a positive voltage when ligat is sensed, We can straightforwerdly encode each sensor's output to a bit, with 1 ropresenting the positive voltage and 0 representing OV, as for the button in Figure 1.7. Examples button throughout this book utilize idealized sensors that directly output the encoded bit value. Cother digital phenomena can assume several possible values. Kor example, a keypad ¢ may have four buttons, colored red, blue, green, and black, 2s in Figure 1.8, A designer 1 right create a cireuit such that when red is pressed, the keypad’s three-bit ouput has the ‘value 002; blue outputs 010, green 022, and black 109. Ifne button is pressed, the output is 000. ‘An even more general digital phenomenon is the Fnglish alphabet. Rach char- acter comes from a finite set of characters, so typing on a keyboard results in Ced))(Live)( green’) black )| digital, not analog, data. The digital data can be converted to bits by assigning a bit, Ce) es Cues) Hak) ‘encoding to cach character. A popular encoding of English characters is known as SCT, which stands for Anterican Stanklard Code for Infornvation Interchange, znd is pronounced as “askey.” ASCII encodes each character into seven bits. For example, the ASCH encoding for the uppetcase letter ‘A’ 1s “1000601,” and for “L' is “1000020.” A lowerease ‘a’ is “1100001,” and ‘b’ is “1100030.” Thus, the name “ABBA” would be encoded as “1000001 1000010 1900010 1999001." ASC detines 7-bit encedings for all 26 leters (upper- and lowercase), the numer ical symbols 0 through 9, punctuation marks. and even a number of encodings for rnonprintahle “ennrol” operations. There are 128 encodings tial in ASCH A subset fof ASCII encodings is shown in Figure 1.9. Another encoding, Unicode, is increasing in popularity due to its support of internstional languages. Unicode uses 16 bits per character, instead of just the 7 bits used in ASCH, and represents charac- ters from a diversity of languages in the world, o Figure 1.7. bution is easily eaceded as a bit. Figuro 18 Keypad encodings “10 G09 c1o.0001 | 100010) ct100010/ = A 1007710] ON = Rope Bem] 0 mtd] y c100100| $ c 1070000) 4414010) c100101 | % s 1010001) © ciootto| @ 00101! E —rorocto] 140000] 0 cmon| = tooaa] F —torectt| § orton | Grow) ¢ 9001! @ toro] + — oirearo| ere] font} oH tononor] Sagem] 2 mpi | 2 | (teeter! | Hovona|| vy | leone] tino] + oro] totem | W oner| ¢ 101100), men) © 1011000] x ono] 6 ciosor| 2 moron! 1 sorseor| ¥ Sirens] 7 e10 1110 toorier| Mm mse] 2 organo] aon | i aii | a Figuro 1.9 Sample ASCII encod 408 109 12 40! 108° Figure 1.19 Base ven umber system, Figure 1.17 Base twe smumber system, {saw ihe folowing on ‘a Phir, sa found it rather fy “There ere types of people in the work those who get Bary, tnd those who don't” were t Figure 1.412 Base wwe ‘number system showing, ‘weights inbase ten, 1.2 The World of Digital Systems 11 Encoding Numbers as Binary Numbers Perhaps the most important use of digital circuits is to pesform arithmetic computations. In fact, a key driver of carly digital computer design was the arittinetic computation of ballistic trajectories in World War IL To perform arithmetic computations, we need @ Way toencode numbers as bits—we need binary numbers. ‘To understand binary numbers, first refreshing our understanding of decimal ‘numbers can help. Decimal numders use a hese ten numbering system. Beso ten is a num- ing LT ina nai TIKURepRRaEN UA NROREN ORE (10) paste, ANS next digit represents the number of groups of tens (10*) present (meaning that the digit’s place has a weight of 10!), the next digit’s place nas a weight of (10*), and so on, as tlus- trated in Figure 1.10. So the digits “523” in base 10 represent 5*10? + 2*10! + 3*10°. With an understanding of base ten numbers, we ean introduce buse two numbers, known as binary numbers. Becouse digital circuits operate with valucs that are cither “on” or “off.” such circuits need only two symbols, rather than ten symbols, Let those two symbols he @ and 1. If we need to represent a quantity more than 1. we'll use anevher digit, whose weight will be 2'. So “20” in base two represents 1 two and 0 ones. Be careful not to call that 10 “ten” or “ten, base two” (which makes: no sense) instead, you might say “onc zero, base two.” If we need a bigger quantity, we'll use another digit, whose weight will be 2’. The weights for the first few digils im base two are shown it Figure 1.11. For a given binary number. the Towest-weight (rightmost) digit is called the Least significant bit, and the hignest-weight (leftmost) digit 1s the mast significant bt. For example, the number 101 in base two equals 1*2° + 0*2" + 19, or 5 in base ten, 102 ean be spoken as “one zero one, base two.” Definitely do nor suy “one hundred ane, base two.” 101 is one hundred one if in base ten, but the leftmest 1 does not repre sent one hundred when in base wo. When we are writing mimhers of different hases snd the hase of the rnmher is rat obvious, we can indicate the base with a subscript, a follows: 101, = Sy. We might speak this as “one zero one in base two equals five in base ten.” This book usually dis plays binary numbers using a different font, e.g., £01, to readily distinguish binary numbers from decimal numbers. Note thai because binary isn't as popular as decimal. people haven't created short names for its weights of 21,22, and so oa. like they ave for weights in base ten (bun- dreds, thousands, millions, ete). Instead, people just use the equivalent base ten name for cach buse two group—a source of confusion te some people just learning binary. Never theless, it may still be easier to think of cack weight in base two using base ten nnames—one, no, four, eight—rather than increasing powers of two, as in Figure 1. Homens have ten fingess so they chase a numbering, system where cach digit cam represent ten possible ‘ales. here's nothing magical shout hase ten, tf fumans had nine fingers, they would probably uses fase nine numbenmg system. Ir tums our that hase twelve was used somewhat in the past too, because by ‘using oar thomb, we con easily pont to twelve different spors on the remaming four fingers on shar ‘thumas’s aand—the fave tops of those fingers, the Zour rll parts of those fingers, ard the four bottoms of thase fingers. "That may partly explain why twelve 1s ‘common in hemen counting feeay, ike the use of the term “dozen.” and the tweive hous at a clock (Source: fdews anu Information, Arno Penzias, WNW. Neston and Company.)

Potrebbero piacerti anche