You are on page 1of 10

FUTURE INSTITUTE OF ENGINEERING AND MANAGEMENT

CC – 148/294
UNDER MAKAUT, WB

ONE'S
COMPLEMENT
PRESENTED BY CONTINUOUS ASSESSMENT 1
DEBMALYA DASH DIGITAL SYSTEM DESIGN
14800321063 EC302
ECE 3rd SEM
TABLE OF
CONTENT

01 02 03 04
One's complement of Additions by one’s Subtractions by one’s Ones's complement
Binary numbers Complement Complement notation
ONE'S COMPLEMENT OF
BINARY NUMBERS
1’s complement of a binary number is another binary number obtained by toggling all
bits in it, i.e., transforming the 0 bit to 1 and the 1 bit to 0. In the 1’s complement
format , the positive numbers remain unchanged . The negative numbers are obtained
by taking the 1’s complement of positive counterparts.

Example-1: Find 1’s complement of binary number (10101110)₂.


Simply invert each bit of given binary number,
so 1’s complement of given number will be (01010001)₂.
Example-2: Find 1’s complement of binary number (10001.001)₂.
Simply invert each bit of given binary number,
so 1’s complement of given number will be (01110.110)₂.
SUBTRACTION BY ONE’S COMPLEMENT
These are the following steps to subtract two binary numbers using 1's complement
In the first step, find the 1's complement of the subtrahend.
Next, add the complement number with the minuend.
If got a carry, add the carry to its LSB. Else take 1's complement of the result which will be negative.

CASE-1: WHEN CARRY BIT 1

Example : Evaluate 10101 - 00111


1’s complement of subtrahend (00111)₂ is (11000)₂ 10101
Adding (10101)₂ and (11000)₂ we get (101101)₂ + 11000
In the above result, we get the carry bit 1, so adding 1 01101
this to the LSB of a given result we get (01110)₂ which +1
is the answer. 01110
SUBTRACTION BY ONE’S COMPLEMENT

CASE-1: WHEN NO CARRY BIT

Example : Evaluate (10101)₂ - (10111)₂

1’s complement of subtrahend (10111)₂ is (01000)₂ 10101


Adding (10101)₂ and (01000)₂ we get (11101)₂
+ 01000
Since there is no carry bit 1, so take 1’s complement of above result.
1’s complement of (11101)₂ is -(00010)₂ which is the answer. 11101
ADDITIONS BY ONE’S COMPLEMENT
CASE-1: ADDITION OF POSITIVE AND NEGATIVE NUMBER WHEN POSITIVE
NUMBER HAS GREATER MAGNITUDE :

When positive number has greater magnitude, then take simply 1’s complement of negative number and
the end-around carry of the sum is added to the least significant bit (LSB).

Example : Add (1101)₂ and -(1001)₂

First, the 1's complement of the number -(1001)₂ is (0110)₂. 1101


Adding (1101)₂ and (0110)₂ we get (10011)₂ + 0110
By adding both numbers, we get the end-around carry 1, so 1 0011
adding this to the LSB of (0011)₂ we get (0100)₂ which is the +1
answer. 0100
ADDITIONS BY ONE’S COMPLEMENT
CASE-2: ADDITION OF POSITIVE AND NEGATIVE NUMBER WHEN NEGATIVE
NUMBER HAS GREATER MAGNITUDE:
When the negative number has greater magnitude, then take 1’s complement of negative number and
add with given positive number. Since there will not be any end-around carry bit, so take 1’s
complement of the result and this result will be negative.
Example : Add (1101)₂ and -(1110)₂

First, the 1's complement of the number So, the 1's complement of the result (1110)₂ is -(0001)₂
-(1110)₂ is (0001)₂ which is the answer.
Adding (1101)₂ and (0001)₂ we get (1110)₂
1101
Since there is no carry bit 1, so take 1’s + 0001
complement of above result. 1110
ADDITIONS BY ONE’S COMPLEMENT
CASE-3: ADDITION OF TWO NEGATIVE NUMBERS :

You need to take 1’s complement for both numbers, then add these 1’s complement of numbers. Since
there will always be end-around carry bit, so add this again to the MSB of result. Now, take 1’s
complement also of previous result, so this will be negative number.

Example: -(1101)₂ and -(1110)₂ in five-bit register

First, the 1's complement of the number -(01110)₂ is (10001)₂ 10001


and -(01101)₂ is (10010)₂
+ 10010
Adding (10001)₂ and (10010)₂ we get (100011)₂
By adding both numbers, we get the end-around carry 1. We 100011
add this end-around carry to the LSB of (00011)₂ +1
Now, the 1's complement of the result (00100)₂ is -(110111)₂
00100
which is the answer
ONES'S COMPLEMENT NOTATION
This is one of the methods of representing signed integers in the computer. In this method, the most
significant digit (MSD) takes on extra meaning.
If the MSD is a 0, we can evaluate the number just as we would interpret any normal unsigned
integer.
If the MSD is a 1, this indicates that the number is negative.
The other bits indicate the magnitude (absolute value) of the number.
Example 1: Perform 42-22.
Binary representation of (42)₁₀ is (0101010)₂ 0101010
Binary representation of (22)₁₀ is (0010110)₂ +1101001
Binary representation of -(22)₁₀ is -(1101001)₂ Which is 1's
10010011
complement of (0010110)₂
+1
Adding (0101010)₂ and (1101001)₂ we get (10010011)₂
By adding both numbers, we get the end-around carry 1. So adding 0010100
this end-around carry to the LSB of (0010011)₂ we get (0010100)₂
which is the binary representation of (20)₁₀.
Example 2: Perform 20-42.
Binary representation of (20)₁₀ is (010100)₂ 0010100
Binary representation of (42)₁₀ is (0101010)₂ +1010101
Binary representation of (-42)₁₀ is (1010101)₂ Which is 1's complement of (0101010)₂ 1101001
Adding (010100)₂ and (1010101)₂ we get (1101001)₂
Since there is no carry bit 1, taking 1’s complement of (1101001)₂ is -(00010)₂ which is
equal to (-22)₁₀

Example 3: Perform -42-20.


Binary representation of (20)₁₀ is (0010100)₂ 1010101
Binary representation of (-20)₁₀ is (1101011)₂ Which is 1's complement of (0010100)₂ +1101011
Binary representation of (42)₁₀ is (0101010)₂ 11000000
Binary representation of (-42)₁₀ is (1010101)₂ Which is 1's complement of (0101010)₂ +1
Adding (1101011)₂ and (1010101)₂ we get (11000000)₂ 1000001
Adding the end-around carry 1 to the LSB of (1000000)₂ we get (1000001)₂.
Now, the 1's complement of the result (1000001)₂ is -(0111110)₂ which is equal to -(62)₁₀

You might also like