Recent from talks
Nothing was collected or created yet.
Three-state logic
View on WikipediaIn digital electronics, a tri-state or three-state buffer is a type of digital buffer that has three stable states: a high voltage output state (logical 1), a low output state (logical 0), and a high-impedance (Hi-Z) state. In the Hi-Z state, the output of the buffer is effectively disconnected from the subsequent circuit.
Tri-state buffers are commonly used in bus-based systems where multiple devices are connected to the same shared bus, because the Hi-Z state allows other devices to drive the bus without interference from the tri-state buffer. For example, in a computer system, multiple devices such as the CPU, memory, and peripherals may be connected to the same data bus. To ensure that only one device can transmit data on the bus at a time, each device is equipped with a tri-state buffer. When a device wants to transmit data, it activates its tri-state buffer, which connects its output to the bus and allows it to transmit data. When the transmission is complete, the device deactivates its tri-state buffer, which disconnects its output from the bus and allows another device to access the bus. Tri-state buffers are also useful for reducing crosstalk and noise on a bus.
Tri-state output can be incorporated into various logic gates, flip-flops, microcontrollers, or other digital logic circuits.
Operation
[edit]A tri-state buffer behaves either like an open switch (i.e. presenting a Hi-Z output) when the enable signal B is off or as a regular non-inverting buffer (which duplicates and boosts the input onto the output) when the enable signal is on:
Unlike a simple transmission gate, a tri-state buffer when enabled additionally provides voltage level restoration to boost the input to be well within its valid logic voltage range. A tri-state buffer's behavior is given by the following truth table:
Input Output A B C 0 0 Hi-Z 1 Hi-Z 0 1 0 1 1
Alternatively, inverting tri-state buffers when enabled will invert the input A.
Uses
[edit]The Hi-Z state's purpose is to effectively remove a device's influence from the rest of the circuit. If multiple devices output to a shared wire, no device should drive the shared wire to one logical voltage level when another device drives the shared wire to another logical voltage level, since that competition would result in excessive current draw through the short circuit and an uncertain voltage level.
Three-state devices on many shared electronic buses present a Hi-Z output when not actively communicating, so that shared wires are available to be driven. For example, in a Serial Peripheral Interface bus in multidrop configuration, only a single peripheral chip at a time may be selected using its CS (chip select), while all other peripheral chips present a Hi-Z output to avoid corrupting the data sent by the one selected chip. Three-state buses are typically used between chips on a single printed circuit board (PCB), or sometimes between PCBs plugged into a common backplane.
Three-state buffers can also be used to implement efficient multiplexers, especially those with large numbers of inputs.[1]
Tri-state multiplexing, also known as Charlieplexing, is used to reduce the number of wires needed to drive a set of light-emitting diodes.
Output enable vs. chip select
[edit]Many memory devices designed to connect to a bus (such as RAM and ROM chips) have both CS and OE (output enable) pins, which superficially appear to do the same thing. If CS is not asserted, the outputs are Hi-Z.
The difference lies in the time needed to output the signal. When chip select is deasserted, the chip does not operate internally, and there will be a significant delay between providing an address and receiving the data. (An advantage of course, is that the chip consumes minimal power in this case.)
When chip select is asserted, the chip internally performs the access, and only the final output drivers are disabled by deasserting output enable. This can be done while the bus is in use for other purposes, and when output enable is finally asserted, the data will appear with minimal delay. A ROM or static RAM chip with an output enable line will typically list two access times: one from chip select asserted and address valid, and a second, shorter time beginning when output enable is asserted.
Use of pull-ups and pull-downs
[edit]When outputs are tri-stated (in the Hi-Z state) their influence on the rest of the circuit is removed, and the circuit node will be "floating" if no other circuit element determines its state. Circuit designers will often use pull-up or pull-down resistors (usually within the range of 1–100 kΩ) to influence the circuit when the output is tri-stated.
The PCI local bus provides pull-up resistors, but they would require several clock cycles to pull a signal high given the bus's large distributed capacitance. To enable high-speed operation, the protocol requires that every device connecting to the bus drive the important control signals high for at least one clock cycle before going to the Hi-Z state. This way, the pull-up resistors are only responsible for maintaining the bus signals in the face of leakage current. Intel refers to this convention as "sustained tri-state", and also uses it in the Low Pin Count bus.
Alternatives
[edit]Open collector output is an alternative to three-state logic. For example, the bidirectional I²C bus uses pull-up resistors on its two shared communication lines. When not transmitting, devices present a Hi-Z output to effectively "release" control over the communication lines. When all devices on the bus are Hi-Z, the only influence on the circuit is the pull-up resistors, which pull the lines high. When a device wants to transmit, it comes out of the Hi-Z state and drives the line low. Devices communicating over I²C either let the line float high, or drive it low – thus preventing any bus contention situation where one device drives a line high and another low.
Early microcontrollers often have some pins that can only act as an input, other pins that can only act as a push–pull output, and a few pins that can only act as an open collector input/output. A typical modern microcontroller has many three-state general-purpose input/output pins that can be programmed to act as any of those kinds of pins.
Usage of three-state logic is not recommended for on-chip connections but rather for inter-chip connections.[2] Three-state buffers, when used to enable multi-device communication on a data bus, can be functionally replaced by a multiplexer.[3] That will help select output from a range of devices and write one to the bus.
See also
[edit]Notes and references
[edit]- ^ Hill, Winfield; Horowitz, Paul (1989). The Art of Electronics. Cambridge University Press. pp. 495–497. ISBN 0-521-37095-7.
- ^ 경종민, On-Chip Buses/Networks for SoC Archived 2012-02-11 at the Wayback Machine "On-Chip Buses [have] No use of tri-state signals [because] Tri-state bus is difficult for static timing analysis"
- ^ "Tri State Buffer".
External links
[edit]- Special-output Gates on All About Circuits
- Principle of Tristate Multiplexing
Three-state logic
View on GrokipediaFundamentals
Definition and Purpose
Three-state logic, also known as tri-state logic, refers to a type of digital circuit output that can assume one of three distinct states: a logic high (representing 1), a logic low (representing 0), or a high-impedance state (often denoted as Z), in which the output is electrically disconnected from the rest of the circuit, effectively presenting no load to connected lines.[4] This high-impedance state allows the output to float without influencing the signal on shared lines, extending beyond the binary states of traditional two-state logic gates. The primary purpose of three-state logic is to facilitate efficient resource sharing in electronic systems, particularly by enabling multiple devices to connect to a single common signal line, or bus, without causing electrical conflicts known as bus contention. In this setup, only one device at a time actively drives the bus to a high or low state, while others remain in the high-impedance mode, preventing interference and allowing for signal multiplexing where data from various sources can be selectively routed over the same pathway.[4] This capability is essential for reducing wiring complexity and improving scalability in integrated circuits and digital systems. Three-state logic originated in the late 1960s amid the rapid development of transistor-transistor logic (TTL) integrated circuits, which addressed the limitations of earlier two-state logic in handling increasingly complex interconnections in computing hardware. Specifically, it was introduced by engineer Dale Mrazek at National Semiconductor in 1967 as an enhancement to the 7400 series TTL family, originally developed by Texas Instruments, enabling the first commercial tri-state devices for bus-oriented applications.[5] This innovation built on the foundational binary logic gate concepts but provided a practical extension for shared communication lines in emerging digital architectures.States and Electrical Characteristics
In three-state logic, the output can assume one of three distinct states, each characterized by specific voltage levels and impedance properties. The logic high state (denoted as '1') occurs when the output is actively driven to a voltage near the supply voltage, VCC, typically +5 V in traditional TTL implementations. In this state, the output acts as a current source, capable of sourcing up to several milliamperes (e.g., 2.6 mA minimum for VOH = 2.4 V in buffer devices like the SN54LS125A) to maintain the line high against connected loads.[6] The logic low state (denoted as '0') drives the output to a voltage close to ground (0 V), functioning as a current sink that pulls the line low. For TTL devices, the maximum low-level output voltage, VOL, is 0.4 V when sinking 12 mA (as specified for devices like the SN54LS125A), ensuring reliable low signaling without excessive voltage drop. This state exhibits low output impedance, typically in the range of 50–100 Ω, allowing effective drive of capacitive or resistive loads.[6] The high-impedance state (denoted as 'Z') renders the output effectively disconnected from the circuit, behaving as an open circuit with output impedance modeled as , in contrast to the 50–100 Ω impedance of the active high or low states. This state features very high impedance (typically in the range of hundreds of kΩ to several MΩ depending on the logic family and conditions), with off-state leakage current typically much less than 1 μA but with maximum values of up to ±20 μA in TTL and ±10 μA in CMOS implementations (e.g., at VCC = 5.5 V), preventing loading effects on shared lines driven by other devices.[6][7] Electrically, these states vary between logic families. In TTL, input high voltage threshold (VIH) is at least 2 V and input low (VIL) at most 0.8 V, with output high (VOH) minimum 2.4 V and low (VOL) maximum 0.4 V, providing noise margins of about 0.4 V. CMOS implementations, such as HCT series compatible with TTL levels, offer similar thresholds (VIH ≥ 2 V, VIL ≤ 0.8 V) but achieve higher VOH (up to 4.4 V minimum at low current) and lower VOL (0.1 V maximum), with superior noise margins exceeding 1 V due to rail-to-rail outputs. In the Z state, CMOS exhibits particularly low power dissipation, as the output transistors are off, resulting in negligible static current (typically <1 μA per gate) compared to active states where dynamic switching consumes power proportional to load capacitance and frequency.[6][7]Operation
High-Impedance Mechanism
The high-impedance state in three-state logic devices is achieved through internal circuitry that isolates the output node from the power supply and ground when the enable signal is inactive, effectively creating an open circuit with very high output impedance, typically on the order of megohms.[8] This isolation prevents the device from sourcing or sinking current, allowing other devices to drive the shared line without contention. In CMOS implementations, a common approach uses a tri-state buffer or inverter where the output path incorporates a transmission gate formed by a PMOS transistor and an NMOS transistor in parallel, controlled by complementary enable signals. When the enable input (EN) is low, the PMOS is off (gate high) and the NMOS is off (gate low), disconnecting the logic circuitry from the output and resulting in the high-impedance (Z) state regardless of the input.[9] For a tri-state inverter variant, additional inverter stages restore the logic level during active operation, but the enable mechanism similarly gates the output transistors to float the pin when disabled. A textual schematic breakdown illustrates this: the input feeds an inverter pair to generate the output logic; this inverted signal then drives the gates of a pull-up PMOS and pull-down NMOS in the output stage; a separate enable inverter provides EN-bar to the gate of a series PMOS and EN to the gate of a series NMOS, ensuring both are non-conducting in the Z state.[9] In TTL devices, such as the 74LS244 octal buffer, the high-impedance state is realized by modifying the standard totem-pole output configuration with an enable transistor that disables both the upper Darlington pair (for high output) and the lower NPN transistor (for low output). When the output-enable input (G) is high, this control transistor turns off the base drives to the output stage, floating the collector-emitter path and isolating the output.[1] The totem-pole structure normally provides low-impedance drive (high for sourcing ~400 μA, low for sinking ~8 mA), but in Z mode, the output impedance rises dramatically, mimicking an open connection. A simplified schematic description shows: the input logic drives phase-splitter transistors; the enable signal gates a PNP or additional NPN to cut off current to the output Darlington (Q3-Q4 for high) and totem-pole lower (Q5), leaving the output pin undriven.[1] Transitioning into or out of the high-impedance state introduces propagation delays due to the time required to charge/discharge internal nodes and the output capacitance. In standard TTL like the 74LS244, the disable time from low to Z (tPLZ) is approximately 10-20 ns, and from high to Z (tPHZ) is 15-25 ns, measured under typical conditions (VCC=5 V, CL=5 pF).[10] These delays ensure reliable bus arbitration but must be considered in high-speed designs to avoid glitches during state changes.[10]Enable and Disable Processes
In three-state logic, the enable process activates the output buffer through an enable signal, typically denoted as EN, which can be configured as active-high or active-low. When asserted—for instance, logic high for active-high designs—the buffer connects the input data signal D to the output Q, driving it to a logic low (0) or high (1) state accordingly, thereby allowing the device to participate in bus communication. This activation requires adherence to timing parameters such as setup time (the minimum duration the data must be stable before the enable transition) and hold time (the minimum duration after the transition), with examples in 3.3 V CMOS buffers like the SN74LVC1G125 specifying a setup time of approximately 2 ns.[11] The propagation delay from enable assertion to output stabilization is also critical, around 4 ns typical in such devices.[11] The disable process occurs when the enable signal is deasserted, causing the output to transition to the high-impedance state (Z), effectively isolating the device from the bus and preventing it from influencing other connected components. This deassertion typically takes a disable time (t_dis) of 4.6 ns or less in high-speed buffers at 3.3 V, during which the output impedance rises to several megaohms, mimicking an open circuit.[12] However, if multiple tri-state devices share a bus and their enable signals are not properly synchronized, brief contention may arise, where outputs momentarily drive conflicting levels, potentially leading to increased current draw or logic errors.[13] To mitigate this, disable timing must overlap minimally with other devices' enable periods, often managed through clocked control.[14] Control logic for three-state outputs commonly employs simple combinational gates, such as AND or OR structures integrated within the buffer, to combine the enable signal with the data input. The output behavior can be represented symbolically as: if EN = 1, then Q = D; if EN = 0, then Q = Z (where Z denotes high-impedance). This logic ensures the device only drives the bus when enabled, as illustrated in the following truth table for an active-high enable configuration:| EN | D | Q |
|---|---|---|
| 1 | 0 | 0 |
| 1 | 1 | 1 |
| 0 | 0 | Z |
| 0 | 1 | Z |
