TOPICS
Search

Sign-and-Magnitude Representation


A sign-and-magnitude representation is a fixed-width binary representation in which one bit records the sign and the remaining bits give the absolute value of the represented integer. By convention, the leading bit is 0 for a nonnegative value and 1 for a negative value. With eight bits, for example, 11 is represented by (00001011)_2 and -11 by (10001011)_2.

For a word of n bits, the representable integers satisfy -(2^(n-1)-1)<=x<=2^(n-1)-1. The strings (00...0)_2 and (10...0)_2 represent positive and negative zero, respectively. arithmetic must treat the sign separately from the magnitude.

The forms "sign and magnitude representation," "sign-magnitude representation," and "signed-magnitude representation" denote the same encoding. The first leaves the conjunction uncontracted, the second omits it, and the third uses the adjective "signed." Hyphens join the compound modifier in the entry title.


See also

Absolute Value, Binary, Binary Expansion, Bit, Encoding, Negabinary, Ones' Complement, Sign, Two's Complement, Zero

Explore with Wolfram|Alpha

References

Knuth, D. E. "Positional Number Systems." §4.1 in The Art of Computer Programming, Vol. 2: Seminumerical Algorithms, 3rd ed. Reading, MA: Addison-Wesley, p. 203, 1998.

Cite this as:

Weisstein, Eric W. "Sign-and-Magnitude Representation." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/Sign-and-MagnitudeRepresentation.html

Subject classifications