two's complementarithmetic
Two's complement arithmetic is a way of representing both positive and negative numbers in binary without using a negative sign during subtraction. This is done because computers can only understand binary at the base level. The first bit is used as a signed bit representing the sign, 1 negative and 0 positive. To convert between negative and positive, all bits are inverted and then 1 is added. Positive and negative numbers in two's complement can be added using the normal carrying methods of addition without the need for subtraction. The fourth bit of the answer is the signed bit, and the fifth is always thrown out.
|