1. ## Binary

We use base-10 numeral, decimal (i.e. 0-9). The machines that we are currently operating on use base-2 numeral, binary (i.e. 0-1). 8 binary digits (bits) form a byte. ASCII characters consist of 8 binary digits, and therefore are the equivalent of a byte.

How Houses Form

Base-10:

What happens after 9? You got it, 10.
What happens after 99? You got it, 100.
What happens after 999? You got it, 1000.

Base-2:

What happens after 1? 10.
What happens after 11? 100.
What happens after 111? 1000.

Learn to Count

Base-10:

1's House: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (contains all numbers before 10)
10's House: 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, etc. (contains all numbers before 100)

Base-2:

1's House: 0 (0), 1 (1) (contains all numbers before 2)
2's House: 10 (2), 11 (3) (contains all numbers before 4)
4's House: 100 (4), 101 (5), 110 (6), 111 (7) (contains all numbers before 8)
8's House: 1000 (8), 1001 (9), 1010 (10), 1011 (11), 1100 (12), 1101 (13), 1110 (14), 1111 (15) (contains all numbers before 16)

Do you notice a pattern?

Base-2's houses continually double. All houses contain the numbers before the name of the next largest house.

List of Houses

Base-10:

1000's, 100's, 10's, 1's (to calculate decimal, multiply the digits by their houses, and add all of the digits together).

I.e. 4028 = (4 * 1000) + (0 * 100) + (2 * 10) + (8 * 1)

Base-2:

256's, 128's, 64's, 32's, 16's, 8's, 4's, 2's, 1's (to calculate decimal, multiply the digits by their houses, and add all of the digits together).

I.e. 101101001 = (1 * 256) + (0 * 128) + (1 * 64) + (1 * 32) + (0 * 16) + (1 * 8) + (0 * 4) + (0 * 2) + (1 * 1), in decimal this equals 361.

Formula to calculate base-2 houses: 2^0 = 1, 2^1 = 2, 2^2 = 4, 2^3 = 8 etc.

Quick ways to convert to decimal

• Count how many bits there are. List that number of houses. Add all 1's house names together, ignore the 0's.
• 101111111 = 511 (next largest house name negative one) - 128 (only 0) = 383

Converting decimal to binary

1. Grab your decimal number that you wish to convert. For this example, I'll use 42.
2. Work out the highest possible binary house that you can that is lower than 42 (or your decimal number). In this case 32.
3. Deduct this number from your decimal number (i.e. 42 - 32 = 10).
4. Repeat steps 2 and 3 with your new decimal number (i.e. 10). 8. 10 - 8 = 2.
5. Repeat step 4 until your decimal number is 0. 2. 2 - 2 = 0.
6. List all of the houses lower than (and including) the number than you worked out in step 2. 32, 16, 8, 4, 2, 1.
7. Work out which houses you deducted from your decimal number. Place a 1 in each of these houses. 32, 8, 2. (1 = yes / on / do).
8. Work out which houses you did not deduct from your decimal number. Place a 0 in each of these houses. 16, 4, 1. (0 = no / off / don't). You should now have your binary number. In this case: 101010.

This took a fairly long time to write, so I hope it is useful to at least someone! Good luck.
Last edited by Charles; 6 March, 2009 at 23:03 PM. Reason: Typo.

2. ## Thanked by:

A12Alex (6 March, 2009), Desan (6 March, 2009), jayant_me (6 March, 2009), Shenron (6 March, 2009)

3. Newbie Net Builder
Join Date
Feb 2009
Location
Queensland, Australia.
Posts
90
Blog Entries
1
Thanks
15
Thanked 9 Times in 6 Posts
I had to learn binary for a class at school one time, and it was really lame, but whatever, thanks lol.

4. Originally Posted by A12Alex
I had to learn binary for a class at school one time, and it was really lame, but whatever, thanks lol.
No problem. We've just been given an ASCII chart and have been told to memorize each and every character. Hard work.

5. Moderator
Join Date
Dec 2008
Location
Finland
Posts
469
Blog Entries
2
Thanks
101
Thanked 52 Times in 35 Posts
Nice post Charles. But that is a bit too much for my little brains to process...
Maybe I should give it more time, or update my brains.

6. Originally Posted by Desan
Nice post Charles. But that is a bit too much for my little brains to process...
Maybe I should give it more time, or update my brains.
It looks more complex than it is. If you read over it a few more times, you should get it.

"There are 10 types of people in the world -- those who understand binary and those who don't."

7. Moderator
Join Date
Dec 2008
Location
Finland
Posts
469
Blog Entries
2
Thanks
101
Thanked 52 Times in 35 Posts
Originally Posted by Charles
It looks more complex than it is. If you read over it a few more times, you should get it.

"There are 10 types of people in the world -- those who understand binary and those who don't."
Yeah. I think reading it few more times would help. My brains just freeze when I see lots of numbers.

8. Nice workout Charles!

Reminds me of the days when computers where completely new to me (and probably many others) waaaayyy back in the early 80's. What I did then was to make a list of 0-255 (DEC) and then convert it to binary code by looking at a small sprite that I made on the screen. This was on the Commodore VIC-20 and later on the good old '64. Quite hilarious when I think about it now
Later in college, we learned some decent methods to convert BIN-DEC-HEX etc. but most of that has been forgotten.

9. I had to learn binary last year for one of my freshmen IT classes here at the Univeristy. I found base 2 pretty easy, but when we did base 8 and base 16 it took a little longer to catch on and get the numbers perfect.

01100010 01101001 01101110 01100001 01110010 01111001

10. Originally Posted by stickycarrots
01100010 01101001 01101110 01100001 01110010 01111001
Let me finish that for 'ya!

01110010 01110101 01101100 01100101 01110011

Here's a question for y'all to answer fo' me... What use is binary to humans?