Pages

Monday, September 10, 2012

Talk Nerdy to Me: Computers (Part 2, Binary)

Hi all, welcome back.

In the first article of "Talk Nerdy to Me" we went over the definition of digital and how it affects our lives every day. (Wow, I sound like a real teacher now)

In the second article, I introduced the concept of states. Inputs create a condition, which produces some output. This relates to computers in many ways, but for our purposes we refer to how transistors -- the basic building blocks of electronics-- have two states: 'on' and 'off'

Today, we will introduce binary, why computers use it.

BINARY

Binary is a base 2 number system. All this means is that each digit can count up to 2. The following is a counting example. Note how each digit has only 2 possible values, 0 or 1.

Decimal --> Binary
0                         0
1                         1
2                      1 0
3                      1 1
4                   1 0 0
5                   1 0 1

To explain this better, let's correlate this to the decimal system -- our day-to-day number system. Decimal is base 10, which means each digit can count up to 10 (values from 0 to 9). To go above 9, we start a new digit to the left (10). Binary does the same, but in groups of 2. The base of the system is just the size of the group of each digit. In binary, we start a new group every 2 counts of each digit (decimal 2 => binary 1 0). In decimal we start a new digit every 10 counts (decimal 9+1 = decimal 1 0).

Why do computers use binary? Just for practical reasons. Since transistors have only two states, the binary system allows us to make calculations using transistors. The number system is arbitrary as long as (a) all the involved "calculators" agree on which system to use and (b) the basic operation is performed correctly. Have you ever wondered why we use the decimal system? It's really only because we have 10 fingers. Decimal allows us to count with our fingers when we first learn to count. Afterwards, the system becomes second nature. So the system you use depends more on the tools than the math itself.