Booth's algorithm is an efficient technique for multiplying binary integers, particularly in signed 2's complement representation. It optimizes multiplication by identifying patterns in binary numbers, reducing the number of additions required.
Example 1: 5 * 7
First, convert to binary (using 5-bit representation):
Following the same procedure, we get:
Final result: 0000001111 = 15 decimal (5 * 3 = 15)[3][5]
Example 3: 7 * 6
Binary conversion:
7 = 00111
6 = 00110
Following Booth's algorithm:
Final result: 0000101010 = 42 decimal (7 * 6 = 42)[3][5]
Example 4: 5 * (-4)
Binary conversion (5-bit representation):
5 = 00101
-4 = 11100 (2's complement)
Following the algorithm:
Final result: 1111010100 = -20 decimal (5 * -4 = -20)[3][9]
Example 5: (-7) * (-3)
Binary conversion:
-7 = 11001 (2's complement)
-3 = 11101 (2's complement)
Following the algorithm:
Final result: 0000010101 = 21 decimal (-7 * -3 = 21)[3][9]
Restoring Division Algorithm
The restoring division algorithm is a method for binary division that works with fixed-point numbers and follows these key steps:
Initialize: Place divisor in M register, dividend in Q register
Shift A and Q left by one bit
Subtract divisor M from accumulator A
Check sign bit of A:
If A < 0 (sign bit is 1): Set Q₀ = 0 and restore A by adding M back
If A ≥ 0 (sign bit is 0): Set Q₀ = 1 (no restoration needed)
Repeat steps 2-4 n times (where n is number of bits)
The quotient will be in Q register and remainder in A register[8][10]
Flowchart for Restoring Division Algorithm
code
START
|
v
Initialize: A = 0, M = Divisor, Q = Dividend, Count = n
|
v
Shift A and Q left one bit position
|
v
Subtract M from A (A = A - M)
|
v
< Is A < 0? >--Yes---> Set Q₀ = 0 and add M back to A (A = A + M)
| |
No |
| |
v v
Set Q₀ = 1 |
| |
|<----------------------|
v
Decrement Count
|
v
< Is Count = 0? >--No---> Return to "Shift A and Q left one bit position"
|
Yes
|
v
END (Quotient in Q, Remainder in A)
Non-Restoring Division Algorithm
The non-restoring division algorithm is more efficient than the restoring algorithm as it eliminates the need to restore the remainder after subtraction. It uses the following steps:
Initialize: A = 0, M = Divisor, Q = Dividend, Count = n
Check sign bit of A:
If A ≥ 0: Shift A and Q left, then subtract M from A
If A < 0: Shift A and Q left, then add M to A
Set Q₀ based on sign of A:
If A ≥ 0: Set Q₀ = 1
If A < 0: Set Q₀ = 0
Repeat steps 2-3 n times
If A < 0 at the end, add M to A for the final remainder[7]
Flowchart for Non-Restoring Division Algorithm
code
START
|
v
Initialize: A = 0, M = Divisor, Q = Dividend, Count = n
|
v
Shift A and Q left one bit position
|
v
< Is A ≥ 0? >--Yes---> A = A - M
| |
No |
| |
v v
A = A + M |
| |
|<----------------------|
v
< Is A ≥ 0? >--Yes---> Q₀ = 1
| |
No |
| |
v v
Q₀ = 0 |
| |
|<-------------------|
v
Decrement Count
|
v
< Is Count = 0? >--No---> Return to check A's sign
|
Yes
|
v
< Is A < 0? >--Yes---> A = A + M (To get correct remainder)
|
No
|
v
END (Quotient in Q, Remainder in A)
Solving Using Restoring Division Algorithm
Example 1: 10/3
Binary conversion:
10 = 01010
3 = 00011
Initialize: A = 00000, Q = 01010, M = 00011, Count = 5
Similar calculations can be done for the remaining division examples.
Differentiation Between Combinational ALU and Sequential ALU
Combinational ALU
Operates in a single clock cycle
Output depends only on current inputs
No internal state or memory elements
Performs operations like addition, subtraction, logic operations in parallel
Simpler design with lower latency
Suitable for less complex operations
Sequential ALU
Operations take multiple clock cycles to complete
Contains internal storage elements (registers, flip-flops)
Can handle more complex operations like multiplication and division
Uses algorithms (like Booth's or Restoring Division) that require multiple steps
More control logic but more versatile
Can implement feedback and iterative processes
Better resource utilization for complex operations[8]
The main difference lies in the presence of internal state memory and the ability to perform multi-step operations, with sequential ALUs being better suited for complex arithmetic operations that require iterative steps.