How to multiply using logics gates?

Hi I got this question how on earth do you multiply using logic gates? Thanks Chris

Reply to
chutsu
Loading thread data ...

For 1 bit multiplies use a 2 input AND gate

0*0 = 0 1*0 = 0 0*1 = 0 1*1 = 1
Reply to
Icky Thwacket

schrieb im Newsbeitrag news: snipped-for-privacy@b1g2000hsg.googlegroups.com...

Hello Chris,

It's damn easy. Add, add, add, add, ....

formatting link
The basic idea is shown on page 6.

Google: hardware multiplier wallace tree

Best regards, Helmut

Reply to
Helmut Sennewald

formatting link

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.

Reply to
Joel Koltner

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 =3D (A + B) **2 D=3D (A - B)**2 and note that C - D =3D 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?

Reply to
whit3rd

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.

Reply to
Icky Thwacket

formatting link

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

--
"it\'s the network..."                          "The Journey is the reward"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com
Reply to
Spehro Pefhany

On Mar 12, 2:40 pm, whit3rd wrote: [....]

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

to 3 digits so the number of adders isn't too bad.

Reply to
MooseFET

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.