Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Professor Fiel on Binary and Hex
#28
KajitiSouls Wrote:That was frankly confusing. I understand what you mean, but what if the rest of the stuff after the bits was all zeros? That's why I don't like such display of operations. Though granted it's a lot better for extremely large numbers. (hey you actually decided to get dynamic!)

Well, I found - to be somewhat inappropriate. I'm sure you did as well. (...) works prolly better. ((...) represents an infinite sequence of 1's)

I could try to explain how to bit-calc negative values, sh.

-1 is always represented in xoring as (...) 1. -10 is always (...) 10. -11 is (...) 01 or (...) 101.

First, find the positive binary number of the negative number. [1, 10, 11]
Second, remove 1 from the number. [0, 1, 10]
Third, NOT the number (switch all 1s to 0s and vice versa). [(...) 0, (...) 1, (...) 01]

Then XOR. If needed, convert back from negative value just reversing the way above. Tadaa, done.

Example:

[1 0000 0000, 1]
[1111 1111, 0]
[(...) 0000 0000, (...) 1]
Code:
(...) 0000 0000
XOR (...) 1111 1111
=         1111 1111

Then, the computing way is just simply to take (2^bits - a) XOR (2^bits - b). Gotta do it with a byte more though.
Reply


Messages In This Thread
Professor Fiel on Binary and Hex - by Russt - 2009-02-23, 04:28 AM
Professor Fiel on Binary and Hex - by Nikkey - 2009-02-23, 05:04 AM
Professor Fiel on Binary and Hex - by Serene - 2009-02-23, 05:07 AM
Professor Fiel on Binary and Hex - by JezzaRules - 2009-02-23, 05:16 AM
Professor Fiel on Binary and Hex - by Scaeva - 2009-02-23, 10:34 AM
Professor Fiel on Binary and Hex - by Fiel - 2009-02-23, 11:24 AM
Professor Fiel on Binary and Hex - by Dusk - 2009-02-23, 12:40 PM
Professor Fiel on Binary and Hex - by KaidaTan - 2009-02-23, 01:14 PM
Professor Fiel on Binary and Hex - by Shidoshi - 2009-02-23, 04:32 PM
Professor Fiel on Binary and Hex - by GummyBear - 2009-02-23, 08:19 PM
Professor Fiel on Binary and Hex - by chrome - 2009-02-23, 09:00 PM
Professor Fiel on Binary and Hex - by KajitiSouls - 2009-02-24, 12:32 AM
Professor Fiel on Binary and Hex - by Nikkey - 2009-02-24, 09:32 AM
Professor Fiel on Binary and Hex - by mizzblue - 2009-02-24, 09:54 AM
Professor Fiel on Binary and Hex - by KajitiSouls - 2009-02-24, 03:55 PM
Professor Fiel on Binary and Hex - by xLeviathan - 2009-02-24, 04:29 PM
Professor Fiel on Binary and Hex - by Mira - 2009-02-24, 04:37 PM
Professor Fiel on Binary and Hex - by Nikkey - 2009-02-24, 05:26 PM
Professor Fiel on Binary and Hex - by Berzerk - 2009-02-24, 10:13 PM
Professor Fiel on Binary and Hex - by Takebacker - 2009-02-25, 01:20 AM
Professor Fiel on Binary and Hex - by Shidoshi - 2009-02-25, 01:39 AM
Professor Fiel on Binary and Hex - by Hazzy - 2009-02-25, 01:56 AM
Professor Fiel on Binary and Hex - by Cancambo - 2009-02-25, 02:00 AM
Professor Fiel on Binary and Hex - by Nekonecat - 2009-02-25, 01:52 PM
Professor Fiel on Binary and Hex - by Fiel - 2009-02-25, 02:07 PM
Professor Fiel on Binary and Hex - by KajitiSouls - 2009-02-25, 04:48 PM
Professor Fiel on Binary and Hex - by Cancambo - 2009-02-25, 05:32 PM
Professor Fiel on Binary and Hex - by Nikkey - 2009-02-25, 05:54 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)