Introduction to Binary
Computer systems are made up of digital electronics, and thus the language they speak is electricity. For a computer to receive instructions, process those instructions and provide output there must be physical components in place that have the ability to process and store electronic messages. With this in mind electronic switches, digital circuitry and logic gates, transistors, capacitors and a whole host of other components and technologies were created.
At any given point in time, a circuit can only be in one of two states: either "on" or "off". Computer communications and storage, at their most basic level, must be built upon sequences of "on and off" signals or values. While there are numerous ways of transmitting and storing on and off signals and values, whether via voltage, fiber-optic light, microscopic indentations on disks or magnetism the "on and off" language, if you will, remains the same.
So what is the "on and off" language? The answer is binary, our topic, and binary is a number system that uses only two symbols to represent numbers, namely 0 ("zero") and 1 ("one"). You could also think of binary as a boolean "true or false" language, as with programming boolean false equates to the decimal value "0" and boolean true to the decimal value of "1".
First we started with electricity, then on and off signals, ones and zeros and now we're talking numbers, binary numbers, which in a computer system can be mapped to things you and I understand such as the upper case letter T. The decimal value of "T" is 84, and 84 can be represented in binary form as 01010100, or more specifically that sequence of "on" and "off" values whether transmitted or stored.
Now you're probably wondering, where did decimal 84 come from? The answer is ASCII (American Standard Code for Information Interchange), the most common standard for representing alpha-numeric data in a computer. The standard maps decimal numbers to graphical letters, numbers, punctuation, control characters (enter, space bar etc) and so on. Binary numbers can represent decimal numbers, and decimal numbers can be converted into binary form. By sending this sequence of on and off signals your keyboard is able to tell your computer which character you typed, which can be mapped to a graphical symbol your monitor can display.
Hopefully now, you see the importance of the binary system to computer technology. Computers speak binary, and although technology has continued to evolve, the binary system has remained the dominant language of computers.
Computers speak binary and you can speak it, too. So, let's get started.
Getting Started
The binary number system is based on units of 2. With the binary number system we can represent any number no matter how large or small with just 2 symbols: 0 and 1.
Binary is a system of measurement where all of the derived units are multiples of 2. Units are represented in columns, working from right to left. The first, or far right column representing the smallest unit, and as each new column is added to the left side the value increases 2 times the value of the previous column. This is a fundamental concept of base number systems.
With the binary number system we start out with a 1 ("ones") column on the far right, then working from right to left a 2 ("twos") column, 4 ("fours") column, 8 ("eights") column, 16 ("sixteens") column and so on.

We can also write the exponential notation for the placeholder title of each column (ex. the "1s" column; the "2s" column; the "4s" column, etc.) the long way.
20 = 1
21 = 2×1 = 2
22 = 2×2 = 4
23 = 2×2×2 = 8
24 = 2×2×2×2 = 16
Switches
The next concept we need to discuss are switches, which will help you visually see what's going on when we start counting. Think of a light switch, when you flip it up the light turns on (1) and when you flip the switch down the light turns off (0). See the following diagram which depicts a switch in the off and on states. Throughout this article, when you see these switches you'll now be able to tell whether they're in the on or off state.

Bits and Bytes
In the digital world the smallest unit of measurement is known as a bit. Remember above when we were working out the column values for binary? Well, each one of those columns or placeholders is 1 bit. A bit can either store a 1 or a 0, be on or be off.
When working with binary we typically work with sets of bits, 8 bits to be precise and guess what 8 bits equals? A byte, 8 bits equals 1 byte. It takes 1 byte of data to represent the letter "T". So, as we start counting in binary below, keep "bits and bytes" in mind.
Something else to keep in mind is that while we typically work with sets of 8 bits, if any of the left side columns are missing in a binary sequence those bits are assumed "zeros". Therefore, the following binary sequences would be read as the same number (which in decimal equals 8):
00001000
1000
Counting in Binary
Alright, let's start counting and representing numbers in binary. Now remember, we only have two numbers to count with, 0 and 1. I know. I know. You're thinking, "not a chance!". It's very do-able though, and here's how.
Let's say we just start counting:
0
1
Oops! We're already out of numbers. Now, what do we do? Well, let's name our next number "2". Then, let's create another column to count with and call it the "2s" column, actually a "groups of twos column".
This is what "2" will look like in binary:
10
The "1" in the left column means 1 group of two and the "0" in the right column means 0 ones.
Now we can go on counting to 3, which in binary is:
11
The 1 on the left side stands for 1 set of two and the next 1 stands for 1 one = 3.

Now, this didn't help us too much because we're out of numbers again. So, let's decide to name the next number 4 and let's create a "groups of fours column". Four would look like this:
100
100 stands for 1 group of 4; 0 groups of two; and 0 ones = 4.
Then we can count on to 5 which looks like this in binary:
101
101 stands for 1 group of four; 0 groups of two; and 1 one = 5.
and then 6:
110
110 stands for 1 group of four; 1 group of two; and 0 ones = 6.
and 7:
111
111 stands for 1 group of four; 1 group of two; and 1 one = 7.

Then, we run out of numbers again so let's name our next number. We'll call it "8" and we'll create a column of groups of eight. Eight looks like this in binary:
1000
1000 means 1 group of eight; 0 groups of four; 0 groups of two; and 0 ones = 8.
Now, we can count on to 15:

At 15, we run out of numbers again. So, let's name our next number "16" and create a groups of sixteen column so we can continue counting:

Well, I think you get the idea. Below is a table with more binary system numbers. The table is displayed in octets - sets of eight placeholders. Each number is also 8 bits, or 1 byte of data. As a side note, the addresses computers use to connect to the Internet (IP Addresses) are made up of 4 octets (eg- 192.168.1.1), which is 32 bits or 4 bytes. Alright, continuing on from where we left off (16s) the completed table looks like this. From left to right the columns or placeholder values are:
128s, 64s, 32s, 16s, 8s, 4s, 2s, 1s

Notice first that in each row above, certain switches are turned on as indicated by the yellow "light" in any given placeholder column. To determine what number each row represents, we just have to run our finger across each row from left to right and add together the values of all the lit switches in the row. So, in the first line, column 32 and column 1 are lit so we add 32 and 1 and we get 33, and so on across each row.
33 in binary then is actually 00100001. Now, you try it.
Notice also that binary numbers, when grouped as octets (sets of 8 placeholders) like our table above, can count to 255. The octet has 256 numbers in it (0-255) because we have to include "0" and that fact allows us to only count to "255". After that a new column will have to be added and a new octet started. The new column will start where we left off in our counting in the first octet. The new octet will start with the number 256, and its first column will be 256s. The next column will be 512s; then 1024s; then 2048s; then 4096s; then 8192s; then 16,384s; and then 32,768s.
Remember with the first octet, we could count to 255. After we add the second octet, we are able to count to 65,536. So, you see we can use the binary system, though it only has two numbers, to count to extremely high numbers.
With three octets, we can count to 16,700,000. With four octets, we can count to 4 billion plus. With five octets, we can count trillions.
Test Yourself
Now that you've hopefully learned binary, are you ready for a fun test? Go to the ITNewb characters resource and write down the decimal values for each character (including the space and exclamation point characters) in the following statement:
I know binary!
Once you have the decimal values for each letter or character, convert each one into its binary form. You can download the answer sheet from the attachment icon below.
Introduction to JSON and PHP
Cross Browser CSS Opacity and the JavaScript Fade / Fading Effect