+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
Like Tree3Likes

Thread: binary to computer number systems

  1. #1
    raven_cloudwind18 is offline x10Hosting Member raven_cloudwind18 is an unknown quantity at this point
    Join Date
    Dec 2010
    Location
    Philippines
    Posts
    5

    binary to computer number systems

    Can anyone help me with my problem my question is how is 55 in decimal converted to 67 in octal?
    dinomirt96 likes this.

  2. #2
    renr3n is offline x10Hosting Member renr3n is an unknown quantity at this point
    Join Date
    Apr 2010
    Posts
    28

    Re: binary to computer number systems

    See the image for my own explanation.

    binary to computer number systems-2011-09-07-170325_1360x768_scrot.png

  3. #3
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: binary to computer number systems

    Why those two numerals? Smells a little like an assignment.

    Note that you can perform the conversion directly without using an intermediate base. Repeatedly take the remainder and integer quotient of the number (i.e. divide the number by the base). The remainders are the digits from least to greatest significance. The quotient is the number used in the next round. Stop when the number is 0 (or stop a round early when the quotient < base, using the quotient as the most significant digit). For example, consider converting the base-10 numeral 123 (often written "123₁₀"; subscripts in numerals are used to indicate base) to its base 7 equivalent.
    1. 123 % 7 = 4, 123 / 7 = 17. The least digit is 4.
    2. 17 % 7 = 3, 17 / 7 = 2. The next digit is 3.
    3. 2 % 7 = 2, 2 / 7 = 0. The next (and final) digit is 2

    The answer: 123₁₀ = 234₇.

    The same process works if neither base is a familiar one. Let's convert 123₉ to base 7. First, the beginning of the multiplication table for 7 in base 9 and (for comparison) 10:
    Code:
    base: 9 | 10
    --------+---
    1*7=  7 |  7
    2*7= 15 | 14
    3*7= 23 | 21
    4*7= 31 | 28
    5*7= 38 | 35
    6*7= 46 | 42
    1. A bit of long division to calculate 123₉ / 7:
      Code:
          015₉  ← The quotient
      7 ) 123₉
          12₉
         - 7
        ---
           43₉
          -38₉ = 5 * 7
          ---
            4  ← The remainder
      So 123₉ / 7 = 15₉, 123₉ % 7 = 4
    2. 15₉ / 7 = 2, 15₉ % 7 = 0
    Thus 123₉ = 204₇

    The reason this works becomes obvious if you examine what the process does to a numeral in the base you're converting to. The number M is represented in base b using the sum M = Σ aᵢ*bⁱ = a_n * bⁿ + ... + a₁ * b¹ + a₀ * b⁰, where the coefficients aᵢ are the digits of the numeral. Note the summation, like conversion, is representation-neutral; they work in any numeric representation. Conversion is easiest in base [i]b[/b], for if you examine the numeral in base b, you'll see that the remainder is the least significant digit and division by b is a right shift. The general process is:
    1. M = Σ aᵢ*bⁱ = a_n * bⁿ + ... + a₁ * b¹ + a₀ * b⁰
    2. M₁ = Σ aᵢ*bⁱ⁻¹ = a_n * bⁿ⁻¹ + ... + a₂ * b¹ + a₁ * b⁰; next digit: a₀
    3. M₂ = Σ aᵢ*bⁱ⁻² = a_n * bⁿ⁻² + ... + a₃ * b¹ + a₂ * b⁰; next digit: a₁
    4. ...

    (Note: I use "_n" for a subscripted "n" because the Unicode "subscript n" character, ₙ, isn't recognized on any computer I tested; it's not in any font, and it's not even listed in the system character viewers.)

    Or, using base b numerals:
    1. Start: M = a_n ... a₃ a₂ a₁ a₀
    2. M₁ = a_n ... a₃ a₂ a₁; next digit: a₀
    3. M₂ = a_n ... a₃ a₂ ; next digit: a₁
    4. ...

    Isn't working with different bases easy?

    See also the many questions about bases from Ask Dr. Math.
    Last edited by misson; 09-07-2011 at 07:29 AM.
    essellar likes this.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  4. #4
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: binary to computer number systems

    Life would be so much easier if every forum integrated LaTeX into their markup/markdown, like they do at the math and physics StackExchange sites. Time to do some investigating...
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  5. #5
    Darkmere's Avatar
    Darkmere is offline x10 Lieutenant Darkmere is an unknown quantity at this point
    Join Date
    Jun 2011
    Location
    Fernley, Nevada
    Posts
    360

    Re: binary to computer number systems

    Mission isnt Octal Base 8 rather than Base 7? From what I learned Septenary is Base 7 and Octal is Base 8
    Last edited by Darkmere; 09-07-2011 at 10:53 AM.

    Computer Forensics/Security Student
    Kaplan University
    Site: http://skynet.x10.mx

  6. #6
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: binary to computer number systems

    Darkmere -- misson's example was about computing a representation of a number in any arbitrary base, and he specifically said that the first example was to convert to base 7. (The introductory paragraph can be roughly translated as, "I'm not going to do your homework for you.") The point was to give the general method, not the solution to a specific problem. Teaching a man to fish, so to speak, rather than throwing a halibut his way.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

  7. #7
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: binary to computer number systems

    Give a man a fire and he's warm for the day. But set fire to him and he's warm for the rest of his life

    Quote Originally Posted by essellar View Post
    Life would be so much easier if every forum integrated LaTeX into their markup/markdown, like they do at the math and physics StackExchange sites.
    Heck, I'd settle for <sub> and <sup>
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  8. #8
    Darkmere's Avatar
    Darkmere is offline x10 Lieutenant Darkmere is an unknown quantity at this point
    Join Date
    Jun 2011
    Location
    Fernley, Nevada
    Posts
    360

    Re: binary to computer number systems

    Yeah I was surprised that the [sub] and [sup] bb code doesn't work either

    Computer Forensics/Security Student
    Kaplan University
    Site: http://skynet.x10.mx

  9. #9
    adam.k is offline x10Hosting Member adam.k is an unknown quantity at this point
    Join Date
    Sep 2008
    Posts
    35

    Re: binary to computer number systems

    Just on the topic of Octal and Decimal, a joke I heard courtesy of my computer science professor
    "Real programmers always confuse Halloween and Christmas because Oct31 == Dec25" - Andrew Rutherford

    This made so much more sense after reading these posts about converting decimal to octal

    Thanks for making me laugh!

  10. #10
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: binary to computer number systems

    karimirt47 likes this.
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Systems is often down
    By wasmoo in forum Free Hosting
    Replies: 1
    Last Post: 05-21-2010, 12:10 PM
  2. Game systems
    By shadowdragon in forum Gamer's Lounge
    Replies: 10
    Last Post: 12-23-2008, 11:27 AM
  3. All systems down!
    By vic910 in forum Free Hosting
    Replies: 1
    Last Post: 07-13-2008, 07:58 PM
  4. How many systems do you have?
    By Kurther Reich in forum Gamer's Lounge
    Replies: 13
    Last Post: 07-05-2005, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers