That's an interesting concept. So, if we use this system, the first few numbers would be:
  1. 0000 0001
  2. 0000 0110
  3. 0000 0111
  4. 0000 0100
  5. 0000 0101
  6. 0001 1010
  7. 0001 1011
  8. 0001 0000
  9. 0001 0001
  10. 0001 0110
The system goes from -170 to 85, giving us 256 possible numbers, as we should have.

Does that look correct? What are the possible benefits to the negabinary system? What calculations does it make easier that binary has a problem with? I know that it would make working with negative numbers much easier, but why is that a problem with the current high-bit-flip?

Update: Just as a thought, wouldn't an inverse negabinary system work better? You'd go from -85 to 170 in an 8-bit number, which would allow more positives than negatives, which would seem more useful. (Interestingly enough, 85 * 2 = 170 ...) In that system, you'd have:

  1. 0000 0011
  2. 0000 0010
  3. 0000 1101
  4. 0000 1100
  5. 0000 1111
  6. 0000 1110
  7. 0000 1001
  8. 0000 1000
  9. 0000 1011
  10. 0000 1010
(Coincedentally, the second list is the negative numbers from the first system, and vice versa.)

------
We are the carpenters and bricklayers of the Information Age.

Vote paco for President!


In reply to Re: Negabinary Number System by dragonchild
in thread Negabinary Number System by srawls

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.