# How to get 1/x function with op-amp?

#### Solarelf

Joined Oct 30, 2014
21
hej guys,
I am puzzled with a problem which appeared simple on the first glance, but now after hours and hours of experimenting with simulator I am totally lost...
My challenge is:
- I have a function as voltage fed into op-amp
- I am asked to build a circuit with as few op-amps as possible to get 1/f(x)
T.ex.: y=x (input) -> y=1/x (output)
Any suggestions?

#### kubeek

Joined Sep 20, 2005
5,674

#### Solarelf

Joined Oct 30, 2014
21
Already did... and even simulated several circuits candidates.... in theory, LOG -> Inverse -> Antilog should do the trick.... first two works just fine, but after the last transformation I get something very poorly looking like 1/x After talking to my tutor I was surprised to know this is possible to do with 1 LOG and one (and only one!) additional op-amp! But he never tells the whole picture!

#### MrChips

Joined Oct 2, 2009
20,182
I've never thought of this one before but I would start thinking about a transconductance amplifier.

Start by thinking about Ohm's Law.

I = V/R

If you can keep V constant but change R as a of function V

then I = k/V

Now it is relatively easy to convert I to an output voltage.

#### WBahn

Joined Mar 31, 2012
25,220
Keep in mind that the inversion (i.e., additive inverse or multiplication by negative one) operation is easily built into most opamp circuits.

#### Solarelf

Joined Oct 30, 2014
21
Keep in mind that the inversion (i.e., additive inverse or multiplication by negative one) operation is easily built into most opamp circuits.
Yes, but this is not 'inversion', this is 'reciprocalization'

Actually, I though in the beginning this is a trivial cicruit (consider translating frequency to period between pulses for example or versa) to build, but now it appears to me, there is no 'industry standard solution'?

Tnank you!

#### Solarelf

Joined Oct 30, 2014
21
In fact, I am stuck with simulating anti-log... the basic circuit I have tried to model doesn't seem to work as expected... any hints to practical exponential amp designs?

#### kubeek

Joined Sep 20, 2005
5,674
Try showing your circuit and why you think it is not working.

#### MrChips

Joined Oct 2, 2009
20,182
There is a division circuit using the XR-2228 multiplier.
But I assume you would like to roll your own.

#### Solarelf

Joined Oct 30, 2014
21
Try showing your circuit and why you think it is not working.
... I will post it in a while... as soon as I prepare a screenshot... it's basically obtained from (working and tested) log-amp circuit, following this generic rule ("just... switch the resistor and a diode vice versa"), however it doesn't work.

#### Solarelf

Joined Oct 30, 2014
21
There is a division circuit using the XR-2228 multiplier.
But I assume you would like to roll your own.
... using multipliers is another good challenge in my case... so what is your suggestion? Keep one input constant, feed the function into another input and configure it for division operation, so I have 1/f(x)?

#### Solarelf

Joined Oct 30, 2014
21
Here it is.... Transistor on the input supposed to behave as exponential tranformer, while the first op-amp simply inverts and buffers its output... the second op-amp generates offset current and (possibly) temp-compensates the circuit if the two transistors are matched and a pair-in-one.

#### Attachments

• 73.6 KB Views: 65

#### MrChips

Joined Oct 2, 2009
20,182
Here is my idea:

#### Solarelf

Joined Oct 30, 2014
21
Here is my idea:

...curious... could you please describe how it works? And, is the NJFET critical for the circuit to work? Could BJT be used instead?

#### MrChips

Joined Oct 2, 2009
20,182
Q1 JFET acts as a voltage controlled resistor. We'll call it Rj.

The voltage gain of U2 is R5/Rj.

(oops. I messed up the drawing somewhere. I need to insert a Vref in there somewhere.)

Anyhoo, as the gate voltage increases, Rj decreases. That is the opposite of what we want.
Hence U1 is simply an inverter op-amp.
As Vin increases, Rj also increases, controlling the gain of U2 = R5/Rj.

This is just a first thought. You may want to do a simulation.

#### Solarelf

Joined Oct 30, 2014
21
Q1 JFET acts as a voltage controlled resistor. We'll call it Rj.

The voltage gain of U2 is R5/Rj.

(oops. I messed up the drawing somewhere. I need to insert a Vref in there somewhere.)

Anyhoo, as the gate voltage increases, Rj decreases. That is the opposite of what we want.
Hence U1 is simply an inverter op-amp.
As Vin increases, Rj also increases, controlling the gain of U2 = R5/Rj.

This is just a first thought. You may want to do a simulation.
Thank you! I will surely do once i realize where do i put V ref

#### joeyd999

Joined Jun 6, 2011
4,326
Here is my idea:

Mr. Chips, how is the Vout ever going to be anything other than 0V, regardless of Rj?

Hint: IR5 will always be 0.

#### Solarelf

Joined Oct 30, 2014
21
Mr. Chips, how is the Vout ever going to be anything other than 0V, regardless of Rj?

Hint: IR5 will always be 0.
Same confusion....

#### MrChips

Joined Oct 2, 2009
20,182
As I said, you need to inject a Vref into the circuit, perhaps into the non-inverting input of U2.
I will attempt to redraw the circuit when I get the time to do a simulation.