Learning the Binary System

This is a VERY easy concept to learn, it's amazing that the binary system is not common knowledge! In fact it's easier than the system you already know!




Multiplying and Dividing Binary Numbers


Multiplication will never get easier than this, because in binary you will never multiply anything greater than 1!

                    011             Decimal:    3
                *   110                     *   6
               ---------                   -------
                    000                        18
                   011
                  011 
               ---------
                  10010
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                   
                   11010010             Decimal:    210
                *  10010101                     *   149
               -------------                   ---------
                   11010010                        1890
                  00000000                         840  
                 11010010                         210         
                00000000                       ---------         
               11010010                           31290    
              00000000                                          
             00000000                                       
            11010010                                            
           -----------------                                
            111101000111010                                             
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         

You should notice the pattern above. When multiplying by a 0, it is zero across the board, when multiplying by 1, it is the same number it always is (the top number). This is important when we get into bitshifting. With a large enough register, we can just shift and add to multiply. For instance if we count one set of zeros, then a 1's row again we shift twice to the left then add, if we count two rows of zeros then a 1's row again, we shift 3 times to the left than add. You do not have to understand this right now. Really, if you understand multiplication in binary, then this page has done it's job so far. Hang with it!

Division is just as simple in binary notation becuase when you divide, your numbers may either go into the number, or not. In other words if the divisor goes into the number you are dividing, it will only go in once, or not at all. The only quotent you can have is either a 1 or a 0.

10002 ÷ 1002 = 102 ≡ 810 ÷ 410 = 210

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     1
                  ____________
            100  / 1000
                   100
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     10
                  ____________
            100  / 1000
                   100
                  ------------
                   0000
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         

You just divide and subtract just like you would with the decimal system. Here is a larger example:

        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     
                  ____________
            1001  / 110110
                   
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       1                     
                  ____________
            1001  / 110110
                    1001                  
                  ____________
                    010010 
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       11                  
                  ____________
            1001  / 110110              
                    1001
                  ____________
                    010010
                     1001
                  ____________
                    000000
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       110                  
                  ____________
            1001  / 110110              
                    1001
                  ____________
                    010010
                     1001
                  ____________
                    000000
                    000000
                  ____________
                    000000
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         

Back to Index


External Links