Exercises: Binary (or Other Base) to Decimal

advertisement
How Binary Numbers are Built
Ordinary (i.e., decimal) number are so familiar to us that we forget
they are built on a base-10 system, because there are ten possible
digits, 0-9). When we say “base-10” we mean that the digits are
multiplied by powers of 10 (e.g., 1, 10, 100, 1000, etc.).
For Example:
1 3 0 2 = 1000 + 300 + 0 + 2 = 1,302
103 or 1000
place
102 or 100
place
101 or 10
place
100 or 1
place
So then, the binary system, or “base-2”, uses 2 digits, 0-1, rather
than ten. When we say “base-2” we mean that the digits are
multiplied by powers of 2 (e.g., 1, 2, 4, 8, etc.).
For Example:
1001 = 8+0+0+1 = 9
23 or 8
place
22 or 4
place
21 or 2
place
20 or 1
place
How Octal and Hexi-Decimal Numbers are Built
Since binary numbers use only 2 digits, 0-1, they can get kind of
long.
For example, the number 356 is:
101100100
22 or 4
place
28 or 256
place
= 256 + 64 + 32 + 4 = 356
21 or 2
place
20 or 1
place
To make the numbers shorter, we collect the binary digits by
groups of threes (octal) or fours (hexi-decimal) and use the binary
value of each collection as a digit in the number.
For example, 101100100 (i.e., the number above) when collected
in groups of threes is 101 100 100 or the octal number 544.
When 101100100 (our number 356 again) is collected into groups
of four, the number is 1 0110 0100 or the hexi-decimal number
164.
You can turn an octal or hexi-decimal number back to the original
number just by following the same process as binary numbers. For
example:
5 4 4
82 or 64
place
= 320 + 32 + 4 = 356
81 or 8
place
80 or 1
place
Download