Page 97 - Bebop to The Boolean Boogie An Unconventional Guide to Electronics Fundamentals, Components, and Processes
P. 97

78    ChuptevEight


                represented by a - b.  Generating the twos complement of b results in -b,
                allowing the operation to be performed as an addition: a + (-b).  This means
                that computers do not require different blocks of logic to add and subtract;
                instead, they only require an adder and a twos complementor. As well as
                being faster than a subtractor, a twos complementor requires significantly
                fewer logic gates.


                Binary Multiplication
                    One technique for performing multiplication in any number base is by
                means of repeated addition; for example, in decimal, 6 x 4 = 6 + 6 + 6 + 6 = 24.
                However, even though computers can perform millions of operations every
                second, the repeated addition technique is time-consuming when the values to
                be multiplied are large. As an alternative, binary numbers may by multiplied
                together by means of a shift-and-add technique known as Booth's Algorithm
                (Figure 8- 12).
                                                                                           Decimal
                                       Multiplicand                Multiplier            equivalent
                                  r         Y          1    I                    I
                                  000101 10  x  01 11001 1                                22,,x  115,,
                                  0001 01 10
                                0001 01 IO-
                             00000000~~
         Partial          00000000~~~
               0 L   0  00010110~~~~~                                               ~
        products       00010110~~~~


                                      0
                                                          ~
                                                               ~
                                                     0
                                           1
                                                1
                                 1
                                                                     ~
                       0
                                                                          ~
                                                                               ~
                            0
                                                0
                                                                                            ~
                                                     0
                          0
                                0
                                     0
                     0
                                           0
             0000100111100010                              ~    ~     ~    ~     ~    ~   = 2530,,
                        Figure 8-1 2. Binary multiplication using Booth's Algorithm
                    Using Booth's algorithm, a partial product is generated for every bit in the
                multiplier. If the value of the multiplier bit is 0, its corresponding partial product
                consists only of Os; if the value of the bit is 1, its corresponding partial product
                is a copy of the multiplicand. Additionally, each partial product is left-shifted
   92   93   94   95   96   97   98   99   100   101   102