|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#12
|
|||
|
|||
|
My complements
I see many operational definitions of "complementing", which means "filling up".
The two's complement of a number is the number which, added to the number, gives 2 (that is, it "fills up" to the two. In binary, two is 10, the twos complement of '1' is '1', which adds to 0, with a carry. In binary, if the number must be represented in n bits, then you probably mean to find the n-bit "two's complement", which means the number added to your number which gives a rollover to 'n' zeros and a carry (for the n+1st bit (or all zeros and a carry). ** Without resorting to bits .... For a nibble (4 bits), which allows a 15(decimal) max before rollver (that is, the one bit in the fifth place means 16), the "two's complement" is the number which added to your number gives 16. If your number is 5, then 11 is the "twos complement" giving zeros in the four bits and a carry to a fifth. ** It works in decimal, too .... The ten's complement of seven is three: add three to seven, you get zero, and a carry, which is 10. in two digits. ** Operationally, with bits, recpping earlier posts ... If you want two's complements, add one to all n bits, and add one to the result. Last edited by Lloyd Burns : 07-12-2002 at 10:09. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| I'll delete this in a couple of hours. | hixofthehood | Chit-Chat | 9 | 04-02-2003 23:26 |
| couple of questions... | archiver | 2001 | 5 | 23-06-2002 22:48 |
| A couple of problems I observed at the MAR | archiver | 2000 | 3 | 23-06-2002 22:27 |
| Couple other thank yous | Jason Haaga | Thanks and/or Congrats | 0 | 29-04-2002 03:29 |
| A Couple Questions about Chairman's Award | ben_whly | Chairman's Award | 4 | 26-01-2002 18:24 |