Number System

Sign-Magnitude

A two-sided sign card stands next to a stack of counting cubes.

Sign-Magnitude definition

Sign-magnitude is a signed integer representation that stores a sign separately from the digits of the absolute value.

In Spanish
signo y magnitud
Topic
Number bases and digital representations

Sign-Magnitude in a picture

Sign-Magnitude diagramWith four bits, 1011 has sign bit 1 and magnitude 011, so its value is −3.Split 1011 into 1 and 011The first bit stores the signRead 011 as unsignedIts magnitude is 3Apply the negative signThe resulting integer is −3
With four bits, 1011 has sign bit 1 and magnitude 011, so its value is −3.

How it works

In a common n-bit binary version, the leftmost bit is 0 for a nonnegative sign or 1 for a negative sign. The remaining n − 1 bits represent the unsigned magnitude. This produces separate bit patterns for positive and negative zero.

Worked examples

Decode 0101 in four-bit sign-magnitude.

Sign 0 and magnitude 101 give +5.

Encode −6 with four bits.

Use sign 1 and magnitude 110, giving 1110.

Which two patterns represent zero with four bits?

0000 and 1000.

Common mistake

Check the signed representation before decoding. The same bit pattern can mean a different number in two’s complement.

Quick check

What does four-bit sign-magnitude 1101 represent?

What is the largest magnitude in four bits?

Show answer

7.

Which bit sets the sign in the common layout?

Show answer

The leftmost bit.

Sources

Flashcard

Sign-Magnitude

Reveal the definition

Sign-magnitude is a signed integer representation that stores a sign separately from the digits of the absolute value.

Effortless Math. “Sign-Magnitude.” Math Dictionary.