0% found this document useful (0 votes)
37 views5 pages

Multiplying 2 32-Bit Numbers

This document describes how to multiply two 32-bit numbers to produce a 64-bit result. It explains that the numbers are stored in arrays A and B, and the output is stored in a 4-element array C. It outlines the steps to generate the results M1, M2, M3 using two multiplications, and then generate N1, N2, N3, C1, C2, C3, C4 through a series of additions with carry operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views5 pages

Multiplying 2 32-Bit Numbers

This document describes how to multiply two 32-bit numbers to produce a 64-bit result. It explains that the numbers are stored in arrays A and B, and the output is stored in a 4-element array C. It outlines the steps to generate the results M1, M2, M3 using two multiplications, and then generate N1, N2, N3, C1, C2, C3, C4 through a series of additions with carry operations.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

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

Generating M1,2,3 is simple enough and can be done using to multiplications.

DX AX
DX AX

M1 : M2 : M1

CARRY GENERATED

When generating N, the additions are done in two steps.

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

Here C stores the quotient and D stores the remainder.

You might also like