Академический Документы
Профессиональный Документы
Культура Документы
Subtraction of a number from another can be accomplished by adding the complement of the subtrahend to the minuend.
1s Complement Subtraction
Subtraction of binary numbers using the 1s complement method allows subtraction only by addition.
Cont.,
1s complement method
To subtract a smaller number from a larger number, the 1s complement method is as follows
1. Determine 2. Add this the tothe the 1s larger complement the smaller number. 3. Remove carry andnumber add it to of the result. This carry is called end-around-carry
Example of 1s complement
1s complement method
1 1 1 1
0 1 0 1 1 0 1 0 0 1 0 10 1
Subtraction Steps
Subtraction of a large number a smaller one by the 1s complement method involves the following steps
1. The 2. 3. Determine Add answer this to the is the 1s smaller 1s complement complement number of of a large the result number and is opposite in sign. There is no carry.
2s Complement Subtraction
Steps
steps
1. 2. 3. Determine the 2s complement the smaller Add this Omit theto carry larger ( there number is alwaysof a carry in thisnumber case )
Example of 2s complement
2s complement method
1 1 1 1
2s complement Carry
0 1 1 0 1 0 1 0 1
Subtraction Steps
The carry is discarded. Thus answer is (0101)2 The 2s complement method for subtraction of a large number from a smaller one is as follows.
1. To 2. 3. Determine Add There the is 2s no the carry complement 2s. complement The result to the is smaller in of the 2s the complement larger number form 4. get an answer in true form, take 2s number is negative and change the sign. complement
2s Complement
It has to be arrived at by first obtaining the 1s complement and then adding one (1) to it Only one arithmetic operation is required It is used only for arithmetic applications
The End
.. Thank You