Skip to main content
ScotlandEngineering ScienceSyllabus dot point

How does an operational amplifier amplify or compare voltages, and how do you calculate the gain of an inverting amplifier?

The operational amplifier as an inverting amplifier with gain set by feedback resistors, as a difference amplifier, and as a comparator producing a switching output.

An SQA Higher Engineering Science answer on the operational amplifier as an inverting amplifier with gain set by feedback resistors, as a difference amplifier, and as a comparator that produces a switching output for control.

Generated by Claude Opus 4.813 min answer

Reviewed by: AI editorial process; not yet individually human-reviewed

Have a quick question? Jump to the Q&A page

Jump to a section
  1. What this key area is asking
  2. The operational amplifier
  3. The inverting amplifier
  4. The difference amplifier
  5. The comparator
  6. Examples in context
  7. Try this

What this key area is asking

The SQA wants you to use the operational amplifier (op-amp) in three roles: as an inverting amplifier whose gain is set by two resistors, as a difference amplifier that amplifies the difference between two inputs, and as a comparator that switches its output high or low depending on which input is larger. The op-amp is the central processing component of the analogue electronics in this course.

The operational amplifier

The op-amp is powered from a supply, and its output cannot exceed the supply rails, so it saturates (sticks near a supply value) when driven hard. Whether it acts as a controlled amplifier or a switch depends entirely on whether feedback resistors are fitted.

The inverting amplifier

With an input resistor R1R_1 from the signal to the inverting input and a feedback resistor RfR_f from the output back to the inverting input, the op-amp becomes a stable inverting amplifier.

So a 0.1 V input through a 10 kilohm R1R_1 with a 50 kilohm RfR_f gives a gain of βˆ’5-5 and an output of βˆ’0.5-0.5 V. The gain is set purely by the ratio of the two resistors, which is why op-amp amplifiers are precise and predictable: choose the resistor ratio for the gain you need.

flowchart LR Vin["Vin"] --> R1["R1 (input)"] --> N["- input"] N --> A(("op-amp")) A --> Vout["Vout"] Vout --> Rf["Rf (feedback)"] --> N P["+ input to 0 V"] --> A

The difference amplifier

A difference amplifier uses resistors on both inputs so the op-amp amplifies the difference between two input voltages, V2βˆ’V1V_2 - V_1, rather than a single signal against zero. This is useful when the wanted signal is the gap between two voltages, for example the imbalance between two arms of a sensor bridge, while ignoring any voltage common to both. The same idea, amplifying a difference, is what the op-amp does at its core; the difference amplifier simply exposes both inputs to external signals.

The comparator

Remove the feedback resistor and the op-amp becomes a comparator. With no feedback it runs at its full open-loop gain, so the slightest difference between the inputs drives the output to a rail.

  • If V+>Vβˆ’V_+ > V_-, the output saturates high (near the positive supply).
  • If V+<Vβˆ’V_+ < V_-, the output saturates low (near the negative supply or 0 V).

The output therefore has just two levels, set by which input is larger. Feeding a sensor's potential-divider voltage to one input and a fixed reference to the other makes the output switch sharply when the sensor voltage crosses the reference. This is the standard way to turn an analogue measurement into a clean switching (digital) signal at a chosen threshold.

Examples in context

An op-amp inverting amplifier boosts the tiny signal from a microphone or sensor to a usable level for the next stage, with the gain fixed by a resistor ratio chosen by the designer. A comparator is the heart of any threshold detector: a thermostat that switches a heater at a set temperature, a light circuit that switches at a set darkness, or a battery monitor that warns below a set voltage. The two roles cover the two things processing must do to an analogue signal: make it bigger, or decide whether it has crossed a line.

Try this

Q1. An inverting amplifier has Rf=80R_f = 80 kilohms and R1=20R_1 = 20 kilohms. State the gain. [1 mark]

  • Cue. Gain =βˆ’Rf/R1=βˆ’80/20=βˆ’4= -R_f/R_1 = -80/20 = -4.

Q2. State the condition for a comparator's output to go high (output near the positive supply). [1 mark]

  • Cue. When the non-inverting (++) input voltage is greater than the inverting (βˆ’-) input voltage.

Q3. An inverting amplifier with gain βˆ’10-10 has an input of +0.2+0.2 V. Find the output. [2 marks]

  • Cue. Vout=βˆ’10Γ—0.2=βˆ’2.0Β VV_{out} = -10 \times 0.2 = -2.0\ \text{V}.

Exam-style practice questions

Practice questions written in the style of SQA exam questions on this dot point, with worked answer explainers. The year tag is the paper they imitate, not the source.

SQA Higher (specimen)4 marksAn inverting amplifier uses a feedback resistor of 100 kilohms and an input resistor of 20 kilohms. Calculate the voltage gain, and find the output voltage when the input is +0.15 V.
Show worked answer β†’

The gain of an inverting amplifier is set by the ratio of the feedback resistor to the input resistor.

Gain magnitude: ∣VoutVin∣=RfR1=10020=5\left|\dfrac{V_{out}}{V_{in}}\right| = \dfrac{R_f}{R_1} = \dfrac{100}{20} = 5.

Because it inverts, the gain is βˆ’5-5 (the output is the opposite sign to the input).

Output: Vout=βˆ’RfR1Γ—Vin=βˆ’5Γ—0.15=βˆ’0.75Β VV_{out} = -\dfrac{R_f}{R_1} \times V_{in} = -5 \times 0.15 = -0.75\ \text{V}.

Markers reward the resistor ratio for the gain magnitude, recognising the inversion (negative sign), and the correct output voltage with its sign. Forgetting the inversion (giving +0.75 V) loses the sign mark.

SQA Higher (specimen)3 marksExplain how an operational amplifier used as a comparator switches its output, and state why this is useful in a control system.
Show worked answer β†’

As a comparator the op-amp has no feedback resistor; it compares the voltages on its two inputs.

When the voltage on the non-inverting (+) input is higher than that on the inverting (-) input, the output saturates near the positive supply (high). When the + input is lower than the - input, the output saturates near the negative supply or zero (low). So the output switches between two levels depending on which input is larger.

This is useful because it turns an analogue input (for example a sensor voltage from a potential divider) into a clean two-level (digital) switching signal at a set threshold, which can then drive an output device or logic. It is the standard way to make a circuit act when a measured quantity crosses a set point.

Markers reward the comparison of the two inputs, the output saturating high or low accordingly, and the point that it converts an analogue signal into a switching output at a threshold.

Related dot points

Sources & how we know this