|
|
 |
Re: FN-FORUM: Twos Complement Binary
date posted 13th January 2007 13:29
Hello James,
Basically, twos compliment is the method by which signed integers are
represented on a computer. Negative numbers are represented by the twos
compliment of the absolute number. So 4 is 0100 and -4 is 1100.
The twos compliment of a number is calculate by inverting the bits and
then adding 1. You just ignore bit overflow.
For example, take the number 4 which is 0100 in binary. Flip the bits
giving 1011 then add 1 giving 1100. Just repeat the process to go from
negative to positive (flip the bits then add 1).
HTH,
--
Cheers,
Gary
http://www.garyshort.org/
James Herrington wrote:
> Hi,
>
> I appreciate that this probably isnt the best place to ask this question but
> I have a computing exam on monday and am struggling understanding how twos
> complement binary works!!!
>
> Does anyone know of any simple tutorials or can anyone give me a brief
> description of how the system works?
>
> Thanks
>
> James
>
|
 |
|