I wrote a multiplication algorithm some time ago, and I have this comment at the top. If you have two numbers x and y of the same size (the same n_digits), you would multiply so as to get n, which would be twice as many digits. Part of the complexity of the algorithm comes from developing which bits will not be multiplied if n_digits is not the same for both inputs.
, n0 x0 * y0, . n1 - x1 * y0 y1 * x0, . 32- 64- , , n0 = low32 (x0 * y0), high32 (x0 * y0) . , 32- , , 64 , , , 30 31 .
30 , , . , n_digits 8 . , n_digits shift add, 8x8 .
/*
X*Y = N
x0 y3
\ /
\ /
X
x1 /|\ y2
\ / | \ /
\ / | \ /
X | X
x2 /|\ | /|\ y1
\ / | \ | / | \ /
\ / | \|/ | \ /
X | X | X
x3 /|\ | /|\ | /|\ y0
\ / | \ | / | \ | / | \ /
\ / | \|/ | \|/ | \ /
V | X | X | V
|\ | /|\ | /|\ | /|
| \ | / | \ | / | \ | / |
| \|/ | \|/ | \|/ |
| V | X | V |
| |\ | /|\ | /| |
| | \ | / | \ | / | |
| | \|/ | \|/ | |
| | V | V | |
| | |\ | /| | |
| | | \ | / | | |
| | | \|/ | | |
| | | V | | |
| | | | | | |
n7 n6 n5 n4 n3 n2 n1 n0
*/