Results 1 to 8 of 8

Math Help - working in base 2 /binary

  1. #1
    Junior Member
    Joined
    Dec 2007
    From
    University of California, Berkeley
    Posts
    48

    working in base 2 /binary

    .


    .
    Last edited by yellow4321; March 6th 2008 at 05:17 AM.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,846
    Thanks
    321
    Awards
    1
    Quote Originally Posted by yellow4321 View Post
    ok the base 2 representation of

    571 = 2^9 + 2^5 + 2^4 + 2^3 + 2 + 1 = (1000111011)

    but i dont understand how the numbers 2^9 for example correspond to the 1's and 0's. i know how to compute the powers i just dont see how from that i cant write it out in 1s and 0s.
    thanks.
    Look at the coefficients of the 2s.

    An example in base 10 might help:
    571 = 5 \cdot 10^2 + 7 \cdot 10^1 + 1 \cdot 10^0

    Similarly:
    571 = 1 \cdot 2^9 + 0 \cdot 2^8 + 0 \cdot 2^7 + 0 \cdot 2^6 + 1 \cdot 2^5 + 1 \cdot 2^4 + 1 \cdot 2^3 + 0 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \implies 1000111011

    Does this help?

    -Dan
    Follow Math Help Forum on Facebook and Google+

  3. #3
    is up to his old tricks again! Jhevon's Avatar
    Joined
    Feb 2007
    From
    New York, USA
    Posts
    11,663
    Thanks
    3
    Quote Originally Posted by topsquark View Post
    Look at the coefficients of the 2s.

    An example in base 10 might help:
    571 = 5 \cdot 10^2 + 7 \cdot 10^1 + 1 \cdot 10^0

    Similarly:
    571 = 1 \cdot 2^9 + 0 \cdot 2^8 + 0 \cdot 2^7 + 0 \cdot 2^6 + 1 \cdot 2^5 + 1 \cdot 2^4 + 1 \cdot 2^3 + 0 \cdot 2^2 + 1 \cdot 2^1 + 1 \cdot 2^0 \implies 1000111011

    Does this help?

    -Dan
    yes, that does help, i've never seen this method before. thanks

    it kind of seems clumsy though. how would you know how to represent 571 as a combination of different powers of 2's quickly and easily. do you start with the highest power of 2 you can get without exceeding the number, and then just stumble your way through the lower powers?

    EDIT: wait, i think i got it, lemme check

    EDIT 2: yeah, i got it, it wasn't as tedious as i thought it would be. that's nice!
    Follow Math Help Forum on Facebook and Google+

  4. #4
    MHF Contributor

    Joined
    Aug 2006
    Posts
    18,605
    Thanks
    1574
    Awards
    1
    Quote Originally Posted by yellow4321 View Post
    571 = 2^9 + 2^5 + 2^4 + 2^3 + 2 + 1 = (1000111011) but i dont understand how the numbers 2^9 for example correspond to the 1's and 0's. i know how to compute the powers i just dont see how from that i cant write it out in 1s and 0s.
    Note that we end up with a 10-bit string.
    We have a 1 in each place where that is a power of two.
    See that there is 2^9 but none of  2^8 \; 2^7 \; 2^6 but there is a 2^5.
    Thus we see 10001 . That is, there is a 1 where there is a power of two.
    From right to left, there are ones in the first two positions but a zero in the third position because there is no 2^2.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,846
    Thanks
    321
    Awards
    1
    Quote Originally Posted by Jhevon View Post
    yes, that does help, i've never seen this method before. thanks
    You're kidding me, right? I thought that technique was basic. How else would you convert a number to binary?

    -Dan
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Junior Member
    Joined
    Dec 2007
    From
    University of California, Berkeley
    Posts
    48
    yeah i remember now! and the powers are just formed from the euclidean algorithm, many thanks.
    Follow Math Help Forum on Facebook and Google+

  7. #7
    is up to his old tricks again! Jhevon's Avatar
    Joined
    Feb 2007
    From
    New York, USA
    Posts
    11,663
    Thanks
    3
    Quote Originally Posted by topsquark View Post
    You're kidding me, right? I thought that technique was basic. How else would you convert a number to binary?

    -Dan
    i was taught the method where you repeatedly divide the number by two. in doing so, you will always get a remainder of 0 or 1. the trick is to keep track of these remainders, at the end, the remainders give you the number in binary when you read them in reversed order.

    that method (as well as your method) is shown here

    look at the "Short division by 2 with remainder" section for the method i described
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    9,846
    Thanks
    321
    Awards
    1
    Quote Originally Posted by Jhevon View Post
    i was taught the method where you repeatedly divide the number by two. in doing so, you will always get a remainder of 0 or 1. the trick is to keep track of these remainders, at the end, the remainders give you the number in binary when you read them in reversed order.

    that method (as well as your method) is shown here

    look at the "Short division by 2 with remainder" section for the method i described
    I don't know if is in actuality another method or not. I would simply say that it is a slightly different book-keeping device for the same method.

    -Dan
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 1
    Last Post: December 13th 2011, 04:21 AM
  2. Replies: 1
    Last Post: March 7th 2010, 06:14 PM
  3. What is Base 2 (binary system)?
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: April 14th 2008, 07:10 PM
  4. Working in base 12...
    Posted in the Math Topics Forum
    Replies: 17
    Last Post: July 31st 2006, 02:05 PM
  5. Problems Working in Denary number base
    Posted in the Algebra Forum
    Replies: 4
    Last Post: June 19th 2006, 12:41 PM

Search Tags


/mathhelpforum @mathhelpforum