INTRODUCTION - The binary number system is used in the computer systems. The digits 0 and 1 are combined to get different binary numbers like 1001 , 11000110 etc. In a binary number, a digit or 1 is called a bit . For example, 1001 is a 4-bit binary number, and, 11000110 is an 8-bit binary number . All kinds of data, be it alphabets, numbers , symbols, sound data or video data, are represented as combination of bits i.e. 0’s and 1’s . Each character is a unique combination of bits .
DEFINATION - A binary is a system in which the number system has a number 2 as it's base. or Binary is a numbering system that is also the language spoken by computers. It is made up of only 0s and 1s. For example, the number 37 in binary is 100101.
2) BINARY SUBTRACTION The rules for binary subtraction are :- Example :- In Binary 100 2 - 001 2 ------ 011 2 0 - 1 = 1 ; with borrow of 1 from next column 0 (1 (borrow)) - 0 = 1, with borrow of 1 1 - 1 (borrow) - 0 = 0 . Answer = 011 2 .
Subtraction Example
Other methods of binary subtraction As the binary system has base radix=2 . So the two types of complements for the binary system are 2's complement and 1's complement. 1) 1’s Complement method 2) 2’s Complement method
1) 1's Complement of Binary Number Complements are used in the digital computers in order to simplify the subtraction operation and also to represent negative numbers. The 1's complement of a number is found by changing all 1's to 0's and all 0's to 1's . This is called as taking complement or 1's complement . Example of 1's Complement is:
Subtraction of binary numbers using the 1’s complement method allows subtraction only by addition. To subtract a smaller number from a larger number, the 1’s complement method is as follows :-
Subtraction using 1’s complement method involves the following steps :- If there is carry at M.S.B. ( also known as E.O.C. ) , add it to L.S.B. a nd our answer is positive . If there is no carry ( no E.O.C. ) , our answer is negative and in 1’s complement form and we have to take back its 1’s complement .
Example :- SUBTRACT (1010) 2 FROM ( 1111) 2
2) 2’S COMPLEMENT The 2’s complement of a binary number can be obtained by adding 1 to its 1’s complement .
Subtraction using 2’s complement method involves the following steps :- If there is carry at M.S.B. ( also known as E.O.C. ) , discard it and our answer is positive . If there is no carry ( no E.O.C. ) , our answer is negative and in 2’s complement form and we have to take back its 2’s complement .
Example :- SUBTRACT (1010) 2 FROM ( 1111) 2
There is also a concept of Signed Numbers , here The most significant ( leftmost ) bit indicates the sign of the integer; therefore it is sometimes called the sign bit. If the sign bit is zero, then the number is greater than or equal to zero, or positive . If the sign bit is one , then the number is less than zero, or negative .