Is there any good way to multiply two "signed" vol...
# analog-design
l
Is there any good way to multiply two "signed" voltages to get a signed current? Like i_out = (V_a - V_a_middle) * (V_b - V_b_middle). (The *_middle values are fixed. Any voltage range and very mediocre accuracy is acceptable.) Google is failing me and this is the best I could do so far (not very good)
correction: above circuit breaks when a < na
maybe a gilbert cell already does this and I was misunderstanding how it works...
r
Yeah what you're looking for is a four-quadrant mixer. The Gilbert cell should be an example of one. There are other ways you can do it though
πŸ™ 1
The requirement that the output be signed while the inputs are relative to a reference would seem to suggest using differential amplifiers for each input signal and then using a standard multiplier circuit. Is there a particular reason you're trying to multiply without having access to negative voltages?
Maybe you could do it in three steps: logarithmic converter on each input, sum the two, and then exponential converter. Then you get multiplication by the properties of logarithms
πŸ‘€ 1
See the AD538 datasheet for some inspiration. It requires dual supplies though
It's a hard problem in general and doing it properly for the four quadrant case would probably require a pretty complicated circuit. I think it can be done though.
Or another way: expand out your expression to i_out = v_a*v_b - v_a_middle*v_b - v_b_middle*v_a + v_a_middle*v_b_middle and then implement it by summing the 1-quadrant mixer output of v_a*v_b with an offset (corresponding to the product of the references) and then subtract scaled versions of v_a and v_b. Then you can do it with only a one-quadrant mixer and some summing/differencing
I would imagine that would be simpler than the 4-quadrant mixer version
Oh yeah also check out the AD633 datasheet
Or if you want to go down the gilbert cell route, here's an excellent video giving an intuitive explanation of how it works:

https://youtu.be/7nmmb0pqTU0?si=gkd7THVFvrYhNbZ9β–Ύ

l
Is there a particular reason you're trying to multiply without having access to negative voltages?
No reason! a_mid and b_mid can be zero. Thank you very much for the info and keywords. I was trying to do the expansion
(a-amid)*(b-bmid) = a*b - amid*b - bmid*a + amid*bmid
for quite a while but something was messed up that I couldn't figure out. I was doing something a bit different for that then what you described. But with the right keywords and this other info I bet I can get it implemented. And I hadn't considered exp-sum-log! I'll try that out too You probably saved me like 3 days of work 🍻
r
I hope all my rambling is helpful! I understand how hard it can be to learn something if you don't know the right phrases to look up. I'm glad to hear you have some new ideas to try out!
l
The requirement that the output be signed while the inputs are relative to a reference would seem to suggest using differential amplifiers for each input signal and then using a standard multiplier circuit.
What kind of standard multiplier circuit would handle positive and negative input voltages?
r
In this context, when I say standard, I just mean that the block would have a simple interface. In this case, the goal would be to create a block that has two single-ended inputs and output a single-ended signal proportional to the product of the two inputs.
πŸ‘ 1
I don't have a particular circuit topology in mind for the implementation
πŸ‘ 1
l
Ah makes sense
r
But I imagine that would be easier to do than the fully differential topology of the gilbert cell since its performance depends on the relationship between the common mode value of the two inputs, which I imagine could be annoying to design with
πŸ‘ 1
But at that point I'd suggest using dual supplies and some kind of circuit that has a voltage-controlled gain.
Check out the Fairchild Application Note AN-6603
I've seen jfets used as voltage controlled resistors a lot. I don't know if you have access to those sorts of devices in your process, but maybe you can get access to a depletion mode mosfet which behaves very similarly. Although that sort of topology doesn't have the 4-quadrant multiplication you're looking for
Perhaps you could take inspiration from the gilbert cell in that you could: 1) create two signal paths - one which inverts the input and one which does not, 2) give each path a voltage-controlled gain, but in a way that makes each have high gain when the other has low gain, and 3) sum the output. I guess the difference here would be that you'd be using single-ended signals throughout instead of differential signals (which is what the gilbert cell does). And hopefully with the single-ended version it's a lot more linear than the gilbert cell
l
Sky130A does have BJTs! About time for me to start using them and see how they fit in in the toolchain with corners, layout, etc
r
Ooh exciting. Maybe I can make a brokaw bandgap reference in that case...