TAOCP 4.1 Exercise 6
In signed magnitude notation, one bit is reserved for the sign, leaving $p-1$ bits for magnitude.
Section 4.1: Positional Number Systems
Exercise 6. [**] [16] What are the largest and smallest $p$-bit integers that can be represented in (a) signed magnitude binary notation (including one bit for the sign), (b) two's complement notation, (c) ones' complement notation?
Verified: yes
Solve time: 1m07s
In signed magnitude notation, one bit is reserved for the sign, leaving $p-1$ bits for magnitude. The largest positive integer has all magnitude bits equal to 1, giving $2^{p-1}-1$, and the smallest (most negative) integer is represented by setting the sign bit to 1 and all magnitude bits equal to 1, giving $-(2^{p-1}-1)$. Zero has two representations, $+0$ and $-0$.
In two's complement notation, the largest positive integer has a 0 sign bit and all remaining $p-1$ bits equal to 1, giving $2^{p-1}-1$. The smallest negative integer has a 1 sign bit and all remaining $p-1$ bits equal to 0, giving $-2^{p-1}$. In ones' complement notation, the largest positive integer is the same as in signed magnitude, $2^{p-1}-1$, while the smallest negative integer has a 1 sign bit and all magnitude bits equal to 1, giving $-(2^{p-1}-1)$, and zero again has two representations.
$$ \boxed{ \begin{array}{lcl} \text{Signed magnitude:} & \max = 2^{p-1}-1, & \min = -(2^{p-1}-1) \ \text{Two's complement:} & \max = 2^{p-1}-1, & \min = -2^{p-1} \ \text{Ones' complement:} & \max = 2^{p-1}-1, & \min = -(2^{p-1}-1) \end{array} } $$