# Difference between two's complement and sign-and-magnitude

I'm just starting to learn about representing numbers in sign-and-magnitude and two's complement, and both as signed binary integers two's complement if representing a negative number I should invert all bits and add one, while sign-and-magnitude represents negative numbers with the first bit as a sign bit, but is it possible whether I can tell if a number is represented in sign-and magnitude or two's complement from just looking at it?

• Only looking at binary you cannot even say is it signed or unsigned. Everything depends on interpretation. This is why we need types. Jun 19, 2022 at 6:08
• (Only looking at a binary representation of an integer I couldn't tell little endian from big endian, unsigned from signed. And in addition to signed and two's complement, there's biased and some more representations that have fallen out of favour (for a reason).) Interpretation is the difference. Jun 19, 2022 at 8:24

[Usually, sign-and-magnitude allow negative zero; if not in your context, then you could say that $$100\cdots0$$ is a two's complement number, anyway.]