Difference between revisions of "Talk:Bitwise math"
KaraG14ycq (Talk | contribs) (Created page with "The Two's complement part starts explaining the sign and magnitude method as if it was a kind of 2's complement ---- Two's complement is a way to represent negative numbers in...") |
KaraG14ycq (Talk | contribs) |
||
Line 6: | Line 6: | ||
A two's complement is basically a NOT operation performed on the nibble. Any binary number is converted between positive and negative by computing its two's complement. Basically, the leftmost bit is called the sign bit. '''There are two ways. (taking nibbles as an example) -1 could be 1001. This is not useful, as now there are two ways to represent 0, 1000 for -0 and 0000 for ordinary 0. Also the addition and subtraction has to be changed for this. This is all not nice. This is why people invented two's complement''', two's complement is basically using 1111 for -1 and 1000 for -8. | A two's complement is basically a NOT operation performed on the nibble. Any binary number is converted between positive and negative by computing its two's complement. Basically, the leftmost bit is called the sign bit. '''There are two ways. (taking nibbles as an example) -1 could be 1001. This is not useful, as now there are two ways to represent 0, 1000 for -0 and 0000 for ordinary 0. Also the addition and subtraction has to be changed for this. This is all not nice. This is why people invented two's complement''', two's complement is basically using 1111 for -1 and 1000 for -8. | ||
---- | ---- | ||
+ | |||
+ | add stupid latex notations like X(w/stupid line on it's head), ~, ¬, ! | ||
+ | |||
+ | steal from http://de.wikipedia.org/wiki/Boolesche_Algebra if needed :3 |
Revision as of 00:57, 24 June 2012
The Two's complement part starts explaining the sign and magnitude method as if it was a kind of 2's complement
Two's complement is a way to represent negative numbers in binary, the same thing as giving an integer a sign. Getting into the mechanics of two's compliment, though it ends up with a few ways to do it. Signing bits are used these days. A two's complement is basically a NOT operation performed on the nibble. Any binary number is converted between positive and negative by computing its two's complement. Basically, the leftmost bit is called the sign bit. There are two ways. (taking nibbles as an example) -1 could be 1001. This is not useful, as now there are two ways to represent 0, 1000 for -0 and 0000 for ordinary 0. Also the addition and subtraction has to be changed for this. This is all not nice. This is why people invented two's complement, two's complement is basically using 1111 for -1 and 1000 for -8.
add stupid latex notations like X(w/stupid line on it's head), ~, ¬, !
steal from http://de.wikipedia.org/wiki/Boolesche_Algebra if needed :3