Integers: signed magnitude | ||||||||||||
Signed magnitude | ||||||||||||
Reserve one particular bit for the sign. | ||||||||||||
Sign bit: If msb is 0, then positive value, if msb is 1, then negative value. | ||||||||||||
Converting base 10 to N-bit signed magnitude (SM): | ||||||||||||
1. Ignoring sign, convert base 10 value to binary. | ||||||||||||
2. If less than (N-1) bits, pad rest of bits to (N-1) with 0. | ||||||||||||
3. If negative, set msb to 1. | ||||||||||||