Understanding binary is essential to computer science and computing in general and yet today is something that many in the industry do not have a solid grasp of.

Base 10 (Decimal)

If you think about how we usually count, we use the numbers 0 - 9 and combinations thereof to represent a number of objects in real life. This system is called decimal because there are 10 digits (with the dec prefix coming from the latin for 10).

If you look at this in another way that you may not have thought of, what happens when you reach the end of the first 10 (0 - 9)? If you look at columns A and B, you will see what happens as the numbers increase:

A  B
----
0  0
0  1
0  2
0  3
0  4
0  5
0  6
0  7
0  8
0  9
1  0

When the numbers have cycled through all ten digits, they loop and start from the beginning and the next column is incremented. Well obviously! We take this for granted because we are taught this from a very young age. But most people don't usually think about what this means unless they need to learn another number system with a different base.

So what do we mean when we say a different base? What is the base in the decimal system? 10 of course! If we go back to our chart, we can illustrate what each number means a little differently:

10^1 10^0
---------
   0    0  =  (10^1 * 0) + (10^0 * 0)  =  0
   0    1  =  (10^1 * 0) + (10^0 * 1)  =  1
   0    2  =  (10^1 * 0) + (10^0 * 2)  =  2
   0    3  =  (10^1 * 0) + (10^0 * 3)  =  3
   0    4  =  (10^1 * 0) + (10^0 * 4)  =  4
   0    5  =  (10^1 * 0) + (10^0 * 5)  =  5
   0    6  =  (10^1 * 0) + (10^0 * 6)  =  6
   0    7  =  (10^1 * 0) + (10^0 * 7)  =  7
   0    8  =  (10^1 * 0) + (10^0 * 8)  =  8
   0    9  =  (10^1 * 0) + (10^0 * 9)  =  9
   1    0  =  (10^1 * 1) + (10^0 * 0)  =  10

Or

10  1
-----
 0  0  =  (10 * 0) + (1 * 0)  =  0
 0  1  =  (10 * 0) + (1 * 1)  =  1
 0  2  =  (10 * 0) + (1 * 2)  =  2
 0  3  =  (10 * 0) + (1 * 3)  =  3
 0  4  =  (10 * 0) + (1 * 4)  =  4
 0  5  =  (10 * 0) + (1 * 5)  =  5
 0  6  =  (10 * 0) + (1 * 6)  =  6
 0  7  =  (10 * 0) + (1 * 7)  =  7
 0  8  =  (10 * 0) + (1 * 8)  =  8
 0  9  =  (10 * 0) + (1 * 9)  =  9
 1  0  =  (10 * 1) + (1 * 0)  =  10

Here we can see that each column shows the base raised to an incremental power starting at 0 and then multiplied by the number in that column. So the number 234 would represent:

  10^0 * 4 =   4
+ 10^1 * 3 =  30
+ 10^2 * 2 = 200
----------------
=            234

Or

    1 * 4 =   4
+  10 * 3 =  30
+ 100 * 2 = 200
----------------
=           234

Base 2 (Binary)

Like decimal, binary is just another system for representing numbers that uses 2 as its base rather than 10:

2^3 2^2 2^1 2^0
---------------
  0   0   0   0  = (2^3 * 0) + (2^2 * 0) + (2^1 * 0) + (2^0 * 0) = 0
  0   0   0   1  = (2^3 * 0) + (2^2 * 0) + (2^1 * 0) + (2^0 * 1) = 1
  0   0   1   0  = (2^3 * 0) + (2^2 * 0) + (2^1 * 1) + (2^0 * 0) = 2
  0   0   1   1  = (2^3 * 0) + (2^2 * 0) + (2^1 * 1) + (2^0 * 1) = 3
  0   1   0   0  = (2^3 * 0) + (2^2 * 1) + (2^1 * 0) + (2^0 * 0) = 4
  0   1   0   1  = (2^3 * 0) + (2^2 * 1) + (2^1 * 0) + (2^0 * 1) = 5
  0   1   1   0  = (2^3 * 0) + (2^2 * 1) + (2^1 * 1) + (2^0 * 0) = 6
  0   1   1   1  = (2^3 * 0) + (2^2 * 1) + (2^1 * 1) + (2^0 * 1) = 7
  1   0   0   0  = (2^3 * 1) + (2^2 * 0) + (2^1 * 0) + (2^0 * 0) = 8
  1   0   0   1  = (2^3 * 1) + (2^2 * 0) + (2^1 * 0) + (2^0 * 1) = 9
  1   0   1   0  = (2^3 * 1) + (2^2 * 0) + (2^1 * 1) + (2^0 * 0) = 10

Or

8   4   2   1
-------------
0   0   0   0  = (8 * 0) + (4 * 0) + (2 * 0) + (1 * 0) = 0
0   0   0   1  = (8 * 0) + (4 * 0) + (2 * 0) + (1 * 1) = 1
0   0   1   0  = (8 * 0) + (4 * 0) + (2 * 1) + (1 * 0) = 2
0   0   1   1  = (8 * 0) + (4 * 0) + (2 * 1) + (1 * 1) = 3
0   1   0   0  = (8 * 0) + (4 * 1) + (2 * 0) + (1 * 0) = 4
0   1   0   1  = (8 * 0) + (4 * 1) + (2 * 0) + (1 * 1) = 5
0   1   1   0  = (8 * 0) + (4 * 1) + (2 * 1) + (1 * 0) = 6
0   1   1   1  = (8 * 0) + (4 * 1) + (2 * 1) + (1 * 1) = 7
1   0   0   0  = (8 * 1) + (4 * 0) + (2 * 0) + (1 * 0) = 8
1   0   0   1  = (8 * 1) + (4 * 0) + (2 * 0) + (1 * 1) = 9
1   0   1   0  = (8 * 1) + (4 * 0) + (2 * 1) + (1 * 0) = 10

Why Would We Need To Use Binary?

Binary is used because data can be represented by a collection of 0s and 1s, or represented another way: on or off, or yet another way: high or low. In this way we can store, transmit and manipulate information using these very simple primitives with things like voltage, light, logic gates etc.