Give a simple algorithm for forming the two's complement representation of an integer from its one's complement representation.

Solution Here we are giving the simple algorithm for forming the two’s complement representation of an integer from its one’s complement representationStep 1 Two’s complement of an integer is a way of storing integers so that maths problems would be simpler to implement. Let the integer be m Binary representation of an integer m : One’s complement representation of m : - 1 ) + + + ……+ .+ Two’s complement representation of m :By comparing both the equations we get that , Two’s complement of m = One’s complement of m + .