Why prefer two’s complement over sign-and-magnitude for signed numbers?

I’m just curious if there’s a reason why in order to represent -1 in binary, two’s complement is used: flipping the bits and adding 1? -1 is represented by 11111111 (two’s complement) rather than (to me more intuitive) 10000001 which is binary 1 with first bit as negative flag. Disclaimer: I don’t rely on binary … Read more

What is “2’s Complement”?

I’m in a computer systems course and have been struggling, in part, with Two’s Complement. I want to understand it but everything I’ve read hasn’t brought the picture together for me. I’ve read the wikipedia article and various other articles, including my text book. Hence, I wanted to start this community wiki post to define … Read more