E.1 INTRODUCTION TO BINARY NUMBERS
A decimal number can be expanded into its constituent components, with each digit being shown with its associated power of ten (the subscript in the Equations (E.1) and (E.2) indicates the base of the number system—10 for decimal, 2 for binary):
The location of a digit in a decimal number therefore serves as a place holder. The further towards the left of a number the digit lies, the larger the power of ten by which it is multiplied, and thus the greater its contribution to the value of the number (or, we could say, the greater its significance in the total value).
A similar expansion can be written for a binary number (that is, when it is represented in base-2), for example:
The binary number 11010 is therefore equivalent to the decimal number 26. Table E.1 lists all five-bit binary numbers and their decimal equivalents.
Table E.1. 5-bit binary numbers and their decimal equivalents.
| Binary | Decimal | Binary | Decimal |
|---|---|---|---|
| 00000 | 0 | 10000 | 16 |
| 00001 | 1 | 10001 | 17 |
| 00010 | 2 | 10010 | 18 |
| 00011 | 3 | 10011 | 19 |
| 00100 | 4 | 10100 | 20 |
| 00101 | 5 | 10101 | 21 |
| 00110 | 6 | 10110 | 22 |
| 00111 | 7 | 10111 | 23 |
| 01000 | 8 | 11000 | 24 |
| 01001 | 9 | 11001 | 25 |
| 01010 | 10 | 11010 | 26 |
| 01011 | 11 | 11011 | 27 |
| 01100 | 12 | 11100 | 28 |
| 01101 | 13 | 11101 | 29 |
| 01110 | 14 | 11110 | 30 |
| 01111 | 15 | 11111 | 31 |
An n-bit binary number can represent values in the range between 0 and 2n–1:
- A four-bit binary number can be used to represent values between 0 and 15 (24–1).
- An eight-bit binary number can represent values between 0 and 255 (28–1).
- and so on.
