Page 2 :
Unit-3 Topics, , (According to BTEUP Syllabus, 2020), , • Arithmetic Operations, • Addition Subtraction Algorithm, • Multiplication Algorithm (Booth’s Algorithm), • Division Algorithm, , Booth’s algorithm is powerful algorithm for signed number, multiplication. It is widely used scheme for 2s complement, , multiplication.
Page 3 :
Multiplication, Algorithm (Booth’s Algorithm), Basic Terms, , Possibility, (+A) X (+B), (+A) X (-B), (-A) X (+B), (-A) X (-B), , 7 x 6 = 42, Multiplicand, , Multiplier, , Ex: (+5) X (+6)= +30, Ex: (+8) X (-2) = -16, Ex: (-9) X (+5) = -45, Ex: (-2) X (-7) = +14, , Arithmetic Shift Right of 11000010, 11100001, , discard, , Product
Page 4 :
Booth’s Algorithm…(Continue), Representation of numbers, +5 = 0101, How will -5 be represented ?, 2’s complement of +5 is equivalent to -5,, So +5 is represented in binary = 0101, 1’s complement of +5= 1010, 2’s complement of +5 = 1010+1= 1011, So -5 is represented as = 1011 (via 2’s complement), This is just representation of -5, Suppose we want to perform (+2)-(-5) then we can do as, (+2) + 2’s complement of (-5) i.e. 2’s complement of (-5) =0100, +1 =0101, So answer of (+2)-(-5) =0010+0101= 0111
Page 5 :
Booth’s Algorithm…(Continue), Flow Chart of, Multiplication algorithm, (Booth’s Algorithm), , Where…, A= Accumulator, Q-1 =least of least significant bit, Count = No of bits of multiplier, or multiplicand, Q3 Q 2 Q1, Q0, , Q=1010
Page 6 :
Booth’s Algorithm…(Continue), Example: (+5) X(+4), , Q3 Q2 Q1, , Here A = +5 or 0101, and B = +4 or 0100, Q0, Let assign A=0000, Q-1=0, Count=4, M=0101, Q=0100, 2’s complement of M =1011, Count A, , Q, , Q-1, , 4, , 0000, , 0100, , 0, , 4-1=3, , 0000, , 0010, , 0, , A. Shift right, Count=count-1, , 3-1=2, , 0000, , 0001, , 0, , A. Shift right, Count=Count-1, , 2-1=1, , 0000+1011=1011, , 1000, , 1, , A=A-M, , 1-1=0, , 1101, 1101+0101=0010, , 0001, , Action, , A. Shift right, , Count=count-1, , 0100, , 0, , A=A+M, A. Shift right, , Count=count-1, , Count become 0 so algorithm stop here and, Result will be in AQ i.e. 0001 0100 which is (+20)10, , A, , Q
Page 7 :
Booth’s Algorithm…(Continue), Subtract Operation, (A-B), , Example: (-7) X(+3), , Addition Operation, (A+B), , Here M = -7 or 1001 and Q = +3 or 0011, Let assign A=0000, Q-1=0, Count=4, M=1001, Q=0011, 2’s complement of M =0111, Count A, , Q, , Q-1, , 4, , 0000, , 0011, , 0, , 4-1=3, , 0000+0111=0111, , 1001, , 1, , 0011, , Action, A=A-M, A. Shift right, , Count=count-1, , 3-1=2, , 0001, , 1100, , 1, , A. Shift right, Count=count-1, , 2-1=1, , 0001+1001=1010, , 0110, , 0, , A=A+M, , 1-1=0, , 1101, 1110, , A. Shift right, , Count=count-1, , 1011, , 0, , A. Shift right, , Count=count-1, , Count become 0 so algorithm stop here and, result will be in AQ i.e. 11101011, but note that here 1st bit is 1 that means, It is negative number so by rule 2’ complement of result Should be final result, with negative sign i.e. -(00010101) so in decimal it is -21.
Page 8 :
Exercise, Try to do multiplication by your self…, 1) (-2) X (-4), 2) (+9) X (-5), find the value of register M, Q, Q-1, A and final result.