This repository contains implementations of Booth's Multiplication Algorithm and Non-Restoring Division Algorithm in C. These algorithms are used for performing signed binary multiplication and division, respectively.
Booth's algorithm is an efficient technique for multiplying binary numbers, particularly useful for handling signed integers.
The non-restoring division algorithm is used for dividing signed binary numbers without explicitly restoring the remainder during the process.
- Convert both numbers to binary.
- Use Booth's encoding to determine additions and shifts.
- Perform signed binary multiplication using a 2's complement method.
- Extract the final product from the accumulator.
📌 Code File: booth_array.c
- Convert dividend and divisor to binary.
- Initialize the accumulator to zero.
- Perform left shifts and conditional additions/subtractions.
- Determine the quotient and remainder based on final values.
📌 Code File: non_restoring_array.c
gcc booth_array.c -o booth_array
gcc non_restoring_array.c -o non_restoring_array
./booth_array
./non_restoring_array
Enter the multiplicand: 5
Enter the multiplier: -3
Binary multiplication result: -15
📌 Example Image:
Enter the dividend: 9
Enter the divisor: 2
Quotient: 4
Remainder: 1
📌 Example Image:
- Booth, A. D. "A signed binary multiplication technique." Quarterly Journal of Mechanics and Applied Mathematics, 1951.
- Computer Arithmetic Algorithms and Digital Logic Design textbooks.