# How to multiply using logics gates?

C

#### [email protected]

Jan 1, 1970
0
Hi
I got this question how on earth do you multiply using logic gates?
Thanks
Chris

I

#### Icky Thwacket

Jan 1, 1970
0
Hi
I got this question how on earth do you multiply using logic gates?
Thanks
Chris

For 1 bit multiplies use a 2 input AND gate

0*0 = 0
1*0 = 0
0*1 = 0
1*1 = 1

J

#### Joel Koltner

Jan 1, 1970
0
Helmut Sennewald said:

I like how he puts everything into formal mathematical notation on page 5 yet
he didn't even use a decent mathematical typesetting package to make the
notation look good (seen again on page 24). He probably knows what he's
talking about but he's fallen into the typical academician's trap of making
presentations that try to impress other academicians with how smart he is
rather than communicating as effectively as possible.

And you're correct that multiplication done digitally is not even a complex
topic.

W

#### whit3rd

Jan 1, 1970
0
I got this question how on earth do you multiply using logic gates?

Any way that's appropriate. There have been serial bit-by-bit
solutions
that did add/carry until the result was complete, there have been
lookup table (like multiplication table) elements that were cascaded
just like children do multiplication in grade school.

Modern solutions often use a table of squares; given A, and B,
form sum/difference, and lookup the squares in a table
C = (A + B) **2
D= (A - B)**2
and note that
C - D = 2 A B
So three addition operations, two table lookups, and a
divide-by-two substitute for a multiplication table.
A table of all the squares for A, B in the range of 1:1,000,000
has 2*10**6 elements, while the table of A*B has 1*10**12
elements (a savings in number of gates used, factor of 500,000).

The multiplication problem thus reduces to addition, subtraction, and
table-of-values lookup. Solve those with gates, and bolt the
solutions together.

For extra credit, can you imagine building a logic circuit that
takes the logarithm of a number?

I

#### Icky Thwacket

Jan 1, 1970
0
I got this question how on earth do you multiply using logic gates?

Any way that's appropriate. There have been serial bit-by-bit
solutions
that did add/carry until the result was complete, there have been
lookup table (like multiplication table) elements that were cascaded
just like children do multiplication in grade school.

Modern solutions often use a table of squares; given A, and B,
form sum/difference, and lookup the squares in a table
C = (A + B) **2
D= (A - B)**2
and note that
C - D = 2 A B
So three addition operations, two table lookups, and a
divide-by-two substitute for a multiplication table.
A table of all the squares for A, B in the range of 1:1,000,000
has 2*10**6 elements, while the table of A*B has 1*10**12
elements (a savings in number of gates used, factor of 500,000).

The multiplication problem thus reduces to addition, subtraction, and
table-of-values lookup. Solve those with gates, and bolt the
solutions together.

For extra credit, can you imagine building a logic circuit that
takes the logarithm of a number?

+++++++++++++++++++++++++++++

Wot as in a priority encode (characteristic) and shifter (mantissa) for a
piecewise linear approximation??

No, I can't imagine.

S

#### Spehro Pefhany

Jan 1, 1970
0
I like how he puts everything into formal mathematical notation on page 5 yet
he didn't even use a decent mathematical typesetting package to make the
notation look good (seen again on page 24). He probably knows what he's
talking about but he's fallen into the typical academician's trap of making
presentations that try to impress other academicians with how smart he is
rather than communicating as effectively as possible.

And you're correct that multiplication done digitally is not even a complex
topic.

So, you're saying that Volker Strassen, Don Coppersmith, Shmuel
Winograd et al. are idiots for wasting their time on a simple problem?
Best regards,
Spehro Pefhany

M

#### MooseFET

Jan 1, 1970
0
For extra credit, can you imagine building a logic circuit that
takes the logarithm of a number?

Do you remember the article on taking the log of a number using a Z80?
They put the chips power supply pins in the feedback loop of an op-
amp.

The log base 2 is fairly easy to figure out. Doing natural log is
harder. If you want natural log it is handy to remember that

1/log2(e)= ln(2) = 1/2 + 1/8 + 1/6 + 1/256 +1/1024

Replies
2
Views
1K
A
Replies
4
Views
1K
rebel
R
L
Replies
11
Views
11K
Don Bowey
D
R
Replies
7
Views
4K
randomname
R
G
Replies
10
Views
2K
Ken Smith
K