thumb|Schematic diagrams showing pull-up (PU) and pull-down (PD) resistors. When the switch is open, the PU/PD pulls the digital input voltage to Vcc or Vss, respectively. When the switch is closed, the digital input is connected to a low-impedance driving source, which may be a logic low or high level irrespective of whether the circuit has a PU or PD.
In electronic logic circuits, a pull-up resistor (PU) or pull-down resistor (PD) is a resistor used to ensure a known state for a signal. More specifically, a pull-up resistor or pull-down resistor ensures that a wire will have a high logic level or low logic level, respectively, in the absence of a driving signal. It is typically used in conjunction with components such as switches, transistors and connectors, that physically or electrically interrupt the connection of other components to a low impedance logic-level source, such as ground, positive supply voltage (V<sub>CC</sub>), or an actively-driven logic circuit output and thus cause the inputs of those components to float (i.e. to have an indeterminate voltage) — a condition which can lead to unpredictable and potentially damaging circuit behavior.<!-- this sentence is too convoluted and needs to be broken down -->
For example, in the case of a switch which, when closed, connects a circuit to ground or positive supply voltage, without a PU or PD, when the switch is open, the circuit would be left floating. In such cases, a pull-up or pull-down resistor ensures stable, reliable, and safe operation of the circuit.
Pull-up and pull-down resistors are implemented in various ways. Often they are provided as discrete devices, mounted on the same circuit board as the logic devices that use them. Many microcontrollers and FPGAs provide internal, programmable PU and PD resistors for their logic input pins to reduce the need for external components.
Principle
In a circuit with an open switch, no current flows through that branch. Because of this, Kirchhoff's laws do not specify the voltage across the open switch. The voltage can vary unpredictably due to ambient electrical noise, leakage currents, and parasitic capacitance. Without additional sources or boundary conditions, the voltage remains indeterminate and consequently the voltage across connected components are undefined, too.
A pull-up (or pull-down) resistor provides a defined path for current to flow to a voltage source when the switch is open. This ensures the voltage at the connected node is set to a known level, typically logic high (or low). By doing so, it eliminates the indeterminacy caused by the open switch, allowing Kirchhoff's laws to determine the voltage reliably.
{| class="wikitable mw-datatable"
|+Truth table of pull-up and pull-down resistors<br>Logic level at switch output
! scope="col" rowspan="2" |Switching<br>device
! scope="col" colspan="3" |Resistor
|-
! scope="col" |Pull-up
! scope="col" |Pull-down
! scope="col" |None
|-
! scope="row" |Closed to Vcc<br>(logic 1)
| 1 || 1 || 1
|-
! scope="row" |Closed to 0V<br>(logic 0)
| 0 || 0 || 0
|-
! scope="row" |Open
| 1 || 0 || Indeterminate
|}
Optimal resistance
thumb|Typical circuit influences that determine the allowable resistance range of a pull-up resistor. R<sub>PU</sub> must be large enough to ensure V<sub>IN</sub> is valid logic low when the switch is closed, and small enough to ensure V<sub>IN</sub> is valid logic high when the switch is open.
A pull-up resistor must have an appropriate amount of resistance to be effective and not otherwise interfere with circuit operation. For this, it is assumed that the critical components have infinite or sufficiently high impedance, which is guaranteed, for example, for logic gates made from FETs. In this case, when the switch is open, the voltage drop across a pull-up resistor (with sufficiently low impedance) practically vanishes, and the circuit looks like a wire directly connected to positive supply voltage. On the other hand, when the switch is closed, the pull-up resistor must have sufficiently high impedance in comparison to the closed switch to not affect the connection to ground. Together, these two conditions can be used to derive an appropriate value for the impedance of the pull-up resistor. However, usually, only a lower bound is derived, assuming that the critical components do indeed have infinite impedance.
A resistor with relatively low resistance (relative to the circuit it is in) is often called a "strong" pull-up or pull-down; Holding unused TTL inputs low consumes more current. For that reason, pull-up resistors are preferred in TTL circuits.
Drawbacks
A pull-up or pull-down consumes power when current passes through it, resulting in heat generation and wasted energy. Also, its resistance together with stray circuit capacitance forms a low pass filter that stretches (extends the duration of) rising or falling signal edges, thus limiting the maximum speed at which the circuit can operate. Certain logic families are susceptible to power supply transients introduced into logic inputs through pull-up resistors, which may force the use of a separate filtered power source for the pull-ups.
See also
- Rp (USB) - a specific type of pull-up resistor in USB-C connectors
- Rd (USB), Ra (USB) - specific types of pull-down resistors in USB-C connectors
- Three-state logic
Further reading
- Paul Horowitz and Winfield Hill, The Art of Electronics, 2nd edition, Cambridge University Press, Cambridge, England, 1989,
References
de:Open circuit#Pull-up
