How Does the Binary System Work: An Introduction

March 20, 2007 by Kiltak |

Before you start reading this article, I want you to take a trip back into your past when you were being taught the decimal system. Personally, when I was in elementary school (in the 70’s/80’s), teachers used to use a column system to teach us about numbers:

[Thousands] | [Hundreds] | [Tens] | [One]
        1                    2               3          4  

The number 1234 is - 1 Thousands, 2 Hundreds, 3 Tens and 4 Ones.

A few years later, we learned about the composition of the decimal system in a more complex way.

Thousands became 10^3 (10*10*10)
Hundreds became 10^2 (10*10)

… and so on.

1234 then became:

((1*10^3)+(2*10^2)+(3*10^1)+(4*10^0))

As you already know, counting in decimals is done by using 10 digits, from 0 to 9. Each time we jump a “column” (from 9 to 10), we add 1 digit to our total and reset all subsequent numbers to 0 (999 becomes 1000). The binary system works exactly the same way, but instead of using digits that goes from 0 to 9, we keep things simple and only use 0’s and 1’s, just like computers do. But the question you are probably asking yourself now is why do computers only use 0’s and 1’s?  The answer is simple: electronic circuits.  Circuits that make the wheel inside your computer turn can only have 2 states, on and off. Since a computer is mostly made out of electronic circuitry, it is logical that it uses the binary system to send, receive or compute information.

How does the binary system work?

Let’s start with what a binary number looks like:

01001010

“What the heck does this mean, and how do I represent this in more familiar decimal format” you ask.  First, you have to know that each digit of a binary number is based on 2 to the power of x (as opposed to the decimal system that is based on the number 10). Here is a quick and easy chart you should study before continuing:

2 to the power of 0 = 1 (2^0)
2 to the power of 1 = 2 (2^1)
2 to the power of 2 = 4 (2^2) or (2*2)
2 to the power of 3 = 8 (2^3) or (2*2*2)
2 to the power of 4 = 16 (2^4) or (etc.)
2 to the power of 5 = 32 (2^5)
2 to the power of 6 = 64 (2^6)
2 to the power of 7 = 128 (2^7)
2 to the power of 8 = 256 (2^8)

2 to the power of x = (2^x)

Ok, let’s apply this chart to the binary number I gave a few moments ago to get us the decimal equivalent. All digits that are 0 remain 0, and are only useful as position placeholders. All digits that are assigned a value of 1 have a decimal value that is equal to the power (2^x) of their position within the chart.

128   64   32   16   8    4    2    1
————————————–
 0      1      0     0    1    0    1    0

01001010 = 64 + 8 + 2

which means that 01001010 = 74

Simple isn’t it?

Now let’s do the inverse. To convert 74 to binary, you’ll have to start by finding the biggest power of 2 that is valued less then 74.  Finding this number is important because it will determine the positive value at the left of your binary number.  In this case, it is 64.

Let’s put a 1 in the 2^6 (2*2*2*2*2*2 = 64) position.

01000000

After, take your initial decimal number, and subtract it by the value you just found out. 74 - 64 = 10. Now, let’s do the same procedure as before. What is the biggest power of 2 that is valued less then 10? It is 8.

Put a 1 in the 2^3 position ( 2*2*2 = 8 )

…and continue doing this until the total equals your initial decimal number.

01001010

Even numbers always finish with a 0 and odd ones end in 1. This is because the rightmost digit in a binary number can only have a decimal value of 0 or 1.

As a non-IT person, there’s no real reason why you should know about how to do this manually, except to sound smart in front of your peers. Most modern calculators (including the windows one) can also accomplish these operations quickly and painlessly. 

So why bother with all this? The answer is simple: Because you’re a geek (or an aspiring one)!


You Might Also Like:
Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Digg
  • StumbleUpon
  • Fark
  • Reddit
  • Technorati
  • Mixx
  • Pownce
  • Slashdot
  • TwitThis
Did you enjoy this post? If so, subscribe to the geeksaresexy RSS feed.

RSS feed | Trackback URI

32 Comments »

Comment by Tracy
2007-03-20 10:57:58

My husband is a psychologist - I’ve always thought it would be fun to put a binary clock in his office. Talk about messing up the client!

 
Comment by Kiltak
2007-03-20 12:42:24

Haha, wouldn’t that be hilarious? They come out of his office needing more counseling then when they first got in.. a great “get rich quick” recipe :)

 
Comment by Mackenzie
2007-03-20 14:22:18

Ah, memories of 6th grade where we were required to learn base 3, but had binary for the bonus question…I get a lot of funny looks because I wear a binary watch and few other people can read it. On the other hand, if someone (like the snowboarder whose board said 1337) wants to test my geek-level and asks if I know binary, I just hold out my arm and don’t say a word.

Comment by Kiltak
2007-03-20 17:32:09

Uh? You learned base 3 in grade 6? Hehe, I’m sure it won’t be long until schools start teaching octal in grade one :)

I’ve always wanted to get one of those binary watches from thinkgeek, but always told myself, Why the hell would I need that? hehe.

 
 
Comment by Mackenzie
2007-03-20 20:13:40

Yeah, base 3 was required in 6th grade math class, but when I tried to explain my watch to an old schoolmate she didn’t get it. She doesn’t remember learning tertiary, but then it’s been 7 years.

My mom asked why I needed one of these watches and didn’t accept “to tell time” since it’s binary and costs more than a cheap digital does. My dad got it for me for Christmas. Oh, and today I went to dinner with a geek friend who commented on the watch then said he’s looking at one that tells the weather forecast like the little mini weather station on thinkgeek.

 
Comment by Mackenzie
2007-03-20 20:27:15

Okay so my vocabulary is wrong. Base 3 = ternary, not tertiary.

 
Pingback by jWanderings
2007-03-21 04:44:16

[...] does the binary system work? Always a puzzle to me… Nice intro [...]

 
Comment by Sean
2007-03-21 06:02:13

Many years ago, I learned a method of converting from decimal to binary that didn’t depend on your being able to calculate or reference powers of two; the only math that it required was being able to divide by two and tell the remainder. What you did was to take the number and repeatedly divide it by two, writing the remainder to one side, until you reached a value of 0:
[code]74
37 0
18 1
9 0
4 1
2 0
1 0
0 1[/code]
You then start at the bottom of the right column and read the binary digits upward, in this case getting ‘1001010′.

 
Comment by Sean
2007-03-21 06:05:23

Aargh. Too much time with BBCode, and no preview function.
74
37 0
18 1
9 0
4 1
2 0
1 0
0 1

Comment by Mackenzie
2007-03-21 06:45:22

That’s how my computer science teacher taught it in 10th grade. I still like the powers of two way because if you’ve been around a computer for a bit, you know the pattern 2 4 8 16 32 64 128 256 512 1024 2048 just from buying RAM. I like subtraction. It’s easier than division.

 
 
2007-03-21 12:31:20

[...] How Does the Binary System Work: An Introduction We all know computers are about 1s and 0s but have you ever thought about the difficulty of expressing 10 digits with 2 and keeping calculations accurate to lots of decimal places? That’s pretty much where a lot of computer fire power goes. (tags: binary) [...]

 
2007-03-31 03:05:08

[...] 2 new articles that could be of interest to you, dear readers. Our first one tries to explain how the binary system works using some simple techniques. The second one is a post about how bloggers can make money online by [...]

 
Comment by southafrikanse
2007-04-04 17:17:31

As a Engineer of Electronic and Computer’s student the binary system was obviously one of the numerical systems I had to learn.

It takes a little effort to know it perfectly but I can see their advantage.

This article doesn’t explain all of the binary system’s purpose but for curiosity it’s ok.

You should try to explain the octal and the hexadecimal system as well, just for fun.

Why should you do this? The answer is simple: because we are all geeks :D

 
Comment by Brandon
2007-05-02 10:08:55

Hey, i need to figure out how to turn the words into numbeers for example turning my name Brandon into its binary code that would help me out alot if someone could email at Nova73rs@aol.com that would help me a whole lot thanks

Comment by Mackenzie
2007-05-02 11:19:26

Go to asciitable.com and look up the decimal ascii value of each letter. Convert each to 8-bit binary (each will start with a 0), and line them up together. I know a space is 32 so that’s 01000000

Comment by Kiltak
2007-05-02 11:24:27

I couldn’t have said it better :)

Way to go Mac!

 
 
 
Comment by Brandon
2007-05-02 11:33:36

I got it thank you lots im not very good at math its a bad subject for me ;(

 
Comment by Brandon
2007-05-02 11:36:39

Do they change for lower case and uppercase?

Comment by Kiltak
2007-05-02 12:14:37

Yes, the ascii value for Upper and Lower case are not the same… everything is in the link Mac provided..

 
 
2007-05-04 09:58:32

[...] Check here for an explanation (thanks CV Mohan). Come back and appreciate Kiltak when he presents How Does the Binary System Work: An Introduction posted at [Geeks Are Sexy] Technology [...]

 
Comment by JimG_in_Austin
2007-05-06 21:52:45

One perhaps little-appreciated aspect of binary numbers is WHY they are used. Essentially, it comes down to noise margin - when there are only two choices (1 and 0), you have the largest possible range of valid state. For example, if the memory element power supply is at 1 Volt, then any stored signal below 0.5V is a ‘0′ and anything above is a ‘1″, so each has a valid range of 0.5V. If you have noise/error/uncertainty of 0.35V, say, you can still tell that a 0 is a 0 (0V-0.35V), and a 1 is a 1 (1.0V to 0.65V) Also, you know that if it is not ONE of the states, then it can ONLY be the other.

That said, there is nothing sacred about 2 state (binary) logic.
Every so often, someone decides to do a trinary (or more) logic element (say an SRAM bit cell). This seems like a great idea, because you can now hold “more” data (3 states instead of 2) in roughly the same amount of expensive silicon area (~ $1 per square millimeter, or about $4 billion per acre). The problem is that you now have to distinguish between three states, not two, and your errors in storing and sensing are now a much larger percentage of your valid signal range for each one of your states. Each state now only has 0.33V of valif range, so now your 0.35V of noise means you can no longer decide which state a given signal is in. This is why the industry keeps coming back to binary systems.

To me, this signal to noise concept of only needing to make a simple this OR that decision is the basis of all the digital revolution - if you can cleanly get your quantities digitized, then they are EXTREMELY stable in the presence of noise, because a clean 1 or 0 can be “easily” regenerated even if noise is added.

 
2007-06-04 00:37:10

[...] Want to know how the binary system works? [...]

 
2007-06-04 05:12:51

[...] presents How Does the Binary System Work: An Introduction posted at [Geeks Are Sexy] Technology News, saying, “A good piece I wrote about the binary [...]

 
2007-06-26 07:34:01

[...] [GAS] article: How Does the Binary System Work: An Introduction Share and Enjoy: These icons link to social bookmarking sites where readers can share and [...]

 
Comment by Mariana
2007-12-02 15:39:00

I have a question. In the number 01001010, why is there a zero at the beginning? Why is it important to say that there is no 128 in this number? Why isn’t there another 0 to say there is no 256? Do all binary numbers have a 0 at the beginning?

Comment by Chip Camden
2007-12-03 15:29:35

You don’t actually need the leading zero to represent the number in binary. But most uses of binary are in computer “words” that are a multiple of 8 “bits” (which make a “byte”). In this case, eight digits are represented, because it’s the smallest multiple of 8 bits into which the number fits.

 
 
Comment by Ami
2008-01-19 01:33:49

Eventually I may take the time to actually learn this. 3:30 AM is not a good time for learning binary. My boyfriend tried to teach it to me a couple of years ago, but I didn’t get it, so instead we figured out how much energy was in each one of our meals (we were at McDonald’s), and how long each meal would power a standard 70 watt lightbulb.

It was a fun conversation.

 
2008-02-04 08:22:05

[...] Check here for an explanation (thanks KV Mohan). Come back and appreciate Kiltak when he presents How Does the Binary System Work: An Introduction posted at [Geeks Are Sexy] Technology [...]

 
Comment by Emilovespeteandbowwow!!!
2008-02-24 03:18:43

binary is hard i have to do a assignment on it can anyone tell me what the binary number 4 35 and 100 is??

Comment by not sure
2008-02-27 11:25:56

00100011 - 35
01100100 - 100

is that right?

Comment by Kiltak
2008-02-27 11:51:35

Yep, right on :)

 
 
 
Comment by BinaryWolf
2008-04-14 15:30:25

Position of letters in the alphabet:
01100010 01101001 01101110 01100001 01110010 01111001 01110111 01101111 01101100 01100110

 
Name (required)
E-mail (required - never shown publicly)
URI
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.