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.
Reviewed by: AI editorial process; not yet individually human-reviewed
Have a quick question? Jump to the Q&A page
Jump to a section
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 from the signal to the inverting input and a feedback resistor 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 with a 50 kilohm gives a gain of and an output of 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.
The difference amplifier
A difference amplifier uses resistors on both inputs so the op-amp amplifies the difference between two input voltages, , 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 , the output saturates high (near the positive supply).
- If , 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 kilohms and kilohms. State the gain. [1 mark]
- Cue. Gain .
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 has an input of V. Find the output. [2 marks]
- Cue. .
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: .
Because it inverts, the gain is (the output is the opposite sign to the input).
Output: .
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
- The potential divider relationship and its use with input transducers such as the thermistor and the light-dependent resistor to produce a sensing voltage.
An SQA Higher Engineering Science answer on the potential divider relationship and how it is used with input transducers such as the thermistor and light-dependent resistor to produce a voltage that responds to temperature or light.
- Ohm's law and the power relationships, and analysing series and parallel resistor networks for current, voltage, resistance and power.
An SQA Higher Engineering Science answer on Ohm's law and the power relationships, and on analysing series and parallel resistor networks to find current, voltage, total resistance and power dissipation.
- The transistor as an electronic switch driven by a small input signal, used to control output devices, with a diode to protect against the back-emf of inductive loads.
An SQA Higher Engineering Science answer on the transistor as an electronic switch driven by a small input signal, how it controls output devices such as relays and motors, and why a protective diode is needed across inductive loads.
- Modelling electronic devices with the input, process and output system model, and distinguishing analogue from digital signals.
An SQA Higher Engineering Science answer on modelling electronic devices with the input, process and output system model, and on the difference between analogue and digital signals with examples of each.
Sources & how we know this
- SQA Higher Engineering Science Course Specification β SQA (2019)
- Higher Engineering Science Course Specification (PDF) β SQA (2019)