Example 1: 11010.1101
For finding 1's complement of the given number, change all 0's to 1 and all 1's to 0. So the 1's complement of the number 11010.1101 comes out 00101.0010.
Example 2: 100110.1001
For finding 1's complement of the given number, change all 0's to 1 and all 1's to 0. So, the 1's complement of the number 100110.1001 comes out 011001.0110.
1's complement plays an important role in representing the signed binary numbers. The main use of 1's complement is to represent a signed binary number. Apart from this, it is also used to perform various arithmetic operations such as addition and subtraction.
In signed binary number representation, we can represent both positive and negative numbers. For representing the positive numbers, there is nothing to do. But for representing negative numbers, we have to use 1's complement technique. For representing the negative number, we first have to represent it with a positive sign, and then we find the 1's complement of it.
Let's take an example of a positive and negative number and see how these numbers are represented.
Example 1: +6 and -6
The number +6 is represented as same as the binary number. For representing both numbers, we will take the 5-bit register.
So the +6 is represented in the 5-bit register as 0 0110.
The -6 is represented in the 5-bit register in the following way:
Here, MSB refers to Most Significant Bit, and LSB denotes the Least Significant Bit.
Example 2: +120 and -120
The number +120 is represented as same as the binary number. For representing both numbers, take the 8-bit register.
So the +120 is represented in the 8-bit register as 0 1111000.
The -120 is represented in the 8-bit register in the following way:
6 videos|76 docs|52 tests
|
|
Explore Courses for Electronics and Communication Engineering (ECE) exam
|