Go to Post I expect you to make mistakes and need help constantly. Just be sure each time you come to me, it's a new mistake and a different kind of help you need. This way I know you're growing. - Rich Kressly [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #12   Spotlight this post!  
Unread 07-12-2002, 09:59
Lloyd Burns Lloyd Burns is offline
Registered User
FRC #1246 (Agincourt Robotics)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Toronto
Posts: 292
Lloyd Burns is an unknown quantity at this point
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
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 04:25.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi