Information Representation - Codes
Representing Numerical Values - Signed integers (1 of 2)


Signed integers are positive or negative whole numbers. The first bit of the binary representation of a signed integer is used to represent the sign (positive or negative) of the number. This means that there is one less bit available to represent the value of the number, so the maximum size of the number is reduced.

e.g. An unsigned 8 bit integer could go up to 255 while the 7 bits of a signed integer could only go up to 128; the remaining bit of 0 or 1 must indicate the sign.

If we take 0 to represent a plus sign and a 1 to represent a minus sign then 01111111 = +128 while 11111111 = -128

In this system +7 would be 00000111
and -7 would be 10000111
Adding we get   0 decimal, 10001110 binary = -14 decimal!

This is not really satisfactory.