17
Binary Values and Number Systems Chapter 2 Now that we’ve established some common terminology in Chapter 1, our exploration of computing technology can begin in earnest. This chapter describes binary values—the way in which computer hardware represents and manages information. This chapter also puts binary values in the context of all number systems, reminding us of grade school principles that we now take for granted. You probably already know many of the concepts about binary numbers described in this chapter, but you might not realize that you know them! The rules of all number systems are the same; it’s just a matter of going back to those underlying concepts and applying them in a new base. By making sure we have an under- standing of binary values, we pave the way to understanding how computing systems use the binary number system to accomplish their tasks. 33

Cs ill ch2

Embed Size (px)

DESCRIPTION

 

Citation preview

Binary Values and Number Systems

Chapter 2

Now that we’ve established some common terminology in Chapter

1, our exploration of computing technology can begin in earnest.

This chapter describes binary values—the way in which computer

hardware represents and manages information. This chapter also

puts binary values in the context of all number systems, reminding

us of grade school principles that we now take for granted. You

probably already know many of the concepts about binary

numbers described in this chapter, but you might not realize that

you know them! The rules of all number systems are the same; it’s

just a matter of going back to those underlying concepts and

applying them in a new base. By making sure we have an under-

standing of binary values, we pave the way to understanding how

computing systems use the binary number system to accomplish

their tasks.

33

Number A unit of anabstract mathematicalsystem subject to thelaws of arithmetic

Natural number Thenumber 0 and anynumber obtained byrepeatedly adding 1 to it

Negative number Avalue less than 0, with asign opposite to its posi-tive counterpart

Integer A naturalnumber, a negative of anatural number, or zero

Rational number Aninteger or the quotient oftwo integers (division byzero excluded)

34 Chapter 2 Binary Values and Number Systems

GoalsAfter studying this chapter, you should be able to:

� distinguish among categories of numbers.� describe positional notation.� convert numbers in other bases to base ten.� convert base-ten numbers to numbers in other bases.� describe the relationship between bases 2, 8, and 16.� explain the importance to computing of bases that are powers of 2.

2.1 Number Categories

Numbers come in all sorts of categories. There are natural numbers, nega-tive numbers, rational numbers, irrational numbers, and many others thatare important in mathematics but not to the understanding of computing.Let’s review the relevant category definitions briefly.

First, let’s define the general concept of a number: A number is a unitbelonging to an abstract mathematical system and subject to specified lawsof succession, addition, and multiplication. That is, a number is a represen-tation of a value, and certain arithmetic operations can be consistentlyapplied to such values.

Now let’s separate numbers into categories. A natural number is thenumber 0 or any number obtained by repeatedly adding 1 to this number.Natural numbers are the ones we use in counting. A negative number isless than zero, and is opposite in sign to a positive number. An integer isany of the natural numbers or any of the negatives of these numbers. Arational number is an integer or the quotient of two integers—that is, anyvalue that can be expressed as a fraction.

In this chapter we focus on natural numbers and how they are repre-sented in various number systems. As part of that discussion we establishhow all number systems relate to each other. In Chapter 3 we examine thecomputer representation of negative and rational numbers.

Some of the material in this chapter may be familiar to you. Certainlysome of the underlying ideas should be. You probably take for grantedsome basic principles of numbers and arithmetic because you’ve become soused to them. Part of our goal in this chapter is to remind you of thoseunderlying principles and show you that those principles apply to allnumber systems. Then, the idea that a computer uses binary values, 1s and0s, to represent information should be less mysterious.

Positional notation

A system of expressingnumbers in which thedigits are arranged insuccession, the positionof each digit has a placevalue, and the number isequal to the sum of theproducts of each digit byits place value1

Base The foundationalvalue of a numbersystem, which dictatesthe number of digits andthe value of digit posi-tions

2.2 Natural Numbers 35

2.2 Natural Numbers

How many ones are there in 943? That is, how many actual things does thenumber 943 represent? Well, in grade school terms you might say there are9 hundreds plus 4 tens plus 3 ones. Or, said another way, there are 900 onesplus 40 ones plus 3 ones. So how many ones are there in 754? 700 ones plus50 ones plus 4 ones. Right? Well, maybe. The answer depends on the baseof the number system you are using. This answer is correct in the base-10,or decimal, number system, which is the number system we humans useevery day. But that answer is not correct in other number system.

The base of a number system specifies the number of digits used in thesystem. The digits always begin with 0 and continue through one less thanthe base. For example, there are 2 digits in base 2: 0 and 1. There are 8digits in base 8: 0 through 7. There are 10 digits in base 10: 0 through 9.The base also determines what the position of digits mean. When you add1 to the last digit in the number system, you have a carry to the digit posi-tion to the left.

Positional NotationNumbers are written using positional notation. The rightmost digit repre-sents its value times the base to the zeroth power. The digit to the left ofthat one represents its value times the base to the first power. The nextdigit represents its value times the base to the second power. The next digitrepresents its value times the base to the third power, and so on. You areso familiar with positional notation that you probably don’t think about it.We used it instinctively to calculate the number of ones in 943.

9 * 102 = 9 * 100 = 900+ 4 * 101 = 4 * 10 = 40+ 3 * 100 = 3 * 1 = 3

943

A more formal way of defining positional notation is that the value isrepresented as a polynomial in the base of the number system. But what isa polynomial? A polynomial is a sum of two or more algebraic terms, eachof which consists of a constant multiplied by one or more variables raisedto a nonnegative integral power. When defining positional notation, thevariable is the base of the number system. 943 is represented as a polyno-mial as follows, with x acting as the base.

9 * x2 + 4 * x1 + 3 * x0

36 Chapter 2 Binary Values and Number Systems

Let’s express this idea formally. If a number in the base-R number systemhas n digits, it is represented as follows, where di represents the digit in theith position in the number.

dn * Rn�1 + dn�1 * Rn�2 + . . . + d2 * R + d1

Look complicated? Let’s look at a concrete example:63578 in base 10. n is 5 (the number has 5 digits), andR is 10 (the base). The formula says that the fifth digit(last digit on the left) is multiplied by the base to thefourth power; the fourth digit is multiplied by the baseto the third power; the third digit is multiplied by thebase to the second power; the second digit is multipliedby the base to the first power; and the first digit is notmultiplied by anything.

6 * 104 + 3 * 103 + 5 * 102 + 7 * 101 + 8

In the previous calculation, we have assumed thatthe number base is ten. This is a logical assumptionsince our number system is base ten. However, thereis nothing about the number 943 that says it couldn’tbe representing a value in base 13. If so, to determinethe number of ones, we would have to convert it tobase 10.

9 * 132 = 9 * 169 = 1521+ 4 * 131 = 4 * 13 = 52+ 3 * 130 = 3 * 1 = 3

1576

Therefore, 943 in base 13 is equal to 1576 in base 10. Keep in mind thatthese two numbers have an equivalent value. That is, they both represent thesame number of things. If a bag contains 943 (base 13) beans, and anotherbag contains 1576 (base 10) beans, both bags contain the exact same numberof beans. Number systems just allow us to represent values in various ways.

Why would anyone want to represent values in base 13? It isn’t donevery often, granted, but it is sometimes helpful to understand how itworks. For example, there is a computing technique called hashing thattakes numbers and scrambles them, and one way to scramble numbers isto interpret them in a different base.

Other bases, such as base 2 (binary), are particularly important incomputer processing. Let’s explore these bases in more detail.

The Importance of ZeroIt is interesting to note that positional notation isonly possible because of the concept of zero.Zero, which we usually take for granted, was thefundamental concept at the intersection of allbranches of modern mathematics. As GeorgesIfrah noted in his book, The Universal History ofComputing: “To sum up, the vital discovery ofzero gave the human mind an extraordinarilypowerful potential. No other human creation hasexercised such an influence on the developmentof mankind’s intelligence.” 2

In our brief history of computing in Chapter 1, wementioned the abacus as an early computing device.More specifically, the abacus is a device that usespositional notation to represent a decimal number.The beads in any one column represent the digit inthat column. All columns combined represent acomplete number.

The beads above the middle bar represent units of 5and the beads below the bar each represent 1. Beadspushed away from the middle bar do not contribute tothe number. The following diagram shows the number27,091 represented on an abacus:

The user performs calculations by moving the beadsin specific ways to reflect the basic arithmetic opera-

tions of addition, subtraction, multiplication, and divi-sion.

Though ancient, the abacus is still used today inmany Asian cultures. In stores, a checkout clerk mightuse an abacus instead of an electronic cash register.Although lacking some of the advantages of electronicdevices, the abacus is more than sufficient for the kindsof calculations needed for basic business transactions.And skilled users of an abacus can rival anyone with acalculator in terms of both speed and accuracy.

Children in these cultures learn rote operations onthe abacus, much as you were drilled in your multipli-cation tables. To perform an operation on a number,the user executes a series of movements using only thethumb, pointing finger, and middle finger of onehand. These movements correspond to individualdigits and depend on the operation being performed.For example, to add the digit 7 to the digit 5 alreadyshowing on the abacus, the user clears the fivemarker (pushes it to the top), pushes 2 onto the barfrom below, and increments 1 in the next column.Though this move corresponds to the basic additionoperation we do on paper, the abacus user is notthinking about the mathematics. The user is condi-tioned to execute a specific movement when specificdigits are encountered for a specific operation. Whenthe calculation is complete, the user reads the result asshown on the abacus.

Photo courtesy of Theresa DiDonato

Photo courtesy of Theresa DiDonato

The console of the IBM 650, a popular commercialcomputer in the late 1950s, allowed the operator toread the contents of memory using the bi-quinarysystem. This number representation system uses sevenlights to represent the 10 decimal digits.

Each digit is represented by two lights, one of thetop two and one of the bottom five. If the upper-leftlight is on, the five other lights represent 0, 1, 2, 3,

and 4, respectively, from top to bottom. If the upper-right light is on, the five other lights represent 5, 6, 7,8, and 9. The following configuration represents thenumber 7:

The International Business Machine (IBM) 650 wascalled the Ford Tri-Motor of computers: Like the FordTri-Motor, old IBM 650s were shipped to LatinAmerica where they enjoyed an extended life.

0

1

2

3

4

5

6

7

9

8

Photo courtesy of IBM Corporate Archives

The Abacus

Bi-Quinary Number Representation

WWW

38 Chapter 2 Binary Values and Number Systems

Binary, Octal, and HexadecimalThe base-2 (binary) number system is important in computing. It is alsohelpful to be familiar with number systems that are powers of 2, such asbase 8 (octal), and base 16 (hexadecimal). Remember that the base valuespecifies the number of digits in the number system. Base 10 has ten digits(0–9), base 2 has two digits (0–1), and base 8 has eight digits (0–7). There-fore, the number 943 could not represent a value in any base less than base10, because the digit 9 doesn’t exist in those bases. It is, however, a validnumber in base 10 or any base higher than that. Likewise, the number2074 is a valid number in base 8 or higher, but it simply does not exist(because it uses the digit 7) in any base lower than that.

What are the digits in bases higher than 10? We need symbols to repre-sent the digits that correspond to the decimal values 10 and beyond. Inbases higher than 10, we use letters as digits. We use the letter A to repre-sent the number 10, B to represent 11, C to represent 12, etc. Therefore,the 16 digits in base 16 are:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F

Let’s look at values in octal, hexadecimal, and binary to see what theyrepresent in base 10. For example, let’s calculate the decimal equivalent of754 in octal (base 8). As before, we just expand the number in its polyno-mial form and add up the numbers.

7 * 82 = 7 * 64 = 448+ 5 * 81 = 5 * 8 = 40+ 4 * 80 = 4 * 1 = 4

492

Let’s convert the hexadecimal number ABC to decimal:

A * 162 = 10 * 256 = 2560+ B * 161 = 11 * 16 = 176+ C * 160 = 12 * 1 = 12

2748

Note that we perform the exact same calculation to convert the number tobase 10. We just use a base value of 16 this time, and we have toremember what the letter digits represent. After a little practice you won’tfind the use of letters as digits that strange.

Finally, let’s convert a binary (base-2) number 1010110 to decimal. Onceagain, we perform the same steps; only the base value changes:

2.2 Natural Numbers 39

1 * 26 = 1 * 64 = 64+ 0 * 25 = 0 * 32 = 0+ 1 * 24 = 1 * 16 = 16+ 0 * 23 = 0 * 8 = 0+ 1 * 22 = 1 * 4 = 4+ 1 * 21 = 1 * 2 = 2+ 0 * 20 = 0 * 1 = 0

86Recall that the digits in any number system go up to one less than the basevalue. To represent the base value in that base, you need two digits. In anybase, a 0 in the rightmost position and a 1 in the second position representthe value of the base itself. So 10 is ten in base 10 and 10 is eight in base 8and 10 is sixteen in base 16. Think about it. The consistency of numbersystems is actually quite elegant.

Addition and subtraction of numbers in other bases are performedexactly like they are on decimal numbers.

Arithmetic in Other BasesRecall the basic idea of arithmetic in decimal. 0 + 1 is 1, 1 + 1 is 2, 2 + 1 is3, and so on. Things get interesting when you try to add two numberswhose sum is equal to or larger than the base value. For example: 1 + 9.Because there isn’t a symbol for 10, we reuse the same digits and rely onposition. The rightmost digit reverts to 0, and there is a carry into the nextposition to the left. Thus 1 + 9 equals 10 in base 10.

The rules of binary arithmetic are analogous, but we run out of digitsmuch sooner. 0 + 1 is 1, and 1 + 1 is 0 with a carry. Then the same rule isapplied to every column in a larger number, and the process continuesuntil there are no more digits to add. The example below adds the binaryvalues 101110 and 11011. The carry value is marked above each columnin color.

11111 ← carry101110

+ 110111001001

We can convince ourselves that this answer is correct by converting bothoperands to base 10, adding them, and comparing the result. 101110 is 46,11011 is 27, and the sum is 73. 101001 is 73 in base 10.

Binary Octal Decimal

000001010011100101110111

100010011010

01234567

101112

0123456789

10

40 Chapter 2 Binary Values and Number Systems

The subtraction facts that you learned in grade school were that 9 � 1is 8, 8 � 1 is 7, and so on until you try to subtract a larger digit from asmaller one, such as 0 � 1. To accomplish this, you have to “borrow one”from the next left digit of the number from which you are subtracting.More precisely, you borrow one power of the base. So in base 10, whenyou borrow, you borrow 10. The same logic applies to binary subtraction.Every time you borrow in a binary subtraction, you borrow 2. Here is anexample with the borrowed values marked above.

102/ 2 ← borrow

111001� 110

110011

Once again, you can check the calculation by converting all values to base10 and subtract to see if the answers correspond.

Power of Two Number SystemsBinary and octal numbers have a very special relationship to one another:Given a number in binary, you can read it off in octal and given a number inoctal, you can read it off in binary. For example, take the octal number 754.If you replace each digit with the binary representation of that digit, youhave 754 in binary. That is, 7 in octal is 111 in binary, 5 in octal is 101 inbinary, 4 in octal is 100 in binary, so 754 in octal is 111101100 in binary.

To facilitate this type of conversion, the table below shows counting inbinary from 0 through 10 with their octal and decimal equivalents.

2.2 Natural Numbers 41

To convert from binary to octal, you start at the rightmost binary digitand mark the digits in groups of threes. Then you convert each group ofthree to its octal value.

111 101 1007 5 4

Let’s convert the binary number 1010110 to octal, and then convert thatoctal value to decimal. The answer should be the equivalent of 1010110 indecimal, or 86.

1 010 1101 2 6

1 * 82 = 1 * 64 = 64+ 2 * 81 = 2 * 8 = 16+ 6 * 80 = 6 * 1 = 6

86

The reason that binary can be immediately converted to octal and octal tobinary is that 8 is a power of 2. There is a similar relationship betweenbinary and hexadecimal. Every hexadecimal digit can be represented infour binary digits. Let’s take the binary number 1010110 and convert it tohexadecimal by marking of the digits from right to left in groups of four.

101 01105 6

5 * 161 = 5 * 16 = 80+ 6 * 160 = 6 * 1 = 6

86

Now let’s convert ABC in hexadecimal to binary. It takes four binarydigits to represent each hex digit. A in hexadecimal is 10 in decimal andtherefore is 1010 in binary. Likewise, B in hexadecimal is 1011 in binary,and C in hexadecimal is 1100 in binary. Therefore, ABC in hexadecimal is101010111100 in binary.

Rather than confirming that 10001001010 is 2748 in decimal directly,let’s mark it off in octal and convert the octal.

101 010 111 1005 2 7 4

5274 in octal is 2748 in decimal.In the next section, we show how to convert base-10 numbers to the

equivalent number in another base.

Converting from Base 10 to Other BasesThe rules for converting base-10 numbers involve dividing by the base intowhich you are converting the number. From this division, you get aquotient and a remainder. The remainder becomes the next digit in thenew number (from right to left), and the quotient replaces the number tobe converted. The process continues until the quotient is zero. Let’s writethe rules in a different form.

These rules form an algorithm for converting from base 10 to anotherbase. An algorithm is a logical sequence of steps that solves a problem. Wehave much more to say about algorithms in later chapters. Here we showone way of describing an algorithm and show how we can apply it toperform the conversions.

The first line of the algorithm tells us to repeat the next three lines untilthe quotient from our division becomes zero. Let’s convert the decimalnumber 2748 to hexadecimal. As we’ve seen in previous examples, theanswer should be ABC.

While the quotient is not zero

Divide the decimal number by the new base

Make the remainder the next digit to the left in the answer

Replace the decimal number with the quotient

Invented in 1617 by ScotsmanJohn Napier, Napier’s Bones wasa set of rectangular bones (tiles)marked off with numbers at the topof the face and multiples of thatnumber down the face of the tile.Each tile (bone) represented themultiplication table for a singledigit. These bones could be linedup beside one another in a way

that allowed the user to do one-digit multiplication using only addi-tion.

John Napier also invented theslide rule and is given credit fordiscovering the binary numbersystem. For more on Napier andhow to use his bones, see our Website.

Napier’s Bones, An Early Calculation Aid

Reproduced by permission of University ofCalgary

WWW

42

Binary digit A digit inthe binary numbersystem; a 0 or a 1

Bit Short for binarydigit

Byte Eight binarydigits

Word A group of oneor more bytes; thenumber of bits in a wordis the word length of thecomputer.

2.2 Natural Numbers 43

171 ← quotient16)2748

16114112

281612 ← remainder

The remainder (12) is the first digit in the hexadecimal answer, representedby the digit C. So the answer so far is C. Since the quotient is not zero, wedivide it (171) by the new base.

10 ← quotient16)171

1611 ← remainder

The remainder (11) is the next digit to the left in the answer, which isrepresented by the digit B. Now the answer so far is BC. Since the quotientis not zero, we divide it (10) by the new base.

0 ← quotient16)10

010 ← remainder

The remainder (10) is the next digit to the left in the answer, which isrepresented by the digit A. Now the answer is ABC. The quotient is zero,so we are finished, and the final answer is ABC.

Binary Values and ComputersAlthough some of the early computers were decimal machines, moderncomputers are binary machines. That is, numbers within the computer arerepresented in binary form. In fact, all information is somehow representedusing binary values. The reason is that each storage location within acomputer either contains a low-voltage signal or a high-voltage signal.Because each location can have one of two states, it is logical to equate thosestates to 0 and 1. A low-voltage signal is equated with a 0, and a high-voltage signal is equated with a 1. In fact, you can forget about voltages andthink of each storage location as containing either a 0 or a 1. Note that astorage location cannot be empty: It must contain either a 0 or a 1.

Each storage unit is called a binary digit or bit for short. Bits aregrouped together into bytes (8 bits), and bytes are grouped together intounits called words. The number of bits in a word is known as the wordlength of the computer. For example, IBM 370 architecture in the late

From 1943 until her death on New Year’sDay in 1992, Admiral Grace MurrayHopper was intimately involved withcomputing. In 1991, she was awarded theNational Medal of Technology “for herpioneering accomplishments in the develop-ment of computer programming languagesthat simplified computer technology andopened the door to a significantly largeruniverse of users.”

Admiral Hopper was born Grace Brew-ster Murray in New York City on December 9, 1906.She attended Vassar and received a Ph.D. in mathe-matics from Yale. For the next 10 years, she taughtmathematics at Vassar.

In 1943, Admiral Hopper joined the U.S. Navy andwas assigned to the Bureau of Ordnance ComputationProject at Harvard University as a programmer on theMark I. After the war, she remained at Harvard as afaculty member and continued work on the Navy‘sMark II and Mark III computers. In 1949, she joinedEckert-Mauchly Computer Corporation and worked onthe UNIVAC I. It was there that she made a legendarycontribution to computing: She discovered the firstcomputer “bug”— a moth caught in the hardware.

Admiral Hopper had a working compiler in 1952,a time when the conventional wisdom was thatcomputers could do only arithmetic. Although not onthe committee that designed the computer languageCOBOL, she was active in its design, implementation,and use. COBOL (which stands for Common Busi-ness-Oriented Language) was developed in the early1960s and is still widely used in the business dataprocessing.

Admiral Hopper retired from the Navy in 1966,

only to be recalled within a year to full-time active duty. Her mission was tooversee the Navy’s efforts to maintainuniformity in programming languages. Ithas been said that just as Admiral HymanRickover was the father of the nuclearnavy, Rear Admiral Hopper was themother of computerized data automationin the Navy. She served with the NavalData Automation Command until sheretired again in 1986 with the rank of Rear

Admiral. At the time of her death, she was a seniorconsultant at Digital Equipment Corporation.

During her lifetime, Admiral Hopper receivedhonorary degrees from more than 40 colleges anduniversities. She was honored by her peers onseveral occasions, including the first ComputerSciences Man of the Year award given by the DataProcessing Management Association, and theContributors to Computer Science Education Awardgiven by the Special Interest Group for ComputerScience Education, which is part of the ACM (Associ-ation for Computing Machinery).

Admiral Hopper loved young people and enjoyedgiving talks on college and university campuses. Sheoften handed out colored wires, which she callednanoseconds because they were cut to a length ofabout one foot—the distance that light travels in ananosecond (billionth of a second). Her advice to theyoung was, “You manage things, you lead people.We went overboard on management and forgotabout the leadership.”

When asked which of her many accomplishmentsshe was most proud of, she answered, “All the youngpeople I have trained over the years.”

Grace Murray Hopper

1970s had half words (2 bytes or 16 bits), full words (4 bytes), and doublewords (8 bytes).

Modern computers are often 32-bit machines (such as Intel’s Pentium IIIprocessor) or 64-bit machines (such as Compaq’s Alpha processors andIntel’s Itanium processor). However, some microprocessors that are used inapplications such as pagers are 8-bit machines. The computing machine youare using, whatever it is, is ultimately supported by the binary number system.

We have more to explore about the relationship between computers andbinary numbers. In the next chapter we examine many kinds of data and44

see how they are represented in a computer. In Chapter 4 we see how tocontrol electrical signals that represent binary values. And in Chapter 7 wesee how binary numbers are used to represent program commands that thecomputer executes.

Summary

Numbers are written using positional notation, in which the digits arearranged in succession, the position of each digit has a place value, and thenumber is equal to the sum of the products of each digit by its place value.The place values are powers of the base of the number system. Thus, in thedecimal number system, the place values are powers of 10; in the binarynumber system, the place values are powers of 2.

Arithmetic can be performed on numbers in any base represented inpositional notation. The same number facts apply to other bases as they doto base 10. Adding 1 to the largest digit in the base causes a carry into thenext position.

Base 2, base 8, and base 16 are all related because the bases are powers of2. This relationship provides a quick way to convert between numbers inthese bases. Computer hardware is designed using numbers in base 2. A low-voltage signal is equated with 0 and a high-voltage signal is equated with 1.

The Digital DivideOver the past few years, society’s dependence on computer technology

has increased dramatically. The ability to communicate via e-mail and

to access the Internet has become an essential part of every day life for

many Americans. The U.S. Department of Commerce says that over

half of U.S. households were reported to have Internet access in the

year 2000. This means that the other half lack access to the Internet

and/or the technological skills to use it. The term digital divide has

come to represent this disparity between the Information Age “haves”

and “have-nots.”

This gap is of growing social concern. Rural communities, minority

households, low-income families, and people with disabilities do not

have the same Internet access as the more advantaged. In terms of educa-

tion, the quantity and quality of computers and web connections in

Ethical Issues 45

WWW

46 Chapter 2 Binary Values and Number Systems

schools varies greatly across demographic regions. Furthermore, it is not

enough to have the necessary hardware; teachers must have the training

to use the technology and the understanding of it can enhance student

learning. Programs such as the federally supported E-Rate Program,

established in 1996, are responding to these inequalities within schools

and libraries by providing financial discounts to needy schools.

From a global perspective, the digital divide illustrates an additional

challenge that developing nations must face as they make their way

into the international community. Without the necessary telecommuni-

cation infrastructures to support Internet access, emerging countries

are at a serious disadvantage. Only 16 percent of the world’s popula-

tion utilizes 90 percent of its Internet host computers—clear evidence

of this disparity. Indeed, the entire continent of Africa has fewer

Internet connections than New York City. International organizations

are making the technological gap between countries a top priority. The

turn of the millennium saw the creation of the Digital Opportunity

Task force (DOT force), an initiative designed to expand global access

to computer technology. Similarly, in 2001, the UN’s Task Force on

Information and Communications Technology (ICT) was established

to confront the digital divide and bridge the gap between nations.

The digital divide brings to light the serious impact that computer

technology has on society, both domestic and global. It is an issue that

the world will undoubtedly continue to address throughout the 21st

century and into the next.

Key TermsBase pg. 35

Binary digit pg. 43

Bit pg. 43

Byte pg. 43

Integer pg. 34

Natural number pg. 34

Negative number pg. 34

Number pg. 34

Positional notation pg. 35

Rational number pg. 34

Word pg. 43

Exercises1. Distinguish between a natural number and a negative number.

2. Distinguish between a natural number and a rational number.

3. Label the following numbers as natural, negative, or rational.a. 1.333333 d. 2/5b. �1/3 e. 6.2c. 1066 f. π(pi)

Exercises 47

4. How many ones are there in 891 if it is a number in each of thefollowing bases?a. base 10 d. base 13b. base 8 e. base 16c. base 12

5. Express 891 as a polynomial in each of the bases in Exercise 4.

6. Convert the following numbers from the base shown to base 10.a. 111 (base 2) d. 777 (base 16)b. 777 (base 8) e. 111 (base 8)c. FEC (base 16)

7. Explain how base 2 and base 8 are related.

8. Explain how base 8 and base 16 are related.

9. Expand the table on page 40 to include the decimal numbers from 11through 16.

10. Expand the table in Exercise 9 to include hexadecimal numbers.

11. Convert the following octal numbers to binary.a. 766 d. 142b. 101 e. 889c. 202

12. Convert the following binary numbers to octal.a. 111110110 d. 1100010b. 1000001 e. 111000111c. 010000010

13. Convert the following binary numbers to hexadecimal.a. 111110110b. 1000001c. 010000010d. 1100010e. 111000111

14. Convert the following octal numbers to hexadecimal.a. 777b. 605c. 443d. 521e. 1

15. Convert the following decimal numbers to octal.a. 901b. 321c. 1492d. 1066e. 2001

48 Chapter 2 Binary Values and Number Systems

16. Convert the following decimal numbers to binary.a. 45b. 69c. 1066d. 99e. 1

17. Convert the following decimal numbers to hexadecimal.a. 1066b. 1939c. 1d. 998e. 43

18. If you were going to represent numbers in base 18, what symbolsmight you use to represent the decimal numbers 10 through 17 otherthan letters?

19. Convert the following decimal numbers to base 18 using the symbolsyou suggested in Exercise 18.a. 1066b. 99099c. 1

20. Perform the following binary additions.a. 1110011 + 11001b. 1111111 + 11111c. 1010101 + 10101

21. Perform the following octal additions.a. 770 + 665b. 101 + 707c. 202 + 667

22. Perform the following hexadecimal additions.a. 19AB6 + 43b. AE9 + Fc. 1066 + ABCD

23. Perform the following binary subtractions.a. 1100111 � 111b. 1010110 � 101c. 1111111 � 111

24. Perform the following octal subtractions.a. 1066 � 776b. 1234 � 765c. 7766 � 5544

Thought Questions 49

25. Perform the following hexadecimal subtractions.a. ABC � 111b. 9988 � ABc. A9F8 � 1492

26. Why are binary numbers important in computing?

27. A byte contains how many bits?

28. How many bytes are there in one word of a 64-bit machine?

29. Why do microprocessors such as pagers have only 8-bit words?

30. Why is important to study how to manipulate fixed-sized numbers?

Thought Questions1. Exercise 3 asked you to classify π as one of the options. π does not

belong in any of the categories named; π (and e) are transcendentalnumbers. Look up transcendental numbers in the dictionary or in anold math book and give the definition in your own words.

2. Complex numbers are another category of numbers that are notdiscussed in this chapter. Look up complex numbers in a dictionary oran old math book and give the definition in your own words.

3. Many everyday occurrences can be represented as a binary bit. Forexample, a door is open or not open, the stove is on or off, the dog isasleep or awake. Could relationships be represented as a binary value?Discuss the question giving examples.

4. The digital divide puts those that have access to technology on oneside and those that do not on the other. Do you feel that it is the rightof everyone to have access to technology?

5. It will cost a great deal of money to erase the digital divide. Who doyou think should be responsible for paying the cost?

6. Having access to technology is not enough; people must be taught touse the technology they have. How would you define computerliteracy for each of the following groups of people?

• high school students in an industrialized country

• kindergarten teachers in an industrialized country

• college graduates in an industrialized country

• students in sub-Saharan Africa

• college graduates in sub-Saharan Africa

• government officials in the Andes

?