Dale - Computer Science Illuminated 63

# Dale - Computer Science Illuminated 63 - 36 Chapter 2...

This preview shows page 1. Sign up to view the full content.

36 Chapter 2 Binary Values and Number Systems Let’s express this idea formally. If a number in the base- R number system has n digits, it is represented as follows, where d i represents the digit in the i th position in the number. d n * R n ± 1 + d n ± 1 * R n ± 2 + ... + d 2 * R + d 1 Look complicated? Let’s look at a concrete example: 63578 in base 10. n is 5 (the number has 5 digits), and R is 10 (the base). The formula says that the fifth digit (last digit on the left) is multiplied by the base to the fourth power; the fourth digit is multiplied by the base to the third power; the third digit is multiplied by the base to the second power; the second digit is multiplied by the base to the first power; and the first digit is not multiplied by anything. 6 * 10 4 + 3 * 10 3 + 5 * 10 2 + 7 * 10 1 + 8 In the previous calculation, we have assumed that the number base is ten. This is a logical assumption since our number system is base ten. However, there is nothing about the number 943 that says it couldn’t be representing a value in base 13. If so, to determine the number of ones, we would have to convert it to base 10. 9* 1 3 2 = 9 * 169 = 1521 +4* 1 3 1 =4* 1 3= 5 2 +3* 1 3 0 =3* 1= 3 1576
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online