Binary numbers

Introduction

Place value

Recall the decimal number system uses the ten digits 0,1,2,3,4,5,6,7,8 and 9.  For numbers 10 and greater we must use more digits and the concept of place value as shown in the example below.

Example:
637 = 6*100 + 3*10 + 7*1 = 6*102 + 3*101 + 7*100

The binary number system uses only the two digits 0 and 1.  The place values for the binary number system are powers of 2 as shown in the following table.

32 16 8 4 2 1
25 24 23 22 21 20

Binary to decimal conversion

To convert from binary to decimal is easy if you refer to the place values for each binary digit.

Example: Convert 101101 to a decimal.

32 16 8 4 2 1
1 0 1 1 0 1

32 + 8 + 4 + 1 = 45

Decimal to binary conversion

To convert from decimal to binary we must again use the place values for each binary digit and use a subtraction process to determine which place values are 0's and which place values are 1's.

Example: Convert 155 to a binary number.

128 64 32 16 8 4 2 1
1 0 0 1 1 0 1 1
  1. Since we need 128, we place a 1 in this location.
  2. Since 155 - 128 = 27, we must choose the remaining digits to yield 27.
  3. We cannot use 64 or 32, so we place 0's in these positions.
  4. We can use the 16, so we place a 1 in this position.
  5. Since 27 - 16 = 11, we must choose the remaining digits to yield 11.
  6. We can use an 8, so we place a 1 in this position.
  7. Since 11 - 8 = 3, we must choose the remaining digits to yield a 3.
  8. We cannot use the 4 so we place a 0 in this position.
  9. We use the 2 and the 1, so we place 1's in these positions.

Internet resources

Number conversion calculator