Written by: Dan "Tweak Monkey" Kennedy

If you only speak one language you will have less opportunities and options in life than if you spoke more. By acquiring the ability to communicate with more people, you open new doors for business opportunities and relationships. Given this fact, it makes sense that you would benefit from the ability to communicate with anything. Electronics and computers, which are becoming more important to daily life at an exponential rate, have their own language and it is important that you understand it.

At the lowest level, computers communicate in a simple language called

It is critical that anyone hoping to understand, repair, and troubleshoot computers has a complete understanding of this language. It is the most important fundamental topic to grasp with computers and will ultimately determine your success with them.

The binary language is so simple! It only consists of two words:

Even though binary only has two words, they can be used to represent anything. The numbers can be used to represent other numbers, which can represent data, and so-on. We'll explain how later.1 = On

0 = Off

So 1 = On and 0 = Off. What does this really mean?

Binary represents everything as an on/off switch. Look at a light switch and imagine it says

Switch set to 0 Switch set to 1

integersThe value of the light switch is checked by the function LightStatus. When it's On (switch = 1) it turns the light On (light = 1). Binary can be used to represent the answer to any Yes or No question. Is the light on? Check the value of the variable light for the answer. This is exactly how software determines the answer to a question and at a lower-level, how the hardware knows what it is supposed to be doing.switch, light; // variables representing state of switch and light

switch = off; // initialize switch to off position

light = off; // initialize the light to off

LightStatus(){ // a function to represent status of the light

if (switch == 1) // if the switch is turned on

light = 1; // then the light turns on

else //otherwise the switch is off

light = 0; // so the light is turned off

}

In front of you there is a computer monitor. There is a light at the corner of this monitor representing its status. Usually

Representing numbers in binary allows unlimited application of this logic.

Those 1s and 0s can be used to represent any numbers. Numbers can then be used to represent other objects. How can you represent any number using binary? Using

The decimal number system is our most common number system and has 10 choices for its digits (0 through 9). A string of decimal numbers uses multiple digits, such as 147 (one hundred forty seven). The understanding of the single digits allows you to understand the string of digits. Binary uses 2 possibilities (0 or 1) to accomplish the same task. The number 2 for example, can be written as

Since there are only two possible symbols to represent the numbers, two is created by using a second digit. This is done using the power of 2 instead of the power of 10 like decimal.

In decimal, 101 represents the following summation:

(

= (

= 100 + 0 + 1

= 101

In binary, 101 represents the following:

(

= (

= 4 + 2 + 1

= 5

To convert the number 547 to binary, you need to first determine the most significant digit of its binary string. Look at the powers of 2:

2 ^ 0 = 1Find the highest number that fits into 547 at least once. A quick glance shows it's 2 ^

2 ^ 1 = 2

2 ^ 2 = 4

2 ^ 3 = 8

2 ^ 4 = 16

2 ^ 5 = 32

2 ^ 6 = 64

2 ^ 7 = 128

2 ^ 8 = 256

2 ^ 9 = 512

2 ^ 10 = 1024

9 8 7 6 5 4 3 2 1 0

(the Xs will be figured later)

We need the remainder of 547/512 to continue. Take 547-512 = 35. Now the process continues. The next number that 35 fits into is 2 ^

9 8 7 6 5 4 3 2 1 0

Find the remainder of 35/32. Take 35-32 = 3. The next value is 2 ^

9 8 7 6 5 4 3 2 1 0

For the last step, our remainder 1 (from 3/2 = 1 r1) can only fit in 2 ^

(the completed binary string)

Calculators can speed up this process considerably. Try running the Windows calculator (Start, Run, calc

Set the mode to Scientific (from View at the top). Input 547, then click the

Binary digits can represent states of various switches and can combine to represent numbers, letters, words, documents, programs, computer software, computer hardware, and all electronic circuits at the basic level. A 10-bit number like 547 can be represented by 10 switches toggled to the correct On/Off setting.

You've probably seen the term

A kilobit is 2^10 bits, or 1024 bits. A kilobyte is 8 times this number, or 1024 bytes.

A megabit is 2^20 bits, or 1,048,576 bits. A megabyte is 8 times this number, or 2^20 bytes.

Some people think a 56K modem can download at 56 kilobytes per second. It is physically limited to 56/8 = 7 kilobytes per second, though the FCC limits it to 54 kbps.

You can create any number with binary, even numbers less than 1 (you'll usually use tricks, like representing negatives or fractions with extra bits in the front of the number). There are 26 letters in the alphabet, so they can be assigned numbers. You may have heard the term ASCII, which represents the alphabet and other characters with specific numbers.

Take the word

c a b

c = 3 (decimal) = 11 (binary)

a = 1 (decimal) = 01 (binary)

b = 2 (decimal) = 10 (binary)

Using long strings, one could make whole sentences including punctuation. Then documents, music, operating systems, or any data in binary. Ever wonder how a document is stored in a computers memory? Using bits. Thousands of 1s and 0s are chained together to form words, formatting, and just about anything you could imagine. Everything you see right now is being represented in your computer's memory by an electric current. Over a million pixels' colors are represented as 1s and 0s, strategically placed in front of you to represent the image your video card is sending to your monitor. You could flip a single 1 to 0 in your system's memory and crash the whole computer or change something as small as a single pixel by a fraction of a color shade.

For example, assume you set the font color to black, which in 24-bit color mode is:

If you change just a single bit:

The color of the font changes considerably

Now you know what a bit is, how a bit works, and how a computer uses electric switches just like a light switch to operate. You're probably still scratching your head thinking, "why did I learn all this?"

Binary is the language of electronics. It makes sense for an electric circuit to be either ON or OFF, so this logic and number system will be with us as long we use electricity. It's important to understand because computers and other electrical devices are a bigger part of our lives than ever now. If you understand binary, you understand the fundamentals behind the functionality of your cell phone, music stored on your MP3 player, or the programming in your TV remote control.

The most important lesson you can learn is that electric circuits, represented by 1s and 0s, can create ANYTHING you could imagine. Isn't that pretty neat?

All Content Copyright ©Dan Kennedy; 1998-2005