goBoating: There are three ways to represent negative numbers: ones-complement, twos-complement, and sign-magnitude.
In ones-complement, a negative A is obtained by bitwise-negating A. The leftmost bit is the sign of the number, positive is 0, negative is 1. So, using 4-bit numbers, 2 ~= 0010 and -2 ~= 1101.
In twos complement representation, negative numbers are represented by bitwise-negating the positive value, then adding one. Again, the leftmost bit is a sign bit: positive is 0, negative 1. 2 ~= 0010, -2 ~= 1110.
Sign-magitude, you just flip the leftmost sign bit to represent negation. 2 ~= 0010, -2 ~= 1010.
Perlfan, do you want to print as a string of 1s and 0s the given-bitwidth binary representation of the 2s-complement negation of a positive number?