next up previous
Next: One's Complement Up: Integers Previous: Integers

Sign-Magnitude

Consists of an n bit unsigned magnitude and a sign bit.

The definition of the sign bit is:

0: the integer is positive or zero;
1: the integer is negative or zero.

The integer represented in (n+1) bit sign-magnitude is

displaymath2764

The range of values for an (n+1) bit sign-magnitude integer is tex2html_wrap_inline2766 to tex2html_wrap_inline2768 .

The format of an 8-bit sign-magnitude number is:

tabular492

Some examples of 8-bit sign-magnitude numbers are shown below:

tabular501

The range of an 8-bit sign-magnitude integer is -127 to +127.

There are different sign-magnitude representations for +0 and -0.

Sign reversal and absolute value operations are easy using sign-magnitude representation.

Adding the negative of a number is not the same as subtraction in sign-magnitude. Different operations must be defined for addition and subtraction with sign-magnitude numbers.



CS 301 Class Account
Mon Sep 13 11:15:41 ADT 1999