One’s Complement
In digital electronics, the binary system is one of the most common number representation techniques. As its name suggest binary number system deals with only two number 0 and 1, this can be used by any device which is operating in two states. The binary number system has two complements 1’s and 2’s complement.
Table of Content
- One’s Complement
- How to Find One’s Complement ?
- Examples
- Representation in Signed Magnitude
- Uses of 1’s Complement
One’s Complement of a Binary Number
In simple words, if we want to understand the One’s complement, so one’s complement is toggling or exchanging all the 0’s into 1 and all the 1’s into 0 of any number. Suppose there is a binary number 11001001, then its one’s complement will be 00110110.
In actuality, the one’s complement means the addition of a negative integer to the number, and this eliminates the requirement of a separate subtraction processor.
How to Find One’s Complement of a Number ?
To find one’s complement of any number, follow the below steps:
- Convert the number of any number system to a binary number system, i.e. if the number is in octal, decimal, hexadecimal, or any other number system; so convert it into a binary number system. If there is a number 10 and we need to find its one complement convert it into a binary number system, i.e. 1010.
- After, having the number in binary form. Now, invert or exchange all the 0’s to 1 and all the 1’s to 0. Like, 1010 will be 0101.
- The resulting binary number is the 1’s complement of the given number.
CASE
If the decimal number was a negative number, suppose we have a number say -10. To find out 1’s complement of such number. Follow the given steps:
- Convert the number into the binary number system as we do for the positive number.
- Now, exchange all the 1’s to 0 and 0’s to 1.
- Take the transpose of the negative binary number.
Examples of One’s Complement of a Binary Number
Here are examples of One’s complement of a binary number for better understanding :
1. Evaluate the 1’s complement of the 11010011.
Simply invert each bit of the number, and hence the 1’s complement for the above binary number is – 00101100
2. Evaluate the 1’s complement for the fractional binary number 00111.001.
The 1’s complement representation of the fractional binary number will be 11000.110.
3. Evaluate 1’s complement of all 4-bit binary numbers
Number | Binary Representation | 1’s complement |
---|---|---|
0 | 0000 | 1111 |
1 | 0001 | 1110 |
2 | 0010 | 1101 |
3 | 0011 | 1100 |
4 | 0100 | 1011 |
5 | 0101 | 1010 |
6 | 0110 | 1001 |
7 | 0111 | 1000 |
8 | 1000 | 0111 |
9 | 1001 | 0110 |
10 | 1010 | 0101 |
11 | 1011 | 0100 |
12 | 1100 | 0011 |
13 | 1101 | 0010 |
14 | 1110 | 0001 |
15 | 1111 | 0000 |
1’s Complement Representation in Signed Magnitude
In sign-magnitude, the leftmost bit indicates the sign of the integer. Representation of the positive remains the same. In sign-magnitude, 6 is a positive number, its binary representation is 0000 0110, and it will be represented as it is, i.e. 0000 0110. Whereas a negative number suppose -6 will be represented as 1111 1001. Negative integers are generated by reversing all the bits or by performing a bitwise complement of a positive integer.
Range of 1’s Complement Number
For n bits register, the smallest negative number that can be stored is -(2(n-1)-1) and the largest positive largest number that can be stored is (2(n-1)-1).
NOTE: This (sign) representation has an ambiguous representation of the number 0. It has two different representations for 0; negative zero (-0) is 1 1111 in the five-bit register and the positive zero (+0) is 0 0000 in the five-bit register.
Uses of 1’s Complement
- Represent Signed binary number: 1’s complement is used to represent signed binary numbers, as positive signed binary numbers can be represented as it is, 1’s complement is widely used to represent negative binary numbers in sign-magnitude.
- 1’s complement is also used in various arithmetic binary operations like subtraction, addition, etc.
For more details, you can refer Difference between 1’s Complement representation and 2’s Complement representation Technique article.
Conclusion
In the conclusion, we discussed all the aspects of one’s complement like definition, steps to be followed, significance, representation in sign magnitude, range, examples, uses, etc. One’s complement of a binary number is the toggling or complement of the series in which it is given.
One’s Complement – FAQs
What is the 1s complement of 35?
+35 in signed magnitude is 100011.
Therefore, 1’s complement of 35 = 011100
Why 1’s complement required ?
Due its fastness and efficient way of error detecting in digital data. Also, we can represent negative numbers in computers.
Is 1’s complement signed or unsigned ?
1’s complement representation is in signed magnitude. In sign-magnitude, the leftmost bit indicates the sign of the integer.
Contact Us