Unsigned and Signed Binary Numbers

Unless stated otherwise, most binary numbers you will work with are unsigned. Unsigned binary numbers all represent positive values. Signed numbers can represent positive and negative values. There are three methods of signing binary numbers: Sign Magnitude, One's Complement, and Two's Complement. Sign Magnitude In Sign Magnitude we use the most significant bit (the left most binary digit) to represent if the value is positive or negative. If the left most digit is a 1 it is negative, if it is a 0 then it is positive. An 8 bit Sign Magnitude number can represent values between 127 and -127.

 

Sign Magnitude is rarely used, if at all, due to a few issues. You cannot easily add two Sign Magnitude numbers together using standard binary addition and you can also end up with positive and negative 0 values:

1000 0000 = negative 0

0000 0000 = positive 0

One's Complement With One's Complement we start with a positive binary number and we flip all of the bits (1s become 0s and 0s become 1s).

 

Unlike Sign Magnitude, standard binary addition will work on One's Complement numbers. However, there are still positive and negative 0 values:

1111 1111 = negative 0

0000 0000 = positive 0

Two's Complement Two's Complement is the most commonly used method of representing negative numbers on a computer. The process of generating a negative Two's Complement number starts the same was as One's Complement: you take the positive version of your binary number and flip all of the bits (1s become 0s and 0s become 1s). After, you add 1 to the value of the number.

 

When working with Two's Complement the most significant bit (the left most bit) represents a negative number. In an 8 bit number the most significant bit would represent -128. Two's Complement works with standard binary addition, and does not have a negative and positive 0.


Included in the following specifications:
Edexcel GCSE Computer Science
Edexcel GCSE Computer Science