Contents:
- Classifications of Binary Numbers
- What are Signed and Unsigned Data Representation?
- Unsigned Binary Numbers
- Signed Binary Numbers
- Ways to Represent Signed Numbers in Binary
- Importance of Signed Binary Numbers
- Differences Between Signed and Unsigned Binary Numbers
- Sign-Magnitude Representation
- Steps to Obtain Sign-Magnitude Representation of an Integer
- Disadvantages of Signed-Magnitude Representation
- Signed 1’s Complement Representation
- Advantages and Disadvantages of Using 1’s Complement
- Signed 2’s Complement Representation
- Advantages of Using 2’s Complement
- 2’s Complement Vs Sign Magnitude Representation
Classifications of Binary Numbers
Binary numbers are classified into two parts based on their representation. They are signed and unsigned numbers.
- Signed Numbers: Signed numbers in binary are similar to integers in decimal numbers. These are the representation of positive and negative numbers.
- Unsigned Numbers: Unsigned numbers in binary are similar to whole numbers in decimal. They don’t have any indication of positive or negative sign. They are just numbers.
- For example, whole number 3 in unsigned binary representation will be 11 whereas integer +3 in signed binary representation will be 011.
What are Signed and Unsigned Data Representation?
Signed representation is a kind of data representation where we can have both positive and negative numbers. Unsigned data representation signifies a system that shows only positive numbers and negative numbers do not exist.
For any number system, we can use both signed and unsigned representations. We use signed numbers when we have to work with negative numbers as well.
Here is a figure which shows the further classifications of signed and unsigned data representation.

As shown in the figure, signed numbers can be represented using signed-magnitude, 1’s complement, and 2’s complement Representations.
Unsigned Binary Numbers
The normal form used until now in Binary numbers was its unsigned form. Here are the points related to representing binary numbers as unsigned numbers.
- In unsigned numbers, all the bits represent the value of the number, there is no bit dedicated for the sign, as all numbers are only positive.
- For an n-bit binary number, its value can vary from 0 to (2n-1). For example, a 4-bit binary number can have values from 0 to (24-1) = 0 to 15.
- Numerically in binary, the unsigned numbers range from (000…n-bit) to (1111…n-bit). All bits when taken as 1 will give the maximum unsigned binary number.
- For unsigned binary numbers, numerically larger numbers can be represented as all the bits represent values.
- It is not ambiguous. All numbers can be written in only one way.
Signed Binary Numbers
We write the positive numbers in binary as we would in unsigned numbers and for negative numbers, we write its positive number and simply put an extra 1 in front of it. Here are the points related to the signed binary number.
- In signed n-bit binary numbers, one bit that is the MSB is reserved for representing the sign of the number. This is the key difference between signed and unsigned representation.
- A 0 in the MSB represents positive numbers and a 1 in the MSB represents negative numbers.
- Only n-1 bits can represent the value of the number as 1 bit is reserved for the sign.
- This way of representation is known as signed-magnitude representation.
- For a n-bit binary number using signed representation, its value can range from -(2n-1-1) to + (2n-1-1). For example, a 4-bit number can have values from -(23-1) to (23-1) = -7 to +7.
Here is a table that shows signed numbers for 4-bit binary.
0 – 1 0 0 0 | 0 – 0 0 0 0 |
-1 – 1 0 0 1 | 1 – 0 0 0 1 |
-2 – 1 0 1 0 | 2 – 0 0 1 0 |
-3 – 1 0 1 1 | 3 – 0 0 1 1 |
-4 – 1 1 0 0 | 4 – 0 1 0 0 |
-5 – 1 1 0 1 | 5 – 0 1 0 1 |
-6 – 1 1 1 0 | 6 – 0 1 1 0 |
-7 – 1 1 1 1 | 7 – 0 1 1 1 |
As shown in the table, the negative numbers have 1 as their MSB and the positive numbers have 0 as their MSBs.
Ways to Represent Signed Numbers in Binary
There are three primary methods to represent signed numbers in binary:
- Sign-Magnitude Representation: In this method, the Most Significant Bit (MSB) indicates the sign of the binary number, while the remaining bits represent the magnitude of the number.
- 1’s Complement Representation: In 1’s complement representation, all 0s in the binary number are replaced with 1s and all 1s are replaced with 0s.
- 2’s Complement Representation: To obtain the 2’s complement of a binary number, you add binary 1 to the 1’s complement of that number.
Importance of Signed Binary Numbers
Signed binary numbers play a crucial role in various applications:
- Arithmetic Operations: They are essential for performing arithmetic operations, as unsigned binary numbers cannot represent negative values.
- Computer Processing: Computers operate using binary signals (ON and OFF, represented as 1 and 0). To accurately perform arithmetic, computers need to understand the sign of numbers, which is facilitated by signed binary representations.
- Comprehensive Representation: Signed binary numbers can uniquely represent all positive and negative integers, including zero, through specific combinations of bits.
Differences Between Signed and Unsigned Binary Numbers
The differences between signed and unsigned binary numbers are listed below:
Parameters | Signed binary numbers | Unsigned binary numbers |
---|---|---|
Representation | These are the binary representation of integers that have a positive or negative sign. | These are the binary representation of whole numbers which don’t have any sign. |
Range | In general, signed binary numbers range from (- 2n-1) to (2n-1 – 1) for ‘n’ number of bits. | Unsigned binary numbers range from 0 to (2n-1) for ‘n’ number of bits. |
Sign Bit | A signed number requires a sign bit | No Sign bit is required. |
Uses | These are practically used in microprocessors for mathematical calculations. | These are theoretically used to understand about binary numbers. |
Examples | Signed binary representation of (+2) is 010. | Unsigned binary representation of 2 is 10. |
Sign-Magnitude Representation
- In sign-magnitude representation, the MSB (Most Significant Bit) is used to represent the sign of the binary number. It is 0 for positive numbers and 1 for negative numbers.
- The remaining bits of the binary number other than MSB are used to represent the magnitude of the number which is also known as the unsigned binary number.
- The range of sign-magnitude representation is from – (2n-1 – 1) to (2n-1 – 1) where ‘n’ is the number of bits.
Steps to Obtain Sign-Magnitude Representation of an Integer
The steps given below should be followed to obtain sign-magnitude representation of an integer.
- Step-1: Identify whether the integer is positive or negative. If positive then sign bit wll be 0 and if negative then sign bit will be 1. Sign bit is represented by the MSB in sign-magnitude representation.
- Step-2: Now, consider the magnitude of the integer and find its binary equivalent by considering minimum number of bits. It will be an unsigned binary number.
- Step-3: Combine the sign bit and the unsigned binary number obtained from the above steps. This will be the desired sign-magnitude representation of the integer where MSB will indicate the sign of the number.
Disadvantages of Signed-Magnitude Representation
The disadvantages of using signed-magnitude representation are: –
- There are two representations for zero, -0 (1000) and 0 (0000) which is undesired.
- If we want to expand the number of bits for representation from 4-bits to 8-bits, we would need to insert additional zeroes after the sign bit of MSB to do so. This is expensive in terms of computer hardware. For example, -6 in 8 bits will be 10000110.
- Using the same number of bits as unsigned representation, the largest number that can be represented in signed is smaller.
- Sign-magnitude representation is not good for computations. Addition and subtraction in sign-magnitude form are complex and require complex hardware.
To cope up with the first two disadvantages, we try out the 1’s complement form to represent binary negative numbers.
Signed 1’s Complement Representation
To find 1’s complement of a binary number, we invert all the digits of the given number, we change all zeros to ones and all ones to zeros. For example, the 1’s complement of 1100010 is 0011101.
Here are the points related to representing negative numbers in binary using 1’s complement: –
- To represent the negative of a given number, we take out its 1’s complement. For example, 0011 is 3 in binary, so its complement 1100 will represent -3.
- For n-bit binary number, here also like signed-magnitude representation we can represent values from -(2n-1-1) to + (2n-1-1)
Here is a table that shows 4-bit binary numbers and their negatives using 1’s complement.
-0 – 1 1 1 1 | 0 – 0 0 0 0 |
-1 – 1 1 1 0 | 1 – 0 0 0 1 |
-2 – 1 1 0 1 | 2 – 0 0 1 0 |
-3 – 1 1 0 0 | 3 – 0 0 1 1 |
-4 – 1 0 1 1 | 4 – 0 1 0 0 |
-5 – 1 0 1 0 | 5 – 0 1 0 1 |
-6 – 1 0 0 1 | 6 – 0 1 1 0 |
-7 – 1 0 0 0 | 7 – 0 1 1 1 |
As shown in the table, all the negative numbers have been represented using inverted values of their positive numbers. Values from -7 to +7 can be represented using 4 bits in signed 1’s Complement Representation.
Advantages and Disadvantages of Using 1’s Complement
The advantages and disadvantages of using 1’s Complement Representation are stated below.
- Advantages
- If we need to expand the number of bits, for example from 4-bits to 8-bits, we only need to copy the MSB for that many new bits to the right of MSB.
- Copying is less expensive compared to the insertion of bits in between. For example, -6 will become 11111001 in 8-bits from 1001 in 4-bits.
- Disadvantages
- Zero still has two representations of 0 (1111) and -0 (0000).
Thus, 1’s complement was able to remove just one disadvantage. So, we switch to 2’s complement for representing negative numbers.
Signed 2’s Complement Representation
To find out the 2’s complement of any given number, we take out its 1’s complement and then add 1 to this result. For example, 4 in binary is written as 0100
its 1’s complement is 1011
its 2’s complement is 1011 + 1 = 1100.
Here are the points related to signed 2’s complement representation: –
- In signed 2’s complement, a negative number is represented by finding 2’s complement of its positive number.
- For an n-bit binary number, we can represent values from -(2n-1) to + (2n-1-1) using 2’s complement.
Here is a table that shows 4-bit binary numbers and their negatives using 1’s complement.
0 – 0 0 0 0 | 0 – 0 0 0 0 |
-1 – 1 1 1 1 | 1 – 0 0 0 1 |
-2 – 1 1 1 0 | 2 – 0 0 1 0 |
-3 – 1 1 0 1 | 3 – 0 0 1 1 |
-4 – 1 1 0 0 | 4 – 0 1 0 0 |
-5 – 1 0 1 1 | 5 – 0 1 0 1 |
-6 – 1 0 1 0 | 6 – 0 1 1 0 |
-7 – 1 0 0 1 | 7 – 0 1 1 1 |
-8 – 1 0 0 0 | – |
As shown in the table, using 4-bits, we can represent values from -8 to 7 in 2’s complement form.
Advantages of Using 2’s Complement
The advantages of using 2’s complement are listed below: –
- Zero has just one representation of 0000 as on adding 1 to its 1’s complement (1111), it becomes a 5-bit number and the 5-th bit is said to fall off. (1111 + 1 = 10000). So, the ambiguity is removed.
- It can represent one more value than 1’s complement form.
- For expanding the number of bits, we have retained the method of copying the MSB to its right for the new bits. For example, -5 in 8-bits and 2’s complement form will be represented as 11111011 from 1101 in 4-bits.
Thus, by using 2’s complement to represent negative numbers, we overcame all the disadvantages faced in representing both positive and negative numbers in earlier forms.
2’s Complement Vs Sign Magnitude Representation
The differences between 2’s complement and sign-magnitude representation are listed below:
Parameters | 2’s complement representation | Sign-magnitude representation |
---|---|---|
Sign bit | It doesn’t have any specific sign bit but MSB shows the sign. | MSB is used as the sign bit. |
Range | It ranges from (- 2n-1) to (2n-1 – 1) where ‘n’ is the number of bits. | It ranges from – (2n-1 – 1) to (2n-1 – 1) where ‘n’ is the number of bits. |
Representation of Zero | Zero has one representation. | Zero has two representations. |
Hardware | Simple hardware is required for addition and subtraction. | Complex hardware is required for addition and subtraction. |
Uses | It is mainly used in microprocessors to perform operations with negative numbers. | It is used only for theoretical purposes to learn about signed numbers. |
Key Points to Remember
Here are the key points to remember in “Signed and Unsigned Binary Numbers”.
- Unsigned representation means only representing positive numbers and signed representation means showing both positive and negative numbers.
- Signed-magnitude, 1’s Complement, and 2’s Complement Representations are the 3 ways to represent signed numbers.
- In signed-magnitude representation, we reserve the MSB to represent the sign of a number. 0 as the MSB means a positive number while 1 as the MSB means a negative number.
- In 1’s Complement Representation, we represent a negative number by inverting all of its bits.
- Signed-magnitude representation as well as 1’s Complement gives two values of 0s and thus is ambiguous.
- In 2’s Complement Representation, we represent negative numbers by adding 1 to its positive number’s 1’s Complement form.
- The ambiguity of two representations for zeros is removed using 2’s Complement form.
- In unsigned binary arithmetic, overflow can occur when the sum exceeds the maximum representable value. In signed binary arithmetic, special care must be taken to handle carry bits and the sign.
- Signed and unsigned numbers can be manipulated using bitwise operations, but care must be taken to avoid unexpected results, especially with sign extension.