Linear Multiplier - Page 1
Forum section: electronics / beginners

author: multiplier
author_rank: Contributor
timestamp: February 07, 2013, 10:46:31 am
content: Hi! I have to design a circuit whose output should be the product of the two input voltages. The voltages can vary from -3 to +3 V. I am not supposed to use any analog multiplier IC. I thought of the log-antilog technique but it won't work as I have negative inputs. There was a circuit using MOSFETs in wikibooks but that again works only for positive voltages. There was another one using BJTs but again had a limitation of input voltage << 25 mV. Any suggestions?

author: GK
author_rank: Super Contributor
timestamp: February 07, 2013, 11:41:16 am
content: Download the paper attached here (reply 15):https://www.eevblog.com/forum/projects/analog-multiplication/msg189874/#msg189874Yes, it is an old paper and yes the circuitry described uses tubes, but the circuits would be a cinch to implement with modern op-amps.

author: alanb
author_rank: Frequent Contributor
timestamp: February 07, 2013, 11:52:21 am
content: How about using PWM where one input varies the on/off ratio and the other input varies the amplitude.You may be able to overcome the posative / negative issue by adding a constant before multiplying for example add 3V to both inputs to give a range of 0-6v and then subtract 3(A+B +3) where the two inputs are A and B

author: GK
author_rank: Super Contributor
timestamp: February 07, 2013, 11:59:31 am
content: Quote from: alanb on February 07, 2013, 11:52:21 amYes, this is known as "time division multiplication" (see reply 14 of the thread I linked to above).And here is a much more thorough outline/analysis:http://www.philbrickarchive.org/time-division_multiplier.pdf

author: hlavac
author_rank: Frequent Contributor
timestamp: February 07, 2013, 12:52:12 pm
content: Quote from: multiplier on February 07, 2013, 10:46:31 amMaybe you could handle all the polarity combinations separately, ten add them all up. Chop the parts above/below ground as appropriate. Most circuits can be built in a complementary, inverted way where they work with reverse polarity/negative volatges. Add inverting opamp buffer where polarities don't match.Or you could detect the input polarities with comparators and use analog multiplexers and some logic to select appropriate normal/inverted inputs and outputs to make a single log multiplier always work with positive voltages. But that will probably add some switching artefacts around the polarity flips.

author: amspire
author_rank: Super Contributor
timestamp: February 07, 2013, 02:05:19 pm
content: The multiplier ICs would be the easiest solution, but you cannot use them.The PWM solution is good. If one of the inputs can be digital, a 4 quadrant multiplying D to A converters can work well.You can make a 4 quadrant multiplier with a transconductance amplifier. Look at the application notes in the LM13700 data sheet for an example.You could also make up a Gilbert Cell (the circuit used in many multiplier IC's) using a CA3046/LM3046 transistor array (they are still avaliable). If you search for Gilbert Cell on Google, you should find lots of references.

author: w2aew
author_rank: Super Contributor
timestamp: February 07, 2013, 04:51:16 pm
content: Quote from: amspire on February 07, 2013, 02:05:19 pmDitto on the Gilbert cell. Scale/shift the voltages on either end with op amps, etc. as needed.

author: multiplier
author_rank: Contributor
timestamp: February 07, 2013, 05:12:25 pm
content: Thank you all for the replies. The thing is, I cannot have one digital input. The problem statement doesn't allow that. So, PWM is ruled out. I haven't heard about Gilbert cells before, so I'll read up on them. I would prefer solutions involving op-amps if possible. Moreover, the problem statement says that the max input frequency is 10 kHz. This means that the inputs are AC. Does this make any difference to the answers given so far?

author: multiplier
author_rank: Contributor
timestamp: February 07, 2013, 05:20:05 pm
content: Quote from: hlavac on February 07, 2013, 12:52:12 pmComparators is a good idea but I still don't get the other half of the job. Even if I can separate the positive and negative voltages, how do I multiply the negative ones and give a negative output? The problem statement also mentions a max frequency of 10 kHz. So I assume that the i/p is AC. What is your opinion?

author: multiplier
author_rank: Contributor
timestamp: February 07, 2013, 05:48:16 pm
content: Quote from: GK on February 07, 2013, 11:41:16 amThanks for referring me to this paper. I would be glad if you can show me a design using op-amps.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 07, 2013, 10:10:23 pm
content: why are we doing someone's homework?Quote from: multiplier on February 07, 2013, 10:46:31 amso we give the OP some tips..Quote from: multiplier on February 07, 2013, 05:48:16 pmand OP says, "thanks, can you design it for me using op amps now?"To me, this is clearly a student problem. The question appears to be worded to get someone to think about the problem and the various ways it can be solved. What does it mean to do analog multiplication, and how can it be solved?If this was a real world need, then my time is valuable, the product needs to get done, and I would choose an analog multiplier, or depending on the form of the inputs, perhaps an MCU with 2 ADCs and a DAC and do it in the digital domain. Unless I was trying to reconfigure an active space vehicle, remotely, I wouldn't be restricted in the means to come up with a working solution. The restrictions are there so the student can learn to think for him or herself.It's wonderful for the student that we are giving him or her the answers, but how does this help them become a better engineer?It's like another recent post, someone posted a simple battery charger circuit, says the original engineer is not at the company anymore and he/she was hired but can't figure it out... can we tell the them how it works?....and yet a simple nodal analysis would show how it works, but the OP couldn't figure that out, and somehow got hired as an engineer working in a shop of some sort...In these two cases, one appears to me to be a student, and the other is (supposedly) an engineer in a hired position.My point being that the quality of engineers is dismally lacking, and the fact that students get all their answers online these days means that no one has to think for themselves anymore, and in fact no one wants to, all they want is the paper.Then, when they do get hired, they can't design anything and can't figure out how anything works either./end soapboxSo here's my tip to the poster ... I didn't have to look at the tube circuit to see how to do it with op-amps. Read the description of the operation, what are they summing, where are they summing, what is the bias voltage, etc...X and Y are your inputs, in your case it seems that X,Y are from -3 to +3you need an op amp circuit to make a bi-polar triangle wave 2*Vo peak-to-peak, where |X|+|Y|<= |Vo|therefore Vo = 6, so your triangle wave is +-6V, or 12V peak-to-peakyou need (X-Y) and -(X+Y).. both easy to get with op-amps.then you need to sum the triangle wave with (X-Y) and half wave rectify it. Use an op-amp based rectifier, not a simple diode, to avoid the diode drop.next you need to sum the triangle wave with -(X+Y) and negatively half wave rectify that (i.e. the excursions below 0).finally, low pass filter that and sum it with the input Y to obtain (X*Y) / VoA final gain stage A * ((X*Y)/Vo) can gain up by Vo to obtain the output value X*Y. I.e. a gain of 6 at the end.Look at the first page, it's all there in the equations and the diagrams. The paper goes on to describe 2 other methods but the basic 4-quadrant multiplier can be achieved with the first method.finally, note that you can combine several op-amp operations into one, you don't need a single op-amp for each function, although you can do that when you are drawing out the functional diagram at first, then optimize it later by combining functions.

author: GK
author_rank: Super Contributor
timestamp: February 07, 2013, 10:34:42 pm
content: Quote from: multiplier on February 07, 2013, 05:48:16 pmUmm, the designs in that paper use op-amps (just tube ones; Philbrick K2's). The designs are directly translatable to solid-state.

author: amspire
author_rank: Super Contributor
timestamp: February 07, 2013, 10:38:37 pm
content: Quote from: multiplier on February 07, 2013, 05:12:25 pmNo, a PWM solution does not have to be digital.You have two inputs. One goes to a straight unity gain opamp buffer - the output is the same as the input. This is followed by a second opamp circuit that has a gain of -1. So if you have 3V in, you have a buffered 3V and -3V outputs available.The second input goes to a voltage to duty cycle converter. 0V gives 50% duty cycle-3V gives say 10% duty cycle. 3V gives 90% duty cycle.This output switches a two input cmos multiplexer (like the CD4053 or any of the other 4053's from other manufacturers) with the two inputs connected to the two outputs from the first stage via 10K resistors..Average the output of the multiplexer with a capacitor.You have a 4 quadrant multiplier.QuoteIt might. It partly depends on what the final use will be. If you need accurate multiplication with both inputs at 10KHz, you may have to design for 100KHz or more.The Gilbert Cell solution can work. Do a search for Gilbert Cell CA3046 and Gilbert Cell LM3046. (You need transistor arrays as you need thermally matched transistor pairs).Also look at the transconductance amp solution I mentioned above - it is by far the easiest solution after analog multiplier ICs.

author: GK
author_rank: Super Contributor
timestamp: February 07, 2013, 10:48:42 pm
content: Quote from: hlavac on February 07, 2013, 12:52:12 pmThe easiest way to make a unipolar-input multiplier into a bipolar one is to implement a DC level shift with a summing amplifier and a voltage reference. Suppose the input range was from 0V - 10V, add a +5 level shift and it is then -5V to 5V.

author: GK
author_rank: Super Contributor
timestamp: February 08, 2013, 04:36:26 am
content: Quote from: amspire link=topic=14072.msg190085#msg190085But not very well. A standard Gilbert cell (as in the MC1496 or a 3046 wired as such) is next to useless as a linear analogue multiplier due to the gross nonlinearity (S-shaped exponential transfer characteristic) of the bipolar differential pair. It also has a temperature dependant scale factor independent of transistor thermal matching which has to be compensated for separately (just like in a diode or “transdiode” log amp).Chips like the MC1496 are designed to operate in a switching mode for the carrier input, so the non-linearity of the differential pairs is of no consequence. You can in fact use a Gilbert cell multiplier (exploiting the non-linear characteristic) to convert triangle waves into sine waves or perform trigonometric functions.To make a decent analogue multiplier out of it you need to employ linearization techniques which involve pre-distortion with another set of thermally matched and coupled diodes or BJT Vbe’s.The issues are described here (translinear / transconductance multipliers):http://www.analog.com/static/imported-files/tutorials/MT-079.pdf

author: amspire
author_rank: Super Contributor
timestamp: February 08, 2013, 04:52:35 am
content: A Gilbert Cell can give linearity to 1 or 2%. That is not gross non-linearity. That is pretty accurate. I assume this is a course design project - not a perfect solution.It would be an excellent learning exercise.If a better solution is needed, it is very simple. Get a 4 quadrant multiplier IC, or for even more accuracy, digitize the inputs and use a DSP to do a numeric multiplication.

author: GK
author_rank: Super Contributor
timestamp: February 08, 2013, 05:00:12 am
content: Quote from: amspire on February 08, 2013, 04:52:35 amOnly over a VERY limited input voltage range (measurable in mV or a few 10's of mV - depends on bias current as re=25mV/Ic - at the "x" input. The transfer characteristic is EXPONENTIAL, not linear.Please read the paper I linked to - analog multiplier chips do NOT use plain Gilbert mixer cells!And at those voltage levels your offset voltage nulling, temperature compensation and DC precision will be a nightmare and all over the place. I'm not just theorising here either. I do agree that trying to make one work is a good learning experience.I'll have a complete solution to the OP's requirments posted up this evening.

author: amspire
author_rank: Super Contributor
timestamp: February 08, 2013, 07:19:32 am
content: A plain Gilbert cell is only two Quadrant anyway.The modified versions with 2 cells and resistors do have good linearity and input range.If it is a design project, then the idea is for Multiplier to do some design to learn. I am not going to do it, but you can make an excellent 4 quadrant multiplier based on CA3046 arrays. You start with the Gilbert cell and modify it to allow for larger input voltages and adequate linearity. Gilbert is purely the starting point.And I don't think Multiplier posted any specifications.

author: GK
author_rank: Super Contributor
timestamp: February 08, 2013, 08:17:49 am
content: Quote from: amspire on February 08, 2013, 07:19:32 amThe two cell version has exactly the same exponential transfer characteristic as the single cell version.For the 3rd time, I reference that paper I linked to a few posts back:I've attached figure 6 from that paper showing the internal schematic of the AD534 analog multiplier chip. It contains a "two cell" Gilbert cell multiplier. The exponential transfer characteristic of the Gilbert cell (due to the S-shaped transfer characteristic of differential pairs Q1 and Q2) is accounted for by driving it with a pre-distortion stage based on dual transistor Q3. Each half of Q3 is connected as a diode. The x input is converted into a linear current by a very heavily emitter degenerated (and thus linearized) BJT differential pair. The voltage on the Q3 "diodes" is thus an exponential function of the applied linear (x input derived) current. In other word, this x input stage is a basic logarithmic amplifier - and this logarithmic response "cancels" the exponential response of the Gilbert cell. That is how you make a linear multiplier with a Gilbert cell.

author: GK
author_rank: Super Contributor
timestamp: February 08, 2013, 08:41:49 am
content: OK, now tidied up for presentation. Here is my take on a complete, simple to build, accurate and stable 4-quadrant analog multiplier based on the triangle integration technique described in that paper I linked to in my first post in this thread.The x and y bipolar input ranges are +/-10V and the output scales to (x*y/)10. I just used basic parts available in the LTspice library. The -3dB bandwidth is 500Hz, which is set by the 4-pole Butterworth ripple filter. The carrier frequency is 5kHz, for a bandwidth-carrier ratio of 10:1. I found this ratio necessary to get an adequate amount of ripple suppression with only a 4-pole filter.The OP's requirement is an bandwidth of 10kHz, but this is eminently doable. Just redesign the filter for a 10kHz cutoff frequency and modify the triangle generator to operate at 100kHz.However I would also use op-amps in the precision rectification positions with much higher GBWP and slewrate than the LT1022 currently specified. In order to maintain a high degree of linearity at 100kHz operation it is necessary that the rectifier op-amps have a rather high GBWP so that there is plenty of loop gain available at and significantly beyond the frequency of operation. A high slewrate is also mandatory as the precision rectifiers have a dead-band about the zero-crossing transition, during which the op-amp output has to slew two diode (shotkey in this case) drops, preferably as quickly as possible.So there; y'all see how damn simple it is after all?And here is the LTspice *.asc file for those who would like a play:http://www.users.on.net/~glenk/Solid_State_Triangle_Multiplier_500_Hz.asc

author: GK
author_rank: Super Contributor
timestamp: February 08, 2013, 09:32:57 am
content: Quote from: codeboy2k on February 07, 2013, 10:10:23 pmWhoa there! You must be one of those weird persons who actually reads through shit linked to by other weird persons, before actually commenting or forming an opinion!

author: amspire
author_rank: Super Contributor
timestamp: February 08, 2013, 12:07:38 pm
content: Quote from: GK on February 08, 2013, 08:17:49 amYou don't need to quote it for the third time. I have never disputed a word of the document, but so what if the design they analyze has deficiencies?People have been designing multipliers successfully based on the CA3046 for years.The point is the basic cell has deficiencies so you fix them. That is the fun of design. That is how you learn.One perfectly good solution is to keep the input amplitudes small, and this often is an easy criteria to meet in an RF mixer. Here is an example you find if you follow my suggestions to search for CA3046 and Gilbert Cell:http://pr.radom.net/~pgolabek/materialy/Elektronika/Dodatki/Gilbert/Gilbert%20Cell.PDFA perfectly good multiplier, unless there are specs that demand a higher performance.If you are after a wide input range like +/- 10V on both inputs, you can add resistance in the emitter circuits like the MC1495 and you can get good results (1% X linearity, 2% Y linearity). It is not a Gilbert Cell - it is a modified design. I am not sure why you keep referring to the MC1496 as a bad multiplier. It is designed as a RF mixer, and with a 10mV input, it has a 66dB carrier rejection. That is very good. I would call that a big success, and that particular chip is only designed for low level inputs.I am not saying your design approach is wrong, but I don't see why you are bagging other valuable and educational design approaches. It does not make sense to say you cannot design a multiplier based on transistor arrays when there are many such designs, and the starting point for many of those successful designs is the Gilbert Cell.Your circuit is a different take on my duty cycle idea I also mentioned, except instead of using a CMOS multplexer, you use summed full wave rectifiers. My suggestion still would have involved a similar triangular wave generator, the non-inverted and inverted X input, and the output filter (my suggestion was a single capacitor as the filterso you have definitely outdone me there). This circuit works excellently at low frequencies, but it doesn't cope with high frequencies as well as the Gilbert Cell based designs. It is good though. Another good solution.Really excellent job with the LTSpice simulation.Richard.Edit:Inspired by GK, I did a rough simulation of a CA3046 based 4 quadrant multiplier. It works nicely at low input levels. It is a simplified version of the circuit in the article I quoted above. I have to admit that part of the motivation was that I have a couple of tubes of surface mount CA3046 arrays, and so I wanted to get a working LTSpice model. Running at a current of 2mA, the response is 0.5dB down at 30MHz.

author: multiplier
author_rank: Contributor
timestamp: February 08, 2013, 07:10:01 pm
content: Thank you all! Especially GK and amspire for taking time off to think about my problem. Thanks for the simulation and the circuit diagrams. I completely agree with codeboy2k about spoonfeeding but can't help as I don't have the time.

author: Bored@Work
author_rank: Super Contributor
timestamp: February 08, 2013, 08:19:56 pm
content: Quote from: multiplier on February 08, 2013, 07:10:01 pmSo when is your homework due, and do the academic standards of your institution allow to let others design your devices?

author: codeboy2k
author_rank: Super Contributor
timestamp: February 09, 2013, 12:05:50 am
content: Quote from: GK on February 08, 2013, 09:32:57 amIt's a bad habit of mine... I won't let it happen again

author: GK
author_rank: Super Contributor
timestamp: February 09, 2013, 01:42:14 am
content: Quote from: amspire on February 08, 2013, 12:07:38 pmWhen used as an RF mixer, the differential pair(s) are universally over-driven so that they operate in a switching mode. The RF signal of interest is applied to the tail current stage(s) which operate with heavy emitter degeneration and thus amplify the RF signal linearly.When used an an RF mixer or product detector, the exponential transfer characteristic of the "multiplying" differential pair(s) is not of any consequence, but it is in a linear multiplier application. These are apples vs oranges applications.Operated over a only very small proportion of its exponential transfer characteristic, yes, the plain "Gilbert cell" multiplier can be "linear" to an acceptable degree (the closer you zoom into an exponential curve, the more of a straight line it becomes) - but that low-level operation generally makes for a very poor analogue computing multiplier for stable DC voltages (It DC drifts all over the place and is noisy due to the low operating voltages and the gain required to get them back up to usable levels again). In some applications the DC drift doesn't matter, such as a VCA stage in a synthesizer for audio effects, where the audio output signal is ac coupled.I mentioned previous that the gross non linearity of the Gilbert cell (when operated over its full transfer characteristic) can be exploited to convert triangle waves into sine waves or perform trigonometric functions. Check out the attached datasheet. I really wish this chip was still made........... it was Barrie Gilberts baby, and is based on the transfer characteristic of the undegenerated BJT differential pair. If you google the part # you can find some theory of operation (there even was an IEEE paper).QuoteThanks

author: multiplier
author_rank: Contributor
timestamp: February 09, 2013, 10:08:43 am
content: Quote from: Bored@Work on February 08, 2013, 08:19:56 pmI have to present it on Thursday and no, they don't. I am not going to and I can't present something that I don't understand fully because it'll definitely get rejected. I tried by myself and couldn't come up with anything, that's why I posted it over here.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 11, 2013, 06:13:28 am
content: @GK.. re.. the AD639.. I never worked with it before but I would sure like to play.If anyone has a spare one just lying about ... send it overThere's a nice 1Hz - 1Mhz sine wave generator in Linear Technology Application Note 47, page 53, by Jim Williams.It has a VCO input from 0-10V, with 0.25% linearity and 0.4% distortion ..The AD639 needs a low distortion triangle wave. Any distortion or non-linearities or differences in ramp-up vs ramp-down times manifest as various distortions in the output sine or cosine waves. The app note has a nice explanation of how he generates a low distortion triangle wave. Basically an integrator with a comparator on the output fed back to the input to control a JFET which switches the control voltage onto the integrator's input for charging and off for discharging. He uses a ±15V level shifter at the output of the comparator to turn the JFET hard on and hard off so it switches fast and clean at the 0V transition. The charging current in and out of the summing node of the integrator is tightly controlled, and 2 additional JFETs provide temperature stability.There's an interesting diode bridge that provides a bipolar reference to the comparator in opposition to the comparator's output, so that it can integrate up or de-integrate down. My first thought for this would be to use an analog switch to switch between positive and negative references, but one soon realizes they are too slow, and can only switch between 40-60ns. This would limit the frequency and introduce distortion at the crossover point. Maybe there are faster switches, but I didn't look very hard, and they will certainly get more costly. The 60ns SPDT switches are over $1.00. However, the switching diodes he used , IN4148, are cheap and fast, 4ns or better. It's a great use for a diode bridge that I'll have to remember for the future!The side effect of the triangle wave and comparator output is that you can also pull a triangle and square wave from it too.This VCO is interesting in that it's a low cost analog solution and its just fun to explore the way it used to be doneDDFS offers a much wider range, is much more versatile and way more agile, and can achieve equal or better linearity and THD.

author: TerminalJack505
author_rank: Super Contributor
timestamp: February 11, 2013, 06:35:57 am
content: To the OP or anyone else interested in reviewing or learning about analog multipliers, here are somevideo lecturesthat cover the subject. Lectures 30 - 33 discuss multipliers.I don't think the instructor covers how to implement them with op amps, which I understand the OP wants to do. I'm pretty sure it is all done with discrete components in the lectures. It's been a while since I've watched them, though, so I'm not 100% sure.Be warned: It's a pretty advanced subject.

author: GK
author_rank: Super Contributor
timestamp: February 11, 2013, 08:32:43 am
content: Quote from: codeboy2k on February 11, 2013, 06:13:28 amI ended up using a servo loop to ensure a precise 50% duty cycle in a "precision" triangle wave generator of my own:https://www.eevblog.com/forum/projects/home-brew-analog-computer-system/?action=dlattach;attach=35299U7 is the integrator making the triangle wave from square wave source U4, while U8 is the servo amplifier. Note that even if the waveform from the U4 flip-flop had a duty cycle of less or greater than 50%, the servo amplifier would still steer the integrator (U7) reference voltage (pin 3) so as to maintain a perfectly symmetrical triangle wave.Note that the servo loop is a conditionally stable system as there are two integrators in the feedback loop, each with a pole at 0Hz* (just like a PLL control loop [a phase detector is in fact an integrator independent of the loop filter - a fact a lot of rookie PLL designers miss]) . R55 inserts the necessary stabilizing zero.*well not quite because the integrator op-amps do not have infinite gain at DC.

author: codeboy2k
author_rank: Super Contributor
timestamp: February 12, 2013, 07:18:20 pm
content: That's beautiful.I love a man that knows +-15V still.... and knows when to use a JFETQuoteThat servo loop is very interesting. I am studying your circuit now..I started in the 70's and I know my way around analog circuits, but I am not an expert. Thanks for the homework

author: GK
author_rank: Super Contributor
timestamp: February 13, 2013, 04:15:51 am
content: Lol, I wansn't born until '77. The apparently complex circuit for a xtal oscillator is to prevent the crystal from cooking (drives the "pi" circuit with only ~1Vp-p). Then some gain is required to get it up to the 15V logic level.