Linggo, Marso 11, 2012

Binary Arithmetic: Addition & Subtraction

 BINARY ARITHMETIC ADDITION AND SUBTRACTION

BINARY ADDITION
         
          There are some basic rules that we need to consider in the binary arithmetic addition. The examples for the binary arithmetic additions are the following:
0 + 0 = 0
0 + 1 = 1
1 + 0 = 1
1 + 1 = 10;

            Notice the 0 + 0, 0 + 1 & 1 + 0 have one place and 1 + 1 has two places. How would the digital systems handle this?. Well, it breaks it up this fashion. The sum of 1 + 1 is equal to 0 and it has a carry 1 (like the natural mathematic we had) just like a decimal systems on having a decimal addition including the “carry”. For example, 27 + 15 = 42  , we know that the sum of these two numbers is equal to “42”. The second number on the sum value which is the “2” is the sum of “7 plus 5” is equal to “12” and we know that the first number is the carry from the sum value, then the carry was added to the “2 plus 1” numbers which is equal to “4”. Since the “1 plus 2 plus the carry 1” is equal to “4” the same as the binary arithmetic addition by considering its binary values like for example:
                                                                    11
                                                                    101  =    5
                                                                 + 011  = + 3 
                                                                   1000  =   8
                                                                      figure 1.

the counting of binary numbers is from right to left 2^n..... 8, 4, 2, 1. In the figure 1, notice that the equivalent of the decimal number "5" is equivalent to a binary number "1 0 1"


BINARY SUBTRACTION



In Arithmetic subtraction, we need to have borrows unlike arithmetic addition. Arithmetic subtraction is just similar to natural mathematics subtraction and we can subtract one binary number from another by using the standard techniques adapted for decimal numbers. These are the examples of arithmetic subtraction:
 0 - 0 = 0
0 - 1 = 1 since 0 – 1 is equal to -1, we need to borrow another binary number 2 to left so that we can have a positive binary and decimal number
1 - 0 = 1
1 - 1 = 10



      Another example in the binary arithmetic subtraction are following:
      11 = 3 
     -10 = 2                                                                                
       01 = 1
                                                                                                       
      
      






      

Walang komento:

Mag-post ng isang Komento