180 likes | 1.24k Views
Complements. In digital computer to simplify the subtraction operation and for logic manipulation Complements are used. There are two types of Complements:. 1. The Radix Complement ( r’ Complement). 2 . Diminished radix complement ( (r-1)’ Complement ). Decimal Number System.
E N D
Complements In digital computer to simplify the subtraction operation and for logic manipulation Complements are used. There are two types of Complements: 1. The Radix Complement (r’ Complement) 2. Diminished radix complement ( (r-1)’ Complement)
Decimal Number System 9’s and 10’s Complements 9’ Complement: The 9’s complement of the decimal number is obtained by subtracting each digit of that decimal number from 9.
9’s Complement of subtraction • Find the 9’s complement of the subtracted number & add it to the main no. • If carry is present in the intermediate results, it indicates that the answer is +ve, Add the carry to LSB. • If carry doesn't present, then the answer is –ve. place –vesign before the answer and find its 9’complement.
10’ Complement: The 10’s complement of the decimal number is obtained by adding a1 to its9’s complement.
10’s Complement of subtraction • Find the 10’s complement of the subtracted number & add it to the main no. • If carry is present in the intermediate results, it indicates that the answer is +ve, and neglect the carry. • If carry doesn't present, then the answer is –ve . place –vesign before the answer and find its 10’complement.
Binary complements. • 1’s Complement • 2’s Complement
1’s Complement • The 1’ complement of a binary number is the number that results when we change all 1’s to zeros and zeros to 1’s. • 2’s Complement • The 2’ complement of a binary number is the number that results when we add 1 to LSB of its 1’s complement no.
Binary Arithmetic • Binary addition • The four possible elementary operations are • 0+0=0 • 0+1=1 • 1+0=1 • 1+1=0 with carry 1.
Binary Arithmetic • Binary Substraction • The four possible elementary operations are • 0-0=0 • 0-1=1 with borrow 1. • 1-0=1 • 1-1=0
Binary Arithmetic • Binary Multiplication • The four possible elementary operations are • 0*0=0 • 0*1=0 • 1*0=0 • 1*1=1
Binary Arithmetic • Binary Division • The two possible elementary operations are • 0/1=0 • 1/1=1 • Note: In Binary numbers divide by ‘0’ has no meaning.
BinarySubtraction using 1’s Complement Method • In this method Operation A-B is performed using following Steps. • Take 1’s complement of B. • Result=A+1’s complement of B. • If carry is generated then the result is +veand add carry to the result to get the final answer. • If carry is not generated then the result is -veand for final result find the 1’s complement of the intermediate results.
BinarySubtraction using 2’s Complement Method • In this method Operation A-B is performed using following Steps. • Take 2’s complement of B. • Result=A+2’s complement of B. • If carry is generated then the result is +veand add Ignor the carry. • If carry is not generated then the result is -veand for final result find the 2’s complement of the intermediate results.
Representation of sign numbers using 1’s and 2’s complement method. • If the number is +ve the magnitude is represent in its true binary form and a sign bit ‘0’ placed in front of MSB. • If the number is -ve the magnitude is represent in its 1’s or 2’s complement form and a sign bit ‘1’ placed in front of MSB.
2.perform the following i) Subtract by using 10’s compliment for the given 3456-245 ii) Subtract by using 2’s compliment for the given 111001-1010