Chapter 6 Math
65
2 * 10 ** 0 = 2 * 1 = 2
___________
1452
The binary number system works the
same way as the decimal system, except there are only two
digits, 0 and 1, and the place values are powers of 2, instead of powers of 10.
The rightmost place value is 2
to the zero power, which is 1. The next place value is 2 to the first
power, which is 2. The next place value is 2
to the second power, which is 4 (2 × 2). The next place
value is 2
to the third power, which is 8 (2 × 2 × 2) (Figure 6.3).
Here is an equation that represents the number 1101 in base 2:
(1 * 2 ** 3) + (1 * 2 ** 2) + (0 * 2 ** 1)
+ (1 * 2 ** 0) =
8 + 4 + 0 + 1 = 13
Or:
1 * 2 ** 3 = 1 * 8 = 8 +
1 * 2 ** 2 = 1 * 4 = 4 +
0 * 2 ** 1 = 0 * 2 = 0 +
1 * 2 ** 0 = 1 * 1 = 1
____
13
As you can see, 1101 in binary is 13 in base 10.
In the decimal system, you count by starting at zero: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9.
At that point, you
run out of digits. To represent the next number, as you know, you create 10 by using 2 digits. You
represent 10 with a 1 followed by a 0.
When
you count in binary, you also start with zero.
0
And like the decimal system, the next number is 1.
1
Eights
2
3
Fours
2
2
Twos
2
Do'stlaringiz bilan baham: