Two’s complement representation seems very unintuitive for us as human being. Why do machines use them then? Given what you said, what is/are the disadvantages of two’s complement scheme, beside being unintuitive to us?
2's Complement is used in computing the signed numbers in binary. It is complement with respect to 2^n. It is used for signed number representation in computer.
So, machines uses the two's complement to represent a signed bit. Machines are using the binary number pattern for the data. In binary numbers there is only 0's and 1's. So, we can't use minus sign for any number. So, for understand a signed bit machines uses two's complement. For example binary number 010 is for integer 2, then its two's complement 110 is for −2.
So, machines are using 2's complement to states the difference between signed numbers. It also helps them in subtraction of numbers.
For disadvantage we know that it is too complex for us. but there are other disadvantages also as given below.
if you try to negate the lowest representable value, you get an overflow in two's complement For example, in 64 bit two's complement, the lowest value is -2^63, while the highest value is 2^63-1. The highest value can be negated but for negating the lowest possible value it generates an overflow.
also other disadvantage is With two complement method you can't compare the size of two Integers with logic operators at lowest level of hardware.
So, this is why machines are using two's complement and disadvantages of two's complement.
Get Answers For Free
Most questions answered within 1 hours.