As shown in section 2.1, each place or position in a binary number corresponds to a specific power of 2 starting with the rightmost bit 1 which represents 2^{0}=1. It is through this organization of the bits that we will convert binary numbers to their decimal equivalent. Figure 4 shows the bit positions and the corresponding powers of two for each bit in positions 0 through 7.

Numbered bit
position

Corresponding
power of 2

2^{7}

2^{6}

2^{5}

2^{4}

2^{3}

2^{2}

2^{1}

2^{0}

Decimal equivalent
of power of 2

Figure 1.4Values Represented By Each of the First 8 Bit Positions

To begin converting an unsigned binary number to decimal, identify each bit position that contains a 1. It is important to note that we number the bit positions starting with 0 identifying the rightmost bit. Next, add the powers of 2 for each position containing a 1. This sum is the decimal equivalent of the binary value. An example of this process is shown in Figure 5 where the binary number 101101002 is converted to its decimal equivalent.

1

1

1

0

Bit Position

Binary Value

101101002 = 2^{7} + 2^{5} + 2^{4} + 2^{2}

= 12810 + 3210 + 1610 + 410

= 18010

Figure 1.5Sample Conversions of 101101002 to Decimal

This brings up an important issue when representing numbers with a computer. Note that when a computer stores a number, it uses a limited number of transistors. If, for example, we are limited to eight transistors, each transistor storing a single bit, then we have an upper limit to the size of the decimal value we can store.

The largest unsigned eight bit number we can store has a 1 in all eight positions, i.e., 111111112. This number cannot be incremented without forcing an overflow to the next highest bit. Therefore, the largest decimal value that 8 bits can represent in unsigned binary is the

If you add one to this value, the result is 256 which is 2^{8}, the power of two for the next bit position. This makes sense because if you add 1 to 11111111_{2}, then beginning with the first column, 1 is added to 1 giving us a result of 0 with a 1 carry to the next column. This propagates to the MSB where a final carry is passed to the ninth bit.

Therefore, the maximum value that can be represented with 8 bits in unsigned binary is 2^{8} – 1 = 255.

It turns out that the same result is found for any number of bits. The maximum value that can be represented with n bits in unsigned binary is 2^{n} – 1.

Max unsigned binary value represented with n bits = 2^{n} – 1 (2.1)

We can look at this another way. Each digit of a binary number can take on 2 possible values, 0 and 1. Since there are two possible values for the first digit, two possible values for the second digit, two for the third, and so on until you reach the n-th bit, then we can find the total

number of possible combinations of 1's and 0's for n-bits by multiplying 2 n-times, i.e., 2^{n}.

How does this fit with our upper limit of 2^{n}-1? Where does the "-1" come from? Remember that counting using unsigned binary integers begins at 0, not 1. Giving 0 one of the bit patterns takes one away from the maximum value.

For example, in the decimal system (base 10), the numeral 4327 means:

and writing the enumerated digits a_{n}a_{n−1}a_{n−2}...a_{0} in descending order. The digits are natural numbers between 0 and b − 1, inclusive. If a text (such as this one) discusses multiple bases, and if ambiguity exists, the base (itself represented in base 10) is added in subscript to the right of the number, like this: number _{base}. Unless specified by context, numbers without subscript are considered to be decimal.

To determine the value of a binary number (1001, for example), we can expand the number using the positional weights as follows:

Here's another example to determine the value of the binary number 1101010: