It is very easy to design simple, accurate electronic circuits that operate with only two voltage levels. For this reason, almost every digital system uses the binary (base-2) number system as the basic number system of its operations.
Other number systems (like the decimal system) are often used to interpret or represent binary quantities for the convenience of the people who work with and use these digital systems. [ Also read: decimal system ]
Binary System – explained
In the binary system, there are only two symbols or possible digit values, 0 and 1. Even so, this base-2 system can be used to represent any quantity that can be represented in decimal or other number systems. In general, though, it will take a greater number of binary digits to express a given quantity.
The binary system is a positional value system, wherein each binary digit has its own value or weight expressed as a power of 2. This is illustrated in Figure 1. Here, places to the left of the binary point (counterpart of the decimal point) are positive powers of 2, and
places to the right are negative powers of 2.
The number 1011.101 is shown represented in the figure. To find its equivalent in the decimal system, we simply take the sum of the products of each digit value (0 or 1) and its positional value:
1011.1012 = (1 * 23) + (0 * 22) + (1 * 21) + (1 * 20) + (1 * 2-1) + (0 * 2-2) + (1 * 2-3)
= 8 + 0 + 2 + 1 + 0.5 + 0 + 0.125
Notice in the preceding operation that subscript (2) was used to indicate the base in which the particular number is expressed.This convention is used to avoid confusion whenever more than one number system is being employed.
In the binary system, the term binary digit is often abbreviated to the term bit, which we will use from now on. Thus, in the number expressed in Figure 1, there are four bits to the left of the binary point, representing the integer part of the number, and three bits to the right of the binary point, representing the fractional part.
The most significant bit (MSB) is the leftmost bit (largest weight). The least significant bit (LSB) is the rightmost bit (smallest weight).
These are indicated in Figure 1. Here, the MSB has a weight of 23; the LSB has a weight of 2-3
When we deal with binary numbers, we will usually be restricted to a specific number of bits. This restriction is based on the circuitry used to represent these binary numbers. Let’s use four-bit binary numbers to illustrate the method for counting in binary.
The sequence (shown in Figure 2) begins with all bits at 0; this is called the zero count. For each successive count, the units (20) position toggles; that is, it changes from one binary value to the other.
Each time the units bit changes from a 1 to a 0, the twos (21) position will toggle (change states). Each time the twos position changes from 1 to 0, the fours (22) position will toggle (change states). Likewise, each time the fours position goes from 1 to 0, the
eights (23) position toggles. This same process would be continued for the higher-order bit positions if the binary number had more than four bits.
The binary counting sequence has an important characteristic, as shown in Figure 2. The units bit (LSB) changes either from 0 to 1 or 1 to 0 with each count. The second bit (twos position) stays at 0 for two counts, then at 1 for two counts, then at 0 for two counts, and so on.
The third bit (fours position) stays at 0 for four counts, then at 1 for four counts, and so on.
The fourth bit (eights position) stays at 0 for eight counts, then at 1 for eight counts. If we wanted to count further, we would add more places, and this pattern would continue with 0s and 1s alternating in groups of 2N-1. For example, using a fifth binary place,
the fifth bit would alternate sixteen 0s, then sixteen 1s, and so on.
As we saw for the decimal system, it is also true for the binary system that by using N bits or places, we can go through 2N counts. For example, with two bits we can go through 22= 4 counts (002 through 112); with four bits we can go through 24=16 counts (00002 through 11112); and so on.
The last count will always be all 1s and is equal to 2N-1 in the decimal system. For example, using four bits, the last count is 11112 = 24-1 = 1510.
Q: What is the largest number that can be represented using eight bits?
2N-1 = 28-1 = 25510 = 111111112.