Page 40 - Programming With Python 3
P. 40

An Introduction to STEM Programming with Python — 2019-09-03a                               Page 27
            Chapter 2 — Numbering Systems

            Binary Addition

             Free
            We add binary numbers the same way that we add decimal numbers. Write them aligned positionally,
            start on the right and add each column, If the column exceeds, carry the extra to the next column.



                                                0 + 0 = 0
             eBook
                                                0 + 1 = 1
                                                1 + 0 = 1
                                                1 + 1 = 10
                                                Text 1: Binary Addition



             Edition



            Example:

            Add 101 2 to 1001 2.
            Please support this work at
                     101
                    1001

                                  http://syw2l.org
            Add ones' column 1+1=10, carry the 1 to the twos' column.


                      1
                     101
                    1001                                                       Free
                       0


            Add twos' column 1+0+0=1.

                      1
                     101                                           eBook
                    1001
                      10


            Add fours' column 1+0=1.

                      1                                         Edition
                     101
                    1001


            Copyright 2019 — James M. Reneau Ph.D. — http://www.syw2l.org — This work is licensed
            under a Creative Commons Attribution-ShareAlike 4.0 International License.
   35   36   37   38   39   40   41   42   43   44   45