Computers use binary format to represent all types of information. To represent signed numbers there are three options:
Signed Magnitude Representation
A sign bit is used to indicate the sign of the number, e.g. a 0 indicates a + sign and a 1 indicates a  sign (negative number). The rest of the number is just the magnitude in binary format.
Examples on signmagnitude representation of signed numbers 
+9 is represented as 01001
9 is represented as 11001

Range: Using n bits, the range of numbers that can be represented is from –(2 ^{n1}  1) to +2 ^{n1}  1 .
Examples: Ranges of numbers using signmagnitude notation 
Examples:
Using 8 bits, we can represent numbers in the range: 127 to +127
Using 12 bits, we can represent numbers in the range: 2047 to +2047

Advantages: Simple (number representation is straight forward).
Disadvantages:
 Has the problem of double representing the 0 (–0 and +0),
 Complicates the design of the logic circuits that handle signednumbers arithmetic,
 This is because each of the sign and magnitude parts has to be processed separately,
 Also, the sign of both numbers have to be examined before the actual operation (addition or subtraction) is determined,
 Separate circuits are required to do the addition and subtraction operations.
1's Complement Representation
Positive numbers are represented using normal binary equivalent while negative numbers are represented by the 1's complement (complement) of the normal binary representation of the magnitude.
Examples on signed numbers representation using 1`s complement 
+9 is represented as 01001
9 is represented as 10110 (obtained by complementing the binary representation of 9).
Important Note: Negative numbers will always have a 1 in the MSB while positive numbers will have a 0 in the MSB.

Range: Using n bits, the range of numbers that can be represented is from –(2 ^{n1}  1) to +2 ^{n1}  1 .
Advantages:
 Still relatively simple to represent the numbers,
 Simpler Add/Subtract circuit design (subtracting a number from another involves complementing the subtracted and then adding it to the other number).
Disadvantages:
 Has the problem of double representing the 0 (0…000 and 11…111),
 The Add/Subtract operations are still relatively complex,
 This is because the last carry bit has to be examined to determine if an overflow
A condition that occur when the result of adding two signed0numbers is larger than the destination (I.e. outside the range) has occurred, a further addition of a 1 is necessary (i.e. Addition/Subtraction is done in twosteps) or the output should be complemented.
Overflow can occur when adding two numbers with the same sign (i.e. both positive or both negative) and the result is outside the range of possible numbers. Overflow can be detected by checking if the sign bit of the result is different from that of both operands. If the two operands have different signs, then overflow cannot occur and no need to check it.
Examples illustrating 1`s complement Add/Subtract operations 
Example 1: Adding 0111 + 0111
The result is 1110 and the carry out is 0, hence an overflow has occurred (adding two positive numbers resulted in a negative number, 1 in this case).
Example 2: Subtracting 0001  0111
First the subtrahend is complemented and becomes 1000. Then it is added to the minuend and the result is 1001 with no end carry. The result represent –6 (the correct result) and no further addition is required.
Example 3: Subtracting 0111  0001
Again, the subtrahend is complemented and becomes 1110. Then it is added to the minuend and the result is 0101 with an end carry of 1. This carry has to be added to the previous result and yields 0110 (+6, the correct answer).

2's Complement Representation
Positive numbers are represented using normal binary equivalent while negative numbers are represented by the 2's complement (complement) of the normal binary representation of the magnitude. The 2's complement of a binary number equals its 1's complement + 1.
Examples of 2`s complement representation of signed numbers 
The easiest way to obtain the 2's complement of a binary number is by starting at the LSB, leaving all the 0s unchanged, look for the first occurrence of a 1. Leave this 1 unchanged and complement all the bits after it.
+9 is represented as 01001
To represent –9, first obtain the binary equivalent: 01001. Now leave the LSB 1 unchanged and complement all the remaining bits to get 10111, which represent –9 in 2's complement.
Important Note: As with 1's complement, negative numbers will always have a 1 in the MSB while positive numbers will have a 0 in the MSB.

Range:
 Using n bits, the range of numbers that can be represented is from –2^{n1} to +2^{n1}  1 .
  The 2^{n1} is represented by the 1000…000 code, which has no 2's complement, hence the unsymmetrical range. E.g. if 8 bits are used, the range of numbers that can be represented is from –128 to +127.

Advantages:
 No double representation of 0 (the 2's complement of 0 is still 0),
 Simplest Add/Subtract circuit design (subtracting a number from another involves 2's complementing the subtracted and then adding it to the other number),
 Add/Subtract operations is done in onestep, the end carry is only examined to determine if an overflow has occurred (as shown in the example below), otherwise it is discarded.
 The end result is already represented in 2's complement (only if there is no overflow).
That is why this is the most preferred method for signednumber representations in computers.
Examples illustrating 2`s complement Add/Subtract operations 
Example 1: Adding 0111 + 0111
The result is 1110 (2), hence an overflow has occurred (adding two positive numbers resulted in a negative number).
Overflow detection in 2's complement Add/Subtract operations:
If the last two carries are not equal, an overflow has occurred
In example 1 above, the last carry out was 0 while the carrybefore the last was 1, hence an overflow can be detected.
Example 2: Subtracting 0001  0111
First the subtrahend is 2's complemented and becomes 1001. Then it is added to the minuend and the result is 1010 with the last two carries being 0 (no overflow). The result represents –6 in 2's complement (the correct result) and no further operation is required.
Example 3: Subtracting 0111  0001
Again, the subtrahend is complemented and becomes 1111. Then it is added to the minuend and the result is 0110 (+6, the correct result). Since the last two carries being 1 no overflow has occurred and no further operations are required.

Disadvantages:
 The unsymmetrical range, which is not a serious problem,
 It is slightly more complex to obtain the 2's complement (it involves complementing and adding 1). However this can be accomplished very easily during the Add/Subtract operations (by making the first carry in 1 and complementing the subtrahend).
Sign Extension
In many situations we need to move a signednumber from one location to another with larger number of bits. This has to be done while keeping both magnitude and sign correct. This procedure is called SignExtension
Moving a signednumber from one location to another with larger number of bits while keeping both magnitude and sign correct. For numbers represented in 1's or 2's complement the procedure is described below:
SignExtension Procedure for signednumbers represented in 1`s and 2`s complement notations 
To move an nbit signed number into an mbit location with m>n:
 Put the nbit number in the lowestsignificance nbits of the mbit location,
 Fill all the remaining higher significance (mn bits) with the sign bit (i.e. the nth bit). This ensures that both the magnitude and sign of the number are preserved.
Examples on signextension:
 Represent the number 1101 (3 in 2's complement or –2 in 1's complement) using 8bits:
Answer: Applying the procedure above we get: 11111101, which is –00000011 (i.e. –3) in 2's complement and –00000010 (i.e. –2) in 1's complement. Hence both the magnitude and sign were preserved.
 Represent the number 0101 (+5 in both1's and 2's complement) using 8bits:
Answer: Applying the procedure above we get: 00000101, which is still +5 in both 1's and 2's complement.

