Results 1 to 9 of 9

Thread: Binary

  1. #1
    Charles's Avatar
    Charles is offline Senior Net Builder
    Join Date
    Dec 2008
    Location
    On the Bike
    Posts
    1,211
    Blog Entries
    5
    Thanks
    311
    Thanked 311 Times in 212 Posts

    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 22: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. #2
    A12Alex is offline 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.
    My Awesome Signature is awesome...

  4. #3
    Charles's Avatar
    Charles is offline Senior Net Builder
    Join Date
    Dec 2008
    Location
    On the Bike
    Posts
    1,211
    Blog Entries
    5
    Thanks
    311
    Thanked 311 Times in 212 Posts
    Quote Originally Posted by A12Alex View Post
    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. #4
    Desan is offline 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. #5
    Charles's Avatar
    Charles is offline Senior Net Builder
    Join Date
    Dec 2008
    Location
    On the Bike
    Posts
    1,211
    Blog Entries
    5
    Thanks
    311
    Thanked 311 Times in 212 Posts
    Quote Originally Posted by Desan View Post
    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. #6
    Desan is offline Moderator
    Join Date
    Dec 2008
    Location
    Finland
    Posts
    469
    Blog Entries
    2
    Thanks
    101
    Thanked 52 Times in 35 Posts
    Quote Originally Posted by Charles View Post
    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. #7
    Loko's Avatar
    Loko is offline Super Moderator
    Join Date
    Dec 2008
    Location
    Europe
    Posts
    964
    Thanks
    351
    Thanked 347 Times in 241 Posts
    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. #8
    stickycarrots's Avatar
    stickycarrots is offline Experienced Net Builder
    Join Date
    Dec 2008
    Location
    QuickInbox.com
    Posts
    753
    Blog Entries
    6
    Thanks
    18
    Thanked 86 Times in 59 Posts
    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. #9
    Charles's Avatar
    Charles is offline Senior Net Builder
    Join Date
    Dec 2008
    Location
    On the Bike
    Posts
    1,211
    Blog Entries
    5
    Thanks
    311
    Thanked 311 Times in 212 Posts
    Quote Originally Posted by stickycarrots View Post
    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?

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •