Titulo

Solo disponible en BuenasTareas
  • Páginas : 9 (2157 palabras )
  • Descarga(s) : 0
  • Publicado : 17 de agosto de 2012
Leer documento completo
Vista previa del texto
CHAPTER

NUMBER SYSTEMS
19.1 The Decimal System 19.2 The Binary System 19.3 Converting between Binary and Decimal Integers Fractions 19.4 Hexadecimal Notation 19.5 Key Terms and Problems

19-1

19-2

CHAPTER 19 / NUMBER SYSTEMS

19.1 THE DECIMAL SYSTEM
In everyday life we use a system based on decimal digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) to represent numbers and refer to the systemas the decimal system. Consider what the number 83 means. It means eight tens plus three: 83 = (8 * 10) + 3 The number 4728 means four thousands, seven hundreds, two tens, plus eight: 4728 = (4 * 1000) + (7 * 100) + (2 * 10) + 8 The decimal system is said to have a base, or radix, of 10. This means that each digit in the number is multiplied by 10 raised to a power corresponding to that digit’sposition: 83 = (8 * 101) + (3 * 100) 4728 = (4 * 103) + (7 * 102) + (2 * 101) + (8 * 100) The same principle holds for decimal fractions but negative powers of 10 are used. Thus, the decimal fraction 0.256 stands for 2 tenths plus 5 hundredths plus 6 thousandths: 0.256 = (2 * 10-1) + (5 * 10-2) + (6 * 10-3) A number with both an integer and fractional part has digits raised to both positive andnegative powers of 10: In general, for the decimal representation of X = E Á d2d1d0.d-1d-2d-3 Á F, the value of X is 472.256 = (4 * 102) + (7 * 101) + (2 * 100) + (2 * 10-1) + (5 * 10 - 2) + (6 * 10-3) X = a (di * 10 i)
i

(19.1)

19.2 THE BINARY SYSTEM
In the decimal system, 10 different digits are used to represent numbers with a base of 10. In the binary system, we have only two digits, 1 and0. Thus, numbers in the binary system are represented to the base 2. To avoid confusion, we will sometimes put a subscript on a number to indicate its base. For example, 8310 and 472810 are numbers represented in decimal notation or, more briefly, decimal numbers. The digits 1 and 0 in binary notation have the same meaning as in decimal notation: 02 = 010 12 = 110

19.3 / CONVERTING BETWEENBINARY AND DECIMAL

19-3

To represent larger numbers, as with decimal notation, each digit in a binary number has a value depending on its position: 102 = (1 * 21) + (0 * 20) = 210 112 = (1 * 21) + (1 * 20) = 310 1002 = (1 * 22) + (0 * 21) + (0 * 20) = 410 and so on. Again, fractional values are represented with negative powers of the radix: In general, for the binary representation of Y = E Áb2b1b0.b-1b-2b-3 Á F, the value of Y is 1001.101 = 23 + 20 + 2-1 + 2-3 = 9.62510 Y = a (bi * 2i)
i

(19.2)

19.3 CONVERTING BETWEEN BINARY AND DECIMAL
It is a simple matter to convert a number from binary notation to decimal notation. In fact, we showed several examples in the previous subsection. All that is required is to multiply each binary digit by the appropriate power of 2 and add theresults. To convert from decimal to binary, the integer and fractional parts are handled separately.

Integers
For the integer part, recall that in binary notation, an integer represented by bm - 1bm - 2 Á b2b1b0 has the value (bm - 1 * 2m - 1) + (bm - 2 * 2m - 2) + Á + (b1 * 21) + b0 Suppose it is required to convert a decimal integer N into binary form. If we divide N by 2, in the decimalsystem, and obtain a quotient N1 and a remainder R0, we may write N = 2 * N1 + R0 R0 = 0 or 1 Next, we divide the quotient N1 by 2. Assume that the new quotient is N2 and the new remainder R1. Then N1 = 2 * N2 + R1 so that N = 2(2N2 + R1) + R0 = (N2 * 22) + (R1 * 21) + R0 If next N2 = 2N3 + R2 R1 = 0 or 1 bi = 0 or 1

19-4

CHAPTER 19 / NUMBER SYSTEMS

we have N = (N3 * 23) + (R2 * 22) + (R1* 21) + R0 Because N 7 N1 7 N2 Á , continuing this sequence will eventually produce a quotient Nm - 1 = 1 (except for the decimal integers 0 and 1, whose binary equivalents are 0 and 1, respectively) and a remainder Rm - 2, which is 0 or 1. Then N = (1 * 2m - 1) + (Rm - 2 * 2m - 2) + Á + (R2 * 22) + (R1 * 21) + R0 which is the binary form of N. Hence, we convert from base 10 to base 2 by...
tracking img