Number in binary is represented as normal:
One of the bits, often the leading one, is used to represent the POSITIVE or NEGATIVE value of the number being represented(for various reasons this is often not a practical representation to use). Signed integers were used in some of the early computer algorithms/architecture, twos complement is now more widely used following IBMs adoption of this representation.
Numbers are often alternatively stored in twos complement form, which is arrived at using following steps:
Once we have the unsigned integer, showing in ONEs complement form, then we can convert it to the final representation often used which is the twos complment form (TOP TIP - why? Twos complement form allows a negative and positive binary number to be added together without any special handling).
43 = 00101011
43 in ones complement = 11010100
43 in twos complement=11010100 + 00000001(add one to it (do the manual working)) = 11010101
DENARY NUMBER to BINARY NUMBER to ONE'S COMPLEMENT to TWO'S COMPLEMENT(add one to one's complement)
Using the twos complement representation of the negative number, this number can then just be added to another, to take it away from it.
5 -4
step 1 - convert both to binary numbers
step 2 - convert 4 to minus 4 using twos complement
step 3 - add 5 binary number and -4 binary number together to make the calculation
ADDITIONAL NOTE - If we were needing to subtract one number from another, we would need to first convert the number we are subtracting from the other, into two complement form, then just add the two numbers together as normal.
ACTIVITY: