Multiplying 2 32-Bit Numbers
Multiplying 2 32-Bit Numbers
The two numbers to be multiplied here are kept in A and B word type arrays consisting of 2 elements
each. The output should then be (32+32) = 64 bits long. This can be stored as a word type array of 4
elements.
A1 A2
B1 B2
X
M1 M2 M3
N1 N2 N3
0
C1 C2 C3 C4
DX AX
DX AX
M1 : M2 : M1
CARRY GENERATED
M1 M2 M3
DX AX
Carry Generated
In the Second addition similarly
X X X
DX AX
C1 : C2 : C3 : C4
Carry Generated
Code
Output
Validation :
Dividing a 64-bit number by a 16-bit number
Lets assume the numbers are stored in A and B. The quotient has to be stored in C and the remainder in
D.
B1 B2
A1 A2 A3 A4 C
DX : AX
DX
DX : AX
DX
DX : AX
D
Code
Output