Sunday, October 21, 2012

BASIC BINARY OPERATION

BASIC BINARY NUMBER OPERATION


  • binary number operation is a bit different from what we do in normal mathematic operation. Binary number system only contain TWO numbers which are 1 and 2.


++++++ADDTION ++++++++


  • There are four simply rule that we must follow......
                             
RULES
0+0=0
0+1=1
1+0=1
1+1=10
1+1+1=11
THE RULES OF ADDITION
Let we have some example to make it clear..

      1  <------------- This is call carried bit                                                                                                      
       11             (like normal addition, the second digit will stay,other will be carried forward)  
+       1              COLUMN 1: use 1+1=10... WRITE 0..... 1 carry forward..
     100              COLUMN 2: use 1+1=10......WRITE 10...

--------------SUBTRACTION----------

  • For subtraction,there are also some simply rules to follow....
RULES
0-0=0
0-1=1
( borrow from the next binary number)
1-0=1
1-1=0
THE RULE FOR SUBTRACTION

                  02   <------if cant minus 0 with 1, borrow from left side number)
                  101     COLUMN 1 : use 1-0=1...... WRITE 1...         
                  10     COLUMN 2: cannot minus 1 with 0.... borrow 2 from left side number 1.. the
                    11                      1 become 0... 2 minus 1.. WRITE 1..
                                    COLUMN 3: after borrow by 0.... left only zero... so no need write.





* * * * MULTIPLICATION * * * *

  • For binary multiplication we only need to follow few rules below ...
Rules of Multiplication
0 x 0 = 0
0 x 1 = 0
1 x 0 = 0
1 x 1 = 1
  • example of binary multiplication :
  •     101
        x
    11  
        
    101 < firstly, we multiply 101 to 1
      1010 < Then we put a 0 as a placeholder as we would in decimal multiplication, and  multiply 101 by 1
      1111  < at the end, we add 101 to 1010 then we can get the answer  



÷ ÷ ÷ ÷ ÷ ÷ DIVISION ÷ ÷ ÷ ÷ ÷ ÷

  • Division is easy and involves our knowledge of binary multiplication.
  • example of binary division of 1011 into 11
                 11   R=10
        11 )1011
              -11
                101
                -11
                  10  <-- remainder, R

      To check our answer, we can multiply our divisor 11 by our quotient 11. Then we add its' product to the remainder 10, and compare it to our dividend of 1011.

          11
       x 11
         11
       11 
     1001  < product of 11 and 11
 
    1001
   +  10  < remainder 10
    1011  < sum of product and remainder
   
     The sum is equal to our initial dividend, therefore our solution is correct.

here are some link that can refer...
http://www.ustudy.in/node/7598
http://www.exploringbinary.com/binary-multiplication/







1 comment: