Monday, December 23, 2013

Information about solving binary questions...

                            Rules For Binary number Systems

Binary Addition  

Binary addition is performed in the same manner as decimal addition. However, since binary system has only two digits, the addition table for binary arithmetic is very simple consisting of only four entries. The complete table for binary addition is as follows:
              0 + 0 = 0
              0 + 1 = 1
              1 + 0 = 1
              1 + 1 = 0 plus a carry of 1 to the next higher column
Carry-overs are performed in the same manner as in decimal addition. Since 1 is the largest digit in the binary system, any sum greater than 1 requires that a digit be carried over. For instance, 10 plus 10 binary requires the addition of two 1's in the second position. Since 1 + 1 = 0 plus a carry- over of 1, the sum of 10 + 10 is 100 in binary.
Examples :
Add the binary numbers 1011 and 1001.
              1011
           + 1001
            10100

Add the binary numbers 100111 and 11011.
               100111
             +  11011
            1000010

Binary Subtraction 

The principles of decimal subtraction can as well be applied to subtraction of numbers in other cases. It consists of two steps, which are repeated for each column of the numbers. The first step is to determine if it is necessary to borrow. If the subtrahend (the lower digit) is larger than the minuend (the upper digit), it is necessary to borrow from the column to the left. It is important to note here that the valued borrowed depends upon the base of the number and is always the decimal equivalent of the base. Thus, in decimal, 10 is borrowed; in binary, 2 is borrowed; in octal, 8 is borrowed; in hexadecimal, 16 is borrowed. The second step is to simply to subtract the lower value from the upper value. The complete table for binary subtraction is as follows:

                 0 - 0 = 0
                 1 - 0 = 1
                 1 - 1 = 0
                 0 - 1 = 1 with a borrow from the next column
Example : 
Subtract 01110 from 10101
                 10101
               - 01110
                 00111

Subtract 1011100 from 0111000
                 
                 1011100
               - 0111000
                 0100100
We can subtract two binary number by using 1's and 2's complement method.
2's complement method

Binary Multiplication  

Multiplication in the  binary system also follows the same general rules as decimal multiplication. However, learning the binary multiplication is a trivial task become the table for binary multiplication is very short, with only four entries instead of the 100 necessary for decimal multiplication. The complete table for binary multiplication is as follows :
                0 x 0 = 0
                0 x 1 = 0
                1 x 0 = 0
                1 x 1 = 1
Multiply the binary numbers 1010 and 1001
                1010
             x 1001
                1010
              0000
            0000
          1010        
          1011010

Binary Division 

Binary division is again very simple. As in the decimal system (or in any other number system), division by 0 is meaningless. Hence, the complete table for binary division is as follows:
1. Start from the left of the dividend.
2. Perform a series of subtractions in which the divisor is subtracted from the dividend. 
3. If subtraction is possible, put a 1 in the quotient and subtract the divisor from the corresponding digits of dividend.
4. If subtraction is not possible(divisor is greater than remainder), record a 0 in the quotient.
5. Bring down the next digit to add to the remainder digits. Proceed as before in a manner similar to long division.
  The division process is performed in a manner similar to decimal division. The rules for binary division are ;
Example:   
<img src="binary division.gif" alt="binary division, division of binary numbers, how to divide two binary numbers">


1. Divisor greater than 100, so put 0 in quotient.
2. Add digit from dividend to group used above.
3. Subtraction possible so put 1 in the quotient.
4. Remainder from subtraction plus digit from dividend
5. Divisor greater, so put 0 in quotient.
6. Add digit from dividend to group.
7. Subtraction possible, so put 1 in quotient.