English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

How many operations does it take to multiply 2 numbers X,Y together,assuming X has N binary digits in its binary representation and Y and M binary digits in its binary representation

2006-12-05 03:03:08 · 2 answers · asked by Algorithim007 1 in Science & Mathematics Mathematics

2 answers

Assuming you mean a single bit add to be a binary operation, it's 2*M*N operations for the 'shift and add' algorithm.


Doug

2006-12-05 03:09:23 · answer #1 · answered by doug_donaghue 7 · 0 0

To convert a binary number(N digits) to usual number we have
N multiplication and N-1 addition.

So, for two numbers we have to perform 2N multiplications and 2(N-1) additions.

To add the usual numbers we perform one more addition.

So, the total number of steps are
2N + 2(N-1) + 1 = 2N + 2N - 2 +1 = 4N + 1.

So ,the total number of mathematical operations needed is 4N+1.

2006-12-05 03:09:38 · answer #2 · answered by Paritosh Vasava 3 · 0 0

fedest.com, questions and answers