Section 7.4 Binary numbers
Digital computation uses the binary, or base-2, number system. In the binary number system, we will refer to bits rather than digits which are used in the decimal (base-10) system. Each digit in a base-10 number can assume any one of ten values (0-9) which is then multiplied by \(10^n\) where \(n\) is the number of digits to the left of the decimal point. For example, decimal number 1092 can be understood as \(1\times 10^3 + 0\times 10^2 + 9\times 10^1 + 2\times 10^0\text{.}\) Likewise, each bit in a binary number can take on one of two possible values (0 and 1) with these values multiplying a power of 2. So, the binary number 1011 can be understood as \(1\times 2^3 + 0\times 2^2 + 1\times 2^1 + 1\times 2^0\text{.}\) This means that the binary number 1011 represents 11 in decimal. A binary number comprised of \(n\) bits has \(2^n\) possible values. Table 7.4.1 provides a list of all fifteen 4-bit positive integers with decimal counterparts.
Table 7.4.1. Binary to decimal equivalents for every 4-bit positive integer.
| Binary | Decimal |
|---|---|
| 0000 | 00 |
| 0001 | 01 |
| 0010 | 02 |
| 0011 | 03 |
| 0100 | 04 |
| 0101 | 05 |
| 0110 | 06 |
| 0111 | 07 |
| 1000 | 08 |
| 1001 | 09 |
| 1010 | 10 |
| 1011 | 11 |
| 1100 | 12 |
| 1101 | 13 |
| 1110 | 14 |
| 1111 | 15 |
Decimal integers can be subdivided by powers of ten through the use of the decimal point. Similarly, binary integers can be subdivided by powers of two through the use of the binary point. For example, the binary number 11.01 represents \(1\times 2^1 + 1\times 2^0 + 0\times 2^{-1} + 1\times 2^{-2}\) which is equivalent to the decimal number 3.25. In other words, bits to the left of the binary point represent positive powers of two while bits to the right of the binary point represent negative powers of two.
