
- Digital Electronics - Home
- Digital Electronics Basics
- Types of Digital Systems
- Types of Signals
- Logic Levels And Pulse Waveforms
- Digital System Components
- Digital Logic Operations
- Digital Systems Advantages
- Number Systems
- Number Systems
- Binary Numbers Representation
- Binary Arithmetic
- Signed Binary Arithmetic
- Octal Arithmetic
- Hexadecimal Arithmetic
- Complement Arithmetic
- Base Conversions
- Base Conversions
- Binary to Decimal Conversion
- Decimal to Binary Conversion
- Binary to Octal Conversion
- Octal to Binary Conversion
- Octal to Decimal Conversion
- Decimal to Octal Conversion
- Hexadecimal to Binary Conversion
- Binary to Hexadecimal Conversion
- Hexadecimal to Decimal Conversion
- Decimal to Hexadecimal Conversion
- Octal to Hexadecimal Conversion
- Hexadecimal to Octal Conversion
- Binary Codes
- Binary Codes
- 8421 BCD Code
- Excess-3 Code
- Gray Code
- ASCII Codes
- EBCDIC Code
- Code Conversion
- Error Detection & Correction Codes
- Logic Gates
- Logic Gates
- AND Gate
- OR Gate
- NOT Gate
- Universal Gates
- XOR Gate
- XNOR Gate
- CMOS Logic Gate
- OR Gate Using Diode Resistor Logic
- AND Gate vs OR Gate
- Two Level Logic Realization
- Threshold Logic
- Boolean Algebra
- Boolean Algebra
- Laws of Boolean Algebra
- Boolean Functions
- DeMorgan's Theorem
- SOP and POS Form
- POS to Standard POS Form
- Minimization Techniques
- K-Map Minimization
- Three Variable K-Map
- Four Variable K-Map
- Five Variable K-Map
- Six Variable K-Map
- Don't Care Condition
- Quine-McCluskey Method
- Min Terms and Max Terms
- Canonical and Standard Form
- Max Term Representation
- Simplification using Boolean Algebra
- Combinational Logic Circuits
- Digital Combinational Circuits
- Digital Arithmetic Circuits
- Multiplexers
- Multiplexer Design Procedure
- Mux Universal Gate
- 2-Variable Function Using 4:1 Mux
- 3-Variable Function Using 8:1 Mux
- Demultiplexers
- Mux vs Demux
- Parity Bit Generator and Checker
- Comparators
- Encoders
- Keyboard Encoders
- Priority Encoders
- Decoders
- Arithmetic Logic Unit
- 7-Segment LED Display
- Code Converters
- Code Converters
- Binary to Decimal Converter
- Decimal to BCD Converter
- BCD to Decimal Converter
- Binary to Gray Code Converter
- Gray Code to Binary Converter
- BCD to Excess-3 Converter
- Excess-3 to BCD Converter
- Adders
- Half Adders
- Full Adders
- Serial Adders
- Parallel Adders
- Full Adder using Half Adder
- Half Adder vs Full Adder
- Full Adder with NAND Gates
- Half Adder with NAND Gates
- Binary Adder-Subtractor
- Subtractors
- Half Subtractors
- Full Subtractors
- Parallel Subtractors
- Full Subtractor using 2 Half Subtractors
- Half Subtractor using NAND Gates
- Sequential Logic Circuits
- Digital Sequential Circuits
- Clock Signal and Triggering
- Latches
- Shift Registers
- Shift Register Applications
- Binary Registers
- Bidirectional Shift Register
- Counters
- Binary Counters
- Non-binary Counter
- Design of Synchronous Counter
- Synchronous vs Asynchronous Counter
- Finite State Machines
- Algorithmic State Machines
- Flip Flops
- Flip-Flops
- Conversion of Flip-Flops
- D Flip-Flops
- JK Flip-Flops
- T Flip-Flops
- SR Flip-Flops
- Clocked SR Flip-Flop
- Unclocked SR Flip-Flop
- Clocked JK Flip-Flop
- JK to T Flip-Flop
- SR to JK Flip-Flop
- Triggering Methods:Flip-Flop
- Edge-Triggered Flip-Flop
- Master-Slave JK Flip-Flop
- Race-around Condition
- A/D and D/A Converters
- Analog-to-Digital Converter
- Digital-to-Analog Converter
- DAC and ADC ICs
- Realization of Logic Gates
- NOT Gate from NAND Gate
- OR Gate from NAND Gate
- AND Gate from NAND Gate
- NOR Gate from NAND Gate
- XOR Gate from NAND Gate
- XNOR Gate from NAND Gate
- NOT Gate from NOR Gate
- OR Gate from NOR Gate
- AND Gate from NOR Gate
- NAND Gate from NOR Gate
- XOR Gate from NOR Gate
- XNOR Gate from NOR Gate
- NAND/NOR Gate using CMOS
- Full Subtractor using NAND Gate
- AND Gate Using 2:1 MUX
- OR Gate Using 2:1 MUX
- NOT Gate Using 2:1 MUX
- Memory Devices
- Memory Devices
- RAM and ROM
- Cache Memory Design
- Programmable Logic Devices
- Programmable Logic Devices
- Programmable Logic Array
- Programmable Array Logic
- Field Programmable Gate Arrays
- Digital Electronics Families
- Digital Electronics Families
- CPU Architecture
- CPU Architecture
Digital Electronics - Complement Arithmetic
Complement arithmetic is a system of mathematical techniques used in the field of digital electronics to perform various arithmetic operations mainly, subtraction.
Here, we will cover the following most widely used types of complements in digital systems −
- 9's Complement
- 10's Complement
- 1's Complement
- 2's Complement
- 7's Complement
- 8's Complement
- 15's Complement
- 16's Complement
Let us discuss each of these complements in detail along with their application in arithmetic operations.
What is 9's Complement?
In digital electronics, the 9's complement is a type of complement used to perform subtraction of decimal numbers using a digital system. Thus, 9's complement is related to the decimal number system.
- 9's complement is used to perform subtraction because it simplifies the subtraction operation.
- The 9's complement of a given decimal number is found by subtracting each digit of the number from 9.
The following table shows the 9's complement of each decimal digit −
Decimal Digit | 9's Complement |
---|---|
0 | 9 0 = 9 |
1 | 9 1 = 8 |
2 | 9 2 = 7 |
3 | 9 3 = 6 |
4 | 9 4 = 5 |
5 | 9 5 = 4 |
6 | 9 6 = 3 |
7 | 9 7 = 2 |
8 | 9 8 = 1 |
9 | 9 9 = 0 |
Let us understand it with the help of examples.
Example 1
Find the 9's complement of the decimal number 7824.450.
Solution
Here is the step-by-step process for finding 9's complement of the given decimal number −
- The 9's complement of 7 = 9 7 = 2
- The 9's complement of 8 = 9 8 = 1
- The 9's complement of 2 = 9 2 = 7
- The 9's complement of 4 = 9 4 = 5
- The 9's complement of 4 = 9 4 = 5
- The 9's complement of 5 = 9 5 = 4
- The 9's complement of 0 = 9 0 = 9
Thus, the 9's complement of the decimal number 7824.450 is 2175.549.
Example 2
Find the 9's complement of 45608.
Solution
The 9's complement of the decimal number 45608 is given below −
- The 9's complement of 4 = 9 4 = 5.
- The 9's complement of 5 = 9 5 = 4.
- The 9's complement of 6 = 9 6 = 3.
- The 9's complement of 0 = 9 0 = 9.
- The 9's complement of 8 = 9 8 = 1.
Thus, the 9's complement of 45608 is 54391.
What is 10's Complement?
In digital electronics, the 10's complement is another type of complement used to perform subtraction of decimal numbers. Again, the purpose of the 10's complement is to simplify the decimal subtraction operation.
There are two methods for finding the 10's complement of a decimal number −
Method I − To find the 10's complement of a given decimal number, firstly we find the 9's complement by subtracting each digit of the number from 9. Then, we add 1 to the 9's complement to obtain the 10's complement, i.e.,
10s Complement = 9s Complement + 1
The 10's complement of each decimal digit using this method is given in the following table −
Decimal Digit | 9's Complement |
---|---|
0 | 9 0 = 9 + 1 = 10 = 0 (Ignore the carry) |
1 | 9 1 = 8 + 1 = 9 |
2 | 9 2 = 7 + 1 = 8 |
3 | 9 3 = 6 + 1 = 7 |
4 | 9 4 = 5 + 1 = 6 |
5 | 9 5 = 4 + 1 = 5 |
6 | 9 6 = 3 + 1 = 4 |
7 | 9 7 = 2 + 1 = 3 |
8 | 9 8 = 1 + 1 = 2 |
9 | 9 9 = 0 + 1 = 1 |
Method II − In this method, we can use the following formula to find the 10's complement of a given decimal number,
10s Complement = 10N Number
Where, N is the number of digits in the decimal number.
Let us understand the process of finding the 10's complement through examples.
Example 1
Find the 10's complement of the decimal number 4872.
Solution
The 10's complement of 4872 can be determined as follows −
Finding the 9's complement of 4872,
9999 4872 = 5127
Adding 1 to the 9's complement to obtain the 10's complement,
5127 + 1 = 5128
So, the 10's complement of 4872 is 5128.
Example 2
Find the 10's complement of 2478.98.
Solution
The 10's complement of 2478.98 can be found as given below −
Finding the 9's complement of 2478.98,
9999.99 2478.98 = 7521.01
Adding 1 to the 9's complement to obtain the 10's complement,
7521.01 + 1 = 7521.02
Hence, the 10's complement of 7521.01 is 7521.02.
Example 3
Find the 10's complement of 58942.
Solution
The 10's complement of 58942 is given below −
10's Complement of 58942 = 105 58942
10's Complement of 58942 = 100000 58942 = 41058
Thus, the 10's complement of 58942 is 41058.
What is 1's Complement?
In digital electronics, the 1's complement is a type of complement used to simplify the subtraction of binary numbers. Also, the 1's complement is used to represent the negative of a given binary number.
We can find the 1's complement of a binary number by changing all the 0s to 1s and all the 1s to 0s in the number.
We can also find the 1's complement of a binary number by subtracting each bit of the number from 1.
However, there is a major issue associated with the 1's complement that is it has two representations for 0. Where, 00000000 represents the positive zero and its 1's complement is 11111111 that represents 0, but it is called negative zero.
Let us consider some examples to understand the process of finding the 1's complement of binary numbers.
Example 1
Find the 1's complement of 101101.
Solution
The 1's complement of 101101 can be obtained as follows −
Method I − By flipping each bit −
- The 1's complement of 1 = 0
- The 1's complement of 0 = 1
- The 1's complement of 1 = 0
- The 1's complement of 1 = 0
- The 1's complement of 0 = 1
- The 1's complement of 1 = 0
Method II − By subtract each bit from 1 −
111111 101101 = 010010
Hence, the 1's complement of 101101 is 010010.
Example 2
Find the 1's complement of 101101101.
Solution
The 1's complement of given binary number is,
1s Complement = 111111111 101101101 = 010010010
So, the 1's complement of 101101101 is 010010010.
What is 2's Complement?
In digital electronics, the 2's complement is a concept widely used to perform binary subtraction using a digital system.
Here are the following three methods that can be used to determine the 2's complement of a given binary number −
Method I − By finding the 1's complement and then adding 1 to the 1's complement, i.e.,
2s Complement = 1s Complement + 1
Method II − By subtracting the given binary number from 2N, i.e.,
2s Complement = 2N Number
Where, "N" is the number of bits in the number.
Method III − Starting from the least significant bit (LSB), copy down the bits up to and including the first 1 bit encountered and then complement the remaining bits.
Let us understand the process of finding the 2's complement of binary numbers through examples.
Example 1
Find the 2's complement of 1100111.
Solution
We can find the 2's complement of 1100111 as follows −
Method I − Using 1's complement −
1s complement of 1100111 = 0011000
Adding 1 to 1's complement to obtain the 2's complement,
0011000 + 1 = 0011001
Method II − Using 2's complement formula −
2's Complement = 27 1100111 = 128 1100111
2's Complement = 10000000 1100111 = 0011001
Method III − By copying down the bits starting from the LSB up to and including the first 1 bit −

Example 2
Find the 2's complement of 11001100.
Solution
The 2's complement of 11001100 can be obtained as follows −
Method I − Using 1's complement −
1's complement of 11001100 = 00110011
2's complement = 1's complement + 1
2's complement = 00110011 + 1
Therefore,
2s complement = 00110100
Method II − By subtracting the number from 2N −
2's complement = 28 - 11001100
2's complement = 100000000 11001100 = 00110100
Method III − By copying down bits up to first 1 bit −

What is 7's Complement?
In digital electronics, the 7's complement is a concept used to simplify the octal subtraction. The 7's complement of a given octal number can be obtained by subtracting each digit of the number from 7.
The 7's complement of each octal digit is given in the following table −
Octal Digit | 7's Complement |
---|---|
0 | 7 0 = 7 |
1 | 7 1 = 6 |
2 | 7 2 = 5 |
3 | 7 3 = 4 |
4 | 7 4 = 3 |
5 | 7 5 = 2 |
6 | 7 6 = 1 |
7 | 7 7 = 0 |
Let us consider some examples to understand the process of finding 7's complement of an octal number.
Example 1
Find the 7's complement of the octal number 3152.
Solution
The 7's complement of 3152 can be obtained as follows −
- The 7's complement of 3 = 7 3 = 4.
- The 7's complement of 1 = 7 1 = 6.
- The 7's complement of 5 = 7 5 = 2.
- The 7's complement of 2 = 7 2 = 5.
Hence, the 7's complement of 3152 is 4625.
Example 2
Find the 7's complement of the octal number 427102.
Solution
The 7's complement of the given number is determined as given below −
777777 427102 = 350675
Thus, the 7's complement of 427102 is 350675.
What is 8's Complement?
The 8's complement is another type of complement concept used to simplify the octal subtraction. Actually, it is similar to that of 10's complement in the decimal number system.
We can find the 8's complement of a given octal number as follows −
- Find the 7's complement of the given octal number by subtracting each digit of the number from 7.
- Add 1 to the 7's complement.
- Result will be the 8's complement of the given octal number.
Thus,
8s Complement = 7s Complement + 1
The following table shows the 8's complement of each octal digit −
Octal Digit | 8's Complement |
---|---|
0 | 7 0 = 7 + 1 = 10 = 0 (Ignore the carry) |
1 | 7 1 = 6 + 1 = 7 |
2 | 7 2 = 5 + 1 = 6 |
3 | 7 3 = 4 + 1 = 5 |
4 | 7 4 = 3 + 1 = 4 |
5 | 7 5 = 2 + 1 = 3 |
6 | 7 6 = 1 + 1 = 2 |
7 | 7 7 = 0 + 1 = 1 |
Let us understand the process of finding the 8's complement with the help of examples.
Example 1
Find the 8's complement of 4257.
Solution
The 8's complement of 4257 can be found as given below −
7's complement of 4257 = 7777 4257 = 3520
8's complement = 7's complement + 1
8's complement = 3520 + 1 = 3521
Thus, the 8's complement of 4257 is 3521.
Example 2
Find the 8's complement of 77201.
Solution
The 8's complement of given octal number can be determined as follows −
7's complement of 77201 = 77777 77201 = 00576
8's complement = 7's complement + 1
8's complement = 00576 + 1 = 00577
So, the 8's complement of 77201 is 00577.
What is 15's Complement?
In hexadecimal number system, the 15's complement is a complement concept used to simplify the subtraction operation of hexadecimal numbers. The 15's complement is similar to the 9's complement in decimal number system.
To find the 15's complement of a given hexadecimal number, we subtract each digit of the number from 15 (F).
The 15's complement of each hexadecimal digit is given in the following table −
Hexadecimal Digit | 15's Complement |
---|---|
0 | F 0 = F |
1 | F 1 = E |
2 | F 2 = D |
3 | F 3 = C |
4 | F 4 = B |
5 | F 5 = A |
6 | F 6 = 9 |
7 | F 7 = 8 |
8 | F 8 = 7 |
9 | F 9 = 6 |
A | F A = 5 |
B | F B = 4 |
C | F C = 3 |
D | F D = 2 |
E | F E = 1 |
F | F F = 0 |
The following examples demonstrate the process of finding 15's complement of the hexadecimal numbers.
Example 1
Find the 15's complement of the hexadecimal number A259C.
Solution
The 15's complement of A259C can be obtained as follows −
- The 15's complement of A = F A = 5.
- The 15's complement of 2 = F 2 = D.
- The 15's complement of 5 = F 5 = A.
- The 15's complement of 9 = F 9 = 6.
- The 15's complement of C = F C = 3.
So, the 15's complement of A259C is 5DA63.
Example 2
Find the 15's complement of 1BCFA.
Solution
The 15's complement of the given hexadecimal number is,
FFFFF 1BCFA = E4305
So, the 15's complement of hexadecimal number 1BCFA is E4305.
What is 16's Complement?
In hexadecimal arithmetic, we can also determine the 16's complement of a given hexadecimal number. The 16's complement is a concept used to simplify the subtraction operation of hexadecimal numbers.
We can determine the 16's complement of a given hexadecimal number as described below −
- Find the 15's complement of the given hexadecimal number.
- Add 1 to the 15's complement obtained. This gives the 16's complement of the hexadecimal number.
Therefore,
16's Complement = 15's Complement + 1
The 16's complement of each hexadecimal digit is given in the following table −
Hexadecimal Digit | 15's Complement |
---|---|
0 | F 0 = F + 1 = 10 = 0 (Ignore the carry) |
1 | F 1 = E + 1 = F |
2 | F 2 = D + 1 = E |
3 | F 3 = C + 1 = D |
4 | F 4 = B + 1 = C |
5 | F 5 = A + 1 = B |
6 | F 6 = 9 + 1 = A |
7 | F 7 = 8 + 1 = 9 |
8 | F 8 = 7 + 1 = 8 |
9 | F 9 = 6 + 1 = 7 |
A | F A = 5 + 1 = 6 |
B | F B = 4 + 1 = 5 |
C | F C = 3 + 1 = 4 |
D | F D = 2 + 1 = 3 |
E | F E = 1 + 1 = 2 |
F | F F = 0 + 1 = 1 |
Let us take some examples to understand the process of finding the 16's complement of hexadecimal numbers.
Example 1
Find the 16's complement of 1ABDF7.
Solution
The 16's complement of the given hexadecimal number can be determined as follows −
15's complement of 1ABDF7 = FFFFFF 1ABDF7 = E54208
16's complement = 15's complement + 1
16's complement = E54208 + 1 = E54209
Thus, the 16's complement of 1ABDF7 is E54209.
Example 2
Find the 16's complement of ABC.
Solution
The 16's complement of ABC is,
15's complement of ABC = FFF ABC = 543
16's complement = 15's complement + 1
16's complement = 543 + 1 = 544
Thus, the 16's complement of ABC is 544.
This is all about finding different types of complements used in digital electronics.
Now, let us see their application in performing subtraction operations.
Subtraction using 9's Complement
The 9's complement can be used to perform subtraction of decimal numbers. In this method, the difference of two decimal numbers is obtained by adding the 9's complement of the subtrahend to the minuend.
Let us understand the subtraction using 9's complement through an example.
Example 1
Subtract (517)10 from (729)10.
Solution
In this example, we have,
Minuend = 729
Subtrahend = 517
Finding the 9's complement of 517, we get
999 517 = 482
Now, adding 729 and 482 to obtain the difference of 729 and 517, we get,
729 + 482 = 1211
There is an end around carry, indicating the result is positive and is obtained by adding the end around carry to the LSD of intermediate result to obtain the final result, i.e.,
211 + 1 = 212
So, the difference of 729 and 517 is 212.
Example 2
Subtract (203)10 from (159)10 using 9's complement method.
Solution
In this example,
Minuend = 159
Subtrahend = 203
Taking 9's complement of 203, we get,
999 203 = 796
Adding 159 and 796, we get,
159 + 796 = 955
There is no end around carry. Thus, the final result is negative and obtained by taking the 9's complement of 955, i.e.,
999 955 = 44
Thus, the final result of subtraction 159 203 = 44.
Subtraction using 10's Complement
We can also perform decimal subtraction using 10's complement. The step-by-step procedure to perform decimal subtraction using 10's complement is given below −
- Step 1 − Consider the decimal subtraction, X Y. Where, X is minuend and Y is subtrahend.
- Step 2 − Find 10's complement of Y.
- Step 3 − Add X and 10's complement of Y.
- Step 4 − If there is an end-around carry, the result will be positive and final result is obtained by discarding the carry. If there is no end-around carry, it indicates that the result is negative and is obtained by taking 10's complement of the intermediate result and assign a negative sign before it.
Let us understand the decimal subtraction using 10's complement with the help of examples.
Example 1
Subtract (599)10 from (875)10 using 10's complement arithmetic.
Solution
In this example, we have,
Minuend = 875
Subtrahend = 599
Finding 10's complement of 599, we get,
10s complement of 599 = 9s complement + 1
Therefore,
10s complement of 599 = (999 599) + 1 = 401
Adding 875 and 401, we get,
875 + 401 = 1276
There is an end-around carry, showing that the result is positive and is obtained by discarding the carry.
Thus, the difference of 875 and 599 is 276.
Example 2
Subtract (307)10 from (279)10 using 10's complement arithmetic.
Solution
We have,
Minuend = 279
Subtrahend = 307
Taking 10's complement of 307, we get,
10s complement of 307 = (999 307) + 1 = 693
Adding 279 and 693, we get,
279 + 693 = 972
There is no end-around carry, indicating that the result is negative. The final result is obtained by taking the 10's complement of 972 i.e.,
10's complement of 972 = (999 - 972) + 1 = 28
Hence, the final result is 28.
Subtraction using 1's Complement
The 1's complement is used in binary subtraction operation.
The subtraction of two binary numbers, say X and Y i.e., X Y, can be performed using 1's complement as per the following steps −
- Step 1 − Find the 1's complement of subtrahend (Y).
- Step 2 − Add X and 1's complement of Y.
- Step 3 − If there is an end-around carry, it indicates the result is positive and final result is obtained by adding the end-around carry to the LSB of the intermediate result. If there is no end-around carry, the result is negative and obtained by taking 1's complement of the intermediate result and put a negative sign in front of it.
Consider the following examples to understand the binary subtraction using 1's complement arithmetic.
Example 1
Subtract (111)2 from (1011)2 using 1's complement.
Solution
In this example, we have,
Minuend = 1011
Subtrahend = 0111
Finding 1's complement of subtrahend,
1s complement of 0111 = 1000
Adding 1011 and 1000, we get,
1011 + 1000 = 1 0011
There is an end-around carry, indicating that the result is positive. The final result is obtained by adding this end-around carry to LSB of the intermediate result (0011) i.e.,
0011 + 1 = 0100
Hence, the binary difference of 1011 and 111 is 100.
Example 2
Subtract (1100)2 from (111)2 using 1's complement arithmetic.
Solution
We are given,
Minuend = 0111
Subtrahend = 1100
Finding the 1's complement of the subtrahend,
1s complement of 1100 = 0011
Adding 0111 and 0011, we get,
0111 + 0011 = 1010
There is no end-around carry, indicating that the result is negative and is obtained by taking 1's complement of 1010 i.e.,
1s complement of 1010 = 0101
Hence, the binary difference of 111 and 1100 is -101.
Subtraction using 2's Complement
The 2's complement is also used to perform binary subtraction operation using digital systems. The step-by-step procedure to perform the subtraction of two binary numbers, say X and Y, i.e., (X Y) is given as follows −
- Step 1 − Find the 2's complement of subtrahend (Y).
- Step 2 − Add X and 2's complement of Y.
- Step 3 − If there is an end-around carry, it indicates the result is positive and the final result is obtained by ignoring the end-around carry. If there is no end-around carry, the result is negative and obtained by taking 2's complement of the intermediate result and put a negative sign in front of it.
Let us see some examples to understand binary subtraction using 2's complement arithmetic.
Example 1
Subtract (101)2 from (1100)2 using 2's complement arithmetic.
Solution
In this example, we are given,
Minuend = 1100
Subtrahend = 0101
Taking 2's complement of the subtrahend, we get,
2's complement of 0101 = (1111 - 0101) + 1 = 1011
Adding 1100 and 1011, we get,
1100 + 1011 = 1 0111
There is an end-around carry, indicating that the result is positive and the final result is obtained by ignoring this end around carry.
Thus, the binary difference of 1100 and 101 is 111.
Example 2
Subtract (1010)2 from (0110)2 using 2's complement arithmetic.
Solution
The given numbers are,
Minuend = 0110
Subtrahend = 1010
Taking 2's complement of the subtrahend, we get,
2's complement of 1010 = (1111 - 1010) + 1 = 0110
Adding minuend and 2's complement of subtrahend, we get,
0110 + 0110 = 1100
Since, there is no end-around carry, indicating that the result is negative. The final result is obtained by taking 2's complement of intermediate result, i.e.,
2s complement of 1100 = (1111 - 1100) + 1 = 0100
Thus, the binary difference of 0110 and 1010 is -100.
Subtraction using 7's Complement
The 7's complement arithmetic can be used to perform subtraction of octal numbers. Here are the steps involved in performing octal subtraction using 7's complement.
Let we want to subtract octal number Y from X i.e., X Y, then
- Step 1 − Find the 7's complement of subtrahend (Y).
- Step 2 − Add X and 7's complement of Y.
- Step 3 − If there is an end-around carry, it indicates the result is positive and the final result is obtained by adding the end-around carry to the intermediate result. If there is no end-around carry, the result is negative and is obtained by taking 7's complement of the intermediate result and put a negative sign in front of it.
Let us understand octal subtraction using 7's complement arithmetic.
Example 1
Subtract (540)8 from (721)8 using 7's complement arithmetic.
Solution
Given numbers are,
Minuend = 721
Subtrahend = 540
Taking 7's complement of the subtrahend,
7s complement of 540 = 777 540 = 237
Adding 7's complement and minuend, we get,
721 + 237 = 1 160
There is an end-around carry, indicating that the result is positive and the final result is obtained by adding this end-around carry to the intermediate result, i.e.,
160 + 1 = 161
Thus, the octal difference of 721 and 540 is 161.
Example 2
Subtract (310)8 from (121)8 using 7's complement method.
Solution
In this example, the given numbers are,
Minuend = 121
Subtrahend = 310
Taking 7's complement of the subtrahend, we get,
7s complement of 310 = 777 310 = 467
Adding minuend and the 7's complement of the subtrahend, i.e.,
121 + 467 = 610
Since, there is no end around carry, indicating the result is negative and is obtained by taking 7's complement of the intermediate result i.e.,
7s complement of 610 = 777 610 = 167
Hence, the octal difference of 121 and 310 is -167.
Subtraction using 8's Complement
The 8's complement is another technique that used to perform octal subtraction. The step-by-step procedure to perform octal subtraction using 8's complement is explained below −
- Step 1 − If an octal subtraction is defined as X Y. Then, find the 8's complement of subtrahend (Y).
- Step 2 − Add X and 8's complement of Y.
- Step 3 − If there is an end-around carry, it indicates the result is positive and the final result is obtained by ignoring the end-around carry. If there is no end-around carry, the result is negative and is obtained by taking the 8's complement of the intermediate result and put a negative sign in front of it.
Let us understand the octal subtraction using 8's complement method through examples.
Example 1
Subtract (103)8 from (712)8 using 8's complement arithmetic.
Solution
We are given,
Minuend = 712
Subtrahend = 103
Finding the 8's complement of subtrahend, we get,
8s complement of 103 = (777 - 103) + 1 = 675
Adding the minuend and 8's complement of subtrahend, we get,
712 + 675 = 1607
There is an end-around carry. The final result is obtained by ignoring the end-around carry.
Thus, the octal difference of 712 and 103 is 607.
Example 2
Subtract (471)8 from (206)8 using the 8's complement method.
Solution
In this example, we have,
Minuend = 206
Subtrahend = 471
Finding the 8's complement of subtrahend,
8s complement of 471 = (777 - 471) + 1 = 307
Adding the minuend and 8's complement of subtrahend, we get,
206 + 307 = 515
Since, there is no end-around carry, hence the final result is negative and is obtained by taking the 8's complement of the intermediate result i.e.,
8's complement of 515 = (777 - 515) + 1 = 263
Hence, the octal difference of 206 and 471 is -263.
Subtraction using 15's Complement
The 15's complement is used to perform subtraction of hexadecimal numbers. If we want to subtract a hexadecimal number Y from X, then we follow the steps given below −
- Step 1 − Find the 15's complement of subtrahend (Y).
- Step 2 − Add X and 15's complement of Y.
- Step 3 − If there is an end-around carry, it shows the result is positive and the final result is obtained by adding the end-around carry to the intermediate result. If there is no end-around carry, the result is negative and is obtained by taking 15's complement of the intermediate result and put a negative sign in front of it.
The following examples demonstrate the process of performing hexadecimal subtraction using 15's complement arithmetic.
Example 1
Subtract (1920)16 from (E57A)16 using 15's complement arithmetic.
Solution
The given numbers are,
Minuend = E57A
Subtrahend = 1920
Finding 15's complement of the subtrahend,
15s complement of subtrahend = FFFF 1920 = E6DF
Adding the minuend and 15's complement of subtrahend, we get,
E57A + E6DF = 1 CC59
There is an end around carry showing that the result is positive and is obtained by adding the end-around carry to the intermediate result, i.e.,
CC59 + 1 = CC5A
Hence, the hexadecimal difference of E57A and 1920 is CC5A.
Example 2
Subtract (DC25)16 from (A209)16 using 8's complement arithmetic.
Solution
Given numbers are,
Minuend = A209
Subtrahend = DC25
Finding 15's complement of subtrahend,
15s complement of DC25 = FFFF DC25 = 23DA
Adding minuend and 15's complement of subtrahend, we get,
A209 + 23DA = C5E3
Since, there is no end-around carry. The result is negative and is obtained by taking 15's complement of intermediate result, i.e.,
15s complement of C5E3 = FFFF C5E3 = 3A1C
Hence, the hexadecimal difference of A209 and DC25 us -3A1C.
Subtraction using 16's Complement
The 16's complement is also used to perform hexadecimal subtraction. The steps involved in hexadecimal subtraction using 16's complement is explained here −
- Step 1 − If a hexadecimal subtraction is defined as X Y. Then, find the 16's complement of subtrahend (Y).
- Step 2 − Add X and 16's complement of Y.
- Step 3 − If there is an end-around carry, it indicates the result is positive and the final result is obtained by ignoring the end-around carry. If there is no end-around carry, the result is negative and is obtained by taking the 16's complement of the intermediate result and put a negative sign in front of it.
Let us see some examples to understand the hexadecimal subtraction using 16's complement.
Example 1
Subtract (E7C)16 from (F9D)16 using 16's complement arithmetic.
Solution
The given hexadecimal numbers are
Minuend = F9D
Subtrahend = E7C
Taking 16's complement of the subtrahend, we get,
16s complement of E7C = (FFF E7C) + 1 = 184
Adding minuend and 16's complement of subtrahend, we get,
F9D + 184 = 1121
There is an end-around carry, indicating the result is positive. The final result is obtained ignoring the end-around carry.
Hence, the hexadecimal difference of F9D and E7C is 121.
Example 2
Subtract (FF2)16 from (AC5)16 using 16's complement method.
Solution
The given numbers are,
Minuend = AC5
Subtrahend = FF2
Taking the 16's complement of the subtrahend, we get,
16s complement of FF2 = (FFF FF2) + 1 = 00E
Adding the minuend and 16's complement of subtrahend, we get,
AC5 + 00E = AD3
There is no end-around carry, indicating that the result is negative. The final result is obtained by taking the 16's complement of the intermediate result, as follows −
16s complement of AD3 = (FFF AD3) + 1 = 52D
Hence, the hexadecimal difference of AC5 and FF2 is -52D.
Conclusion
In conclusion, complement arithmetic is a method used in digital electronics for simplifying subtraction operations. In this chapter, we explained the different types of complements and their application in subtraction operations along with solved examples.