Why do we actually need 1s compliment?
Can we simply make a number negative or positive by by just flipping one bit! the MSB bit? Why do we need to flip all bits
Why do we actually need 1s compliment?
Can we simply make a number negative or positive by by just flipping one bit! the MSB bit? Why do we need to flip all bits
Depending on your needs,
1s complement,2s complementorsign-magnitude(flipping the MS bit) can all be useful. There is no definitive criterion by which any of the representations is universally superior.To answer your question,
1s complementcan be better thansign-magnitudewhen you are performing arithmetic operations. You would need different hardware for addition and subtraction when usingsign-magnitude; but you can use the same hardware for both operations when using1s complement(i.e., addition is addition, subtraction is addition with complement).