\$Vi\$ can take two values either logic 0 or logic 1. How will output \$Vo\$ vary with \$Vi\$ in this opamp configuration?


simulate this circuit – Schematic created using CircuitLab

It is is an inverting amplifier so output will be \$Vo=-\dfrac{R1}{R2}Vi\$ for large voltage gain.

But \$R2=0\$. So \$Vo\$ is tending to infinity.

So for logic 1, the output is -15V as that is the maximum supply voltage supplied to the opamp.

Similarly for logic 0, the output should be -15V only.

But when I simulated the circuit I got output 0 for logic 0. I don't know why.


1 Answer 1


Since there is no resistor in series with the - input, you really are using the opamp as a comparator and the feedback resistor can be removed. Your circuit is a inverting comparator, BUT, its threshold level is 0 V since that's what you are feeding into the + input.

There are several things you need to do to fix this circuit:

  1. Set the threshold voltage about halfway between the high and low voltage of the digital signal. Assuming the digital signal goes between power and ground of something like a 3.3 V or 5 V supply, all you need is a resistor divider. Connect around 10 kΩ between the digital supply and the + input, and another 10 kΩ between the + input and ground. This will float the + input at half the supply voltage, which we are assuming is the middle of the digital signal voltage range.

  2. Make sure the opamp is properly powered. If you want the output to swing ±15 V, then the supply needs to be at least ±15 V. Most opamps that can take such a large supply range can't swing their outputs all the way to the supply rails. This headroom can be almost 3 V in some cases. Check the datasheet. The TL081 you show is known for having a rather large headroom.

    However, don't just blindly connect ±18 V or whatever power to the opamp. Check the datasheet to make sure you don't exceed the maximum supply voltage the opamp can tolerate. If your opamp can't handle enough to guarantee ±15 V out, then you either have to live with a smaller output voltage range or get a different opamp.

  3. Lose R1. It does nothing useful. It could even hurt the digital output when swinging well past the digital supply range.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.