XNOR gate
The XNOR (exclusive-NOR) gate is a fundamental digital logic gate used in electronics and computer engineering that produces a high output (logic 1) when an even number of its inputs are high, or specifically for the standard two-input configuration, when both inputs are identical (both low or both high).[1][2] As the logical complement of the XOR gate, it performs the equivalence operation in Boolean algebra, denoted as A ↔ B, and is symbolized by a combination of an XOR gate followed by a NOT gate or by a specific gate symbol featuring a curved input line and a small circle indicating inversion.[2][3] For a two-input XNOR gate, the function can be fully described by its truth table, which lists all possible input combinations and corresponding outputs:[1][2] The Boolean expression for the two-input XNOR gate is \overline{A \oplus B} or equivalently (A \cdot B) + (\overline{A} \cdot \overline{B}), where \oplus denotes the XOR operation, confirming its role as the negation of exclusive-OR.[2][3] This gate can be implemented using four NAND gates or other combinations of basic gates like AND, OR, and NOT, enabling efficient integration into larger circuits.[3] XNOR gates play a critical role in various digital systems, including arithmetic logic units (ALUs) for generating carry signals in full adders, data comparators for equality checks, and error-detection mechanisms like even-parity generators in communication protocols.[2][1] Their ability to detect matching binary states makes them indispensable in applications such as multiplexers, memory address decoding, and control logic within microprocessors and field-programmable gate arrays (FPGAs).[3] Ongoing research focuses on low-power and compact XNOR designs using advanced technologies like oxide thin-film transistors and memristors to enhance performance in energy-constrained environments.[4][5]Fundamentals
Definition
The XNOR gate, also known as the exclusive NOR gate, is a basic digital logic component that performs a binary operation outputting a logic high (1) only when both inputs are identical—either both logic low (0) or both logic high (1)—and a logic low (0) otherwise.[6] This behavior implements the logical equivalence function, serving as the complement of the exclusive OR (XOR) operation. With two inputs, conventionally labeled A and B, and a single output Y defined as Y = A XNOR B, the gate processes binary signals to produce this equality-based result.[7] In digital electronics, the XNOR gate's core purpose is to detect equivalence between binary inputs, enabling its use in circuits that require signal comparison or synchronization.[3] It plays a key role in applications such as equality comparators for verifying matching data bits and parity generators/checkers for error detection in data transmission and storage systems. These functions highlight its importance in building reliable combinational logic networks. The XNOR gate emerged as part of mid-20th-century advancements in Boolean algebra applied to digital switching theory, alongside the XOR gate, during the development of electronic computers and relay-based systems in the 1940s and 1950s. Practical hardware implementations became feasible with the advent of integrated circuits, particularly in Texas Instruments' transistor-transistor logic (TTL) families introduced in the 1960s, which standardized logic gates for widespread use in computing and control systems.[8]Relationship to XOR and Other Gates
The XNOR gate serves as the direct complement to the XOR gate, where its output is the logical negation of the XOR output, effectively transforming the XOR's detection of input differences into a detection of input equality.[9] This relationship can be expressed as Y = \overline{A \oplus B}, highlighting how the XNOR inverts the exclusive-OR behavior to produce a high output when both inputs are identical.[10] In practical terms, this makes the XNOR ideal for applications requiring confirmation of matching binary states, in contrast to the XOR's role in identifying mismatches.[11] Compared to the NOR gate, the XNOR represents a more specialized inversion function, yielding a high output specifically when both inputs are equal (either both low or both high), whereas the NOR produces a high output only when both inputs are low, inverting the broader OR operation.[9][11] This distinction positions the XNOR as a targeted equivalence checker rather than a universal negator like the NOR, which cannot directly assess input similarity without additional logic.[12] In parity generation, the XNOR gate is commonly employed for even parity checking, where it outputs a high signal when an even number of inputs are high, directly contrasting the XOR's use for odd parity detection.[13] For multi-bit systems, a multi-input XNOR gate, which outputs high when an even number of inputs are high, facilitates even parity computation for error detection in data transmission by verifying even numbers of ones.[14][15] Applying De Morgan's theorem reveals a structural equivalence for the XNOR, where it can be viewed as ( \overline{A} \land \overline{B} ) \lor (A \land B ), underscoring its composition from AND and OR operations with inversions, though this form emphasizes logical duality without altering its core equality function.[10] A common misconception is that the XNOR functions universally as an "equality gate" beyond binary contexts; however, it strictly assumes two-valued logic inputs, and extensions to multi-valued or analog signals require additional circuitry to maintain equivalence detection.[11][10]Representations
Symbols
The graphical symbols for the XNOR gate are standardized to facilitate clear representation in digital circuit schematics, ensuring consistency across engineering documentation. These symbols visually convey the gate's function of outputting true only when both inputs are identical, with the inversion distinguished from the XOR gate.[16] The ANSI/IEEE standard symbol, defined in IEEE Std 91-1984 and supplemented by IEEE Std 91a-1991, employs a distinctive shape with a curved input side resembling a concave arc where the two input lines converge, and a small bubble (inversion indicator) at the straight output terminal to denote negation, setting it apart from the XOR gate's equivalent shape without the bubble.[17] This design prioritizes intuitive recognition of the gate's exclusive-nor operation in schematic diagrams. In contrast, the IEC 60617-12 standard uses a rectangular outline for the gate, containing the equality symbol "=" inside the box, with a horizontal bar placed over the output line to signify inversion, providing a more uniform, label-based representation suitable for international documentation.[18] This rectangular format allows for broader device representation and is adopted in various national standards derived from IEC guidelines. Variations in symbol depiction appear in technical documentation, where hand-drawn versions may approximate the curves or rectangles with less precision compared to computer-aided design (CAD) tools that render exact proportions per standards; additionally, active-low input indicators can be added via bubbles on input lines if the context requires inverted logic levels, though standard symbols assume active-high operation.[19] Usage guidelines for these symbols emphasize their depiction with exactly two input terminals converging into the gate body and a single output terminal, avoiding any indication of multi-input configurations to maintain focus on the basic two-input XNOR function in schematics.[20]Truth Table and Boolean Expression
The truth table for a two-input XNOR gate specifies the output Y for all possible combinations of inputs A and B, where the output is logic high (1) when the inputs are equal and logic low (0) when they are unequal, reflecting the gate's role as an equality detector.[3]| A | B | Y (A XNOR B) |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Y = \overline{A}\overline{B} + AB,
derived from the minterms m0 (\overline{A}\overline{B}) and m3 (AB) in the truth table.[2] The product-of-sums (POS) form is
Y = (A + B)(\overline{A} + \overline{B}),
obtained by considering the maxterms where the output is 0 (M1 and M2). The Karnaugh map (K-map) for a two-variable XNOR function visualizes the simplification process, with 1s placed in the cells for input combinations 00 and 11 (minterms m0 and m3):
Grouping the adjacent 1s (which wrap around the edges) yields the SOP expression \overline{A}\overline{B} + AB, eliminating redundant literals for minimal gate count.[16] To verify the expressions against the truth table, substitute each input pair: for A=0, B=0, \overline{0}\overline{0} + 0\cdot0 = 1 + 0 = 1; for A=0, B=1, \overline{0}\overline{1} + 0\cdot1 = 1\cdot0 + 0 = 0; for A=1, B=0, \overline{1}\overline{0} + 1\cdot0 = 0\cdot1 + 0 = 0; for A=1, B=1, \overline{1}\overline{1} + 1\cdot1 = 0 + 1 = 1. This confirms logical equivalence across all cases. In circuit timing, the multi-term SOP or POS structure implies a propagation delay determined by the longest path through the AND-OR or OR-AND stages, typically influencing overall combinational logic speed without altering the steady-state output.[3]B A 0 1 ------- 0 | 1 0 1 | 0 1B A 0 1 ------- 0 | 1 0 1 | 0 1
Hardware Description
Pinout and Physical Form
The 74LS266 integrated circuit (IC) is a standard example of a quad 2-input exclusive-NOR (XNOR) gate, containing four independent XNOR gates with open-collector outputs designed for wired-AND configurations.[21] This TTL-compatible chip, introduced in the 1970s as part of the 7400 series, typically comes in a 14-pin dual in-line package (DIP), which was the dominant form factor for through-hole mounting in discrete logic designs from the 1960s onward.[21] The pinout follows the conventional layout for quad-gate ICs in the 74 series, with inputs and outputs staggered across the package to facilitate easy breadboarding and soldering. The pin assignments for the 74LS266 are as follows, where each XNOR gate has two inputs (A and B) and one output (Y), with power and ground pins at opposite ends:| Pin | Name | Function |
|---|---|---|
| 1 | 1A | Input A for gate 1 |
| 2 | 1B | Input B for gate 1 |
| 3 | 1Y | Output Y for gate 1 |
| 4 | 2A | Input A for gate 2 |
| 5 | 2B | Input B for gate 2 |
| 6 | 2Y | Output Y for gate 2 |
| 7 | GND | Ground (0 V) |
| 8 | 3Y | Output Y for gate 3 |
| 9 | 3B | Input B for gate 3 |
| 10 | 3A | Input A for gate 3 |
| 11 | 4Y | Output Y for gate 4 |
| 12 | 4B | Input B for gate 4 |
| 13 | 4A | Input A for gate 4 |
| 14 | VCC | Positive supply (typically 5 V) |
Electrical Characteristics
The electrical characteristics of XNOR gates vary depending on the logic family, with transistor-transistor logic (TTL) and complementary metal-oxide-semiconductor (CMOS) being the most common implementations. In TTL families, such as the 74LS series, the recommended supply voltage (VCC) operates between 4.75 V and 5.25 V, with logic high (VOH) defined as a minimum of 2.7 V and logic low (VOL) as a maximum of 0.5 V under standard loading conditions.[23] CMOS variants, including high-speed CMOS (HC) and low-voltage CMOS (LVC), support supply voltages from 2 V to 6 V, though 3.3 V and 5 V are typical; for 5 V operation, logic high is typically VDD - 0.1 V (minimum 4.4 V) and logic low is 0.1 V (maximum).[23] Fan-out ratings for TTL XNOR gates are generally 10 low-level loads (4 mA sink current) and 20 high-level loads, while CMOS gates offer higher fan-out due to lower input currents, often exceeding 50 loads.[24] Propagation delay (tpd), the time from input change to output stabilization, is a critical timing parameter influenced by load capacitance and supply voltage. For TTL XNOR gates in the 74LS266, typical propagation delay is 15 ns at 5 V with a 15 pF load, increasing with higher capacitive loads up to 50 pF.[22] In CMOS implementations like the 74HC266, delay is comparably 16 ns at 5 V, but advanced LVC families achieve 3.5 ns at 3.3 V, with delays scaling inversely with supply voltage and directly with load.[25] Rise and fall times for TTL are typically 10 ns, while CMOS exhibits 5-10 ns under similar conditions, ensuring compatibility in mixed-signal environments.[26] Power consumption in XNOR gates differs significantly between families, with static and dynamic components. TTL gates consume static power of approximately 10 mW per gate due to constant base current in bipolar transistors, plus dynamic power during switching; for a 74LS266 quadruple gate, total quiescent current (ICC) is 8 mA at 5 V.[24] CMOS XNOR gates, such as those in the 74HC series, feature near-zero static power (under 1 µA) owing to high input impedance, with dynamic power dominated by capacitive charging (P = CL V2 f, where CL is load capacitance, V is supply voltage, and f is switching frequency), typically 0.1-1 mW per gate at 1 MHz and 5 V.[23] This low static power makes CMOS preferable for battery-powered or low-heat applications. Noise margins quantify immunity to voltage fluctuations, calculated as the difference between output levels and input thresholds. TTL XNOR gates provide noise margins of 0.4 V for both high (NMH = VOH - VIH) and low (NML = VIL - VOL) states, with VIH (minimum high input) at 2 V and VIL (maximum low input) at 0.8 V.[27] CMOS margins are superior, often 1.5-2 V at 5 V supply (about 40% of VDD), with VIH at 3.5 V and VIL at 1.5 V for HC families, enhancing robustness in noisy environments.[28] These margins derate with temperature, reducing by 0.2-0.3% per °C beyond 25 °C, supporting operation from -40 °C to 85 °C commercially or -55 °C to 125 °C for extended ranges.[26] XNOR gates comply with JEDEC standards for logic families, such as JESD 7C for TTL and JESD 8C for CMOS, which define DC parameters, test conditions, and loading for interoperability. These include standardized input/output current limits (e.g., 400 µA source/sink for CMOS) and environmental testing for reliability across voltage, temperature, and load variations.Implementation
Combinational Logic Synthesis
Combinational logic synthesis for an XNOR gate involves constructing the circuit from basic logic gates such as AND, OR, and NOT, or using universal gates like NAND to realize the function Y = (A \land B) \lor (\lnot A \land \lnot B), which outputs true when both inputs are equal. This approach allows for modular design in digital systems where primitive gates are available, enabling verification against the standard truth table before integration.[3] One common method uses the AND-OR-INVERT (AOI) structure, implemented with two 2-input AND gates, one 2-input OR gate, and two NOT gates for inversion of the inputs. The first AND gate computes A \land B, the second computes \lnot A \land \lnot B after applying NOT gates to A and B, and the OR gate combines these terms to produce the XNOR output; this configuration minimizes gate count for basic synthesis while directly reflecting the Boolean expression. Optimization techniques, such as using complex gate libraries, can further reduce propagation delay and transistor usage in implementations.[29] An alternative synthesis leverages NAND gates as universal primitives, requiring five 2-input NAND gates for a complete XNOR. The configuration proceeds as follows: the first NAND gate takes inputs A and B to produce Y_1 = \lnot (A \land B); the second and third NAND gates create inverters by tying inputs together, yielding Y_2 = \lnot A and Y_3 = \lnot B; the fourth NAND combines Y_2 and Y_3 to get Y_4 = A \lor B; finally, the fifth NAND inverts Y_4 \land Y_1 to output the XNOR function. This NAND-only design is advantageous in technologies where NAND is the preferred primitive, such as early TTL families, due to its universality and balanced rise/fall times.[30] The XNOR can also be synthesized from an XOR gate followed by a NOT gate at the output, exploiting the relationship \text{XNOR}(A, B) = \lnot \text{XOR}(A, B). This method is straightforward if XOR primitives are available, reducing design complexity, but it incurs an additional propagation delay from the inverter, potentially impacting high-speed applications; in contrast, direct synthesis from basic gates may offer better timing in custom layouts.[3] Optimization techniques in combinational synthesis include bubble pushing, which applies De Morgan's theorems to propagate inversion bubbles through gate symbols, converting AND to OR (or vice versa) and eliminating redundant NOT gates—for instance, pushing a bubble from an AND output to its inputs transforms it to a NAND while adjusting connected logic, often reducing inverter count by 20-30% in multilevel circuits. Such methods ensure minimal gate count and delay, as demonstrated in standard digital design practices.[31] Historically, early computers in the 1950s and 1960s used vacuum tubes, relays, and later bipolar transistors in RTL or DTL families to implement basic logic functions, including equivalents to XNOR through combinations of inverters, AND, and OR networks. By the 1970s, XNOR was standardized as a dedicated gate in ICs like the 74LS266.CMOS Transistor-Level Design
The transmission gate approach for implementing an XNOR gate in CMOS technology typically builds upon a core XOR structure using four transistors—two PMOS and two NMOS—configured as complementary pass transistors to form the basic logic, with an additional inverter stage to convert the XOR output to XNOR.[32] This core leverages transmission gates, each consisting of an NMOS and PMOS in parallel, controlled by complementary input signals (A, \bar{A}, B, \bar{B}) to pass logic levels bidirectionally and achieve full voltage swing.[33] The pull-up and pull-down networks are simplified in this design, reducing transistor count compared to fully complementary alternatives, though an output inverter (two transistors) is added for the XNOR function, resulting in a total of around 6-8 transistors for the basic circuit.[34] A more robust full CMOS schematic for the XNOR gate employs a 12-transistor design, featuring complementary PMOS pull-up and NMOS pull-down networks that mirror each other to implement the equality detection logic (output high when inputs A and B are equal).[35] In this configuration, four transistors form two inverters to generate the required complementary signals (\bar{A} and \bar{B}), while the remaining eight transistors—arranged in series-parallel combinations—handle the logic: the pull-down NMOS network conducts for unequal inputs through parallel paths of (A in series with \bar{B}) and (\bar{A} in series with B); the pull-up PMOS network, as the dual, conducts for equal inputs through parallel paths of (\bar{A} in series with \bar{B}) and (A in series with B).[36] This static complementary structure avoids intermediate voltage drops common in pass-transistor-only designs, ensuring rail-to-rail output swings.[37] In clockless static CMOS operation, the XNOR gate responds continuously to input transitions without a clock signal, relying on the always-active complementary networks for output determination. During equal input states (A = B = 0 or A = B = 1), the pull-down NMOS network is off while the pull-up PMOS conducts, charging the output to V_{DD}; conversely, for unequal states (A \neq B), the pull-up is off and pull-down conducts to ground the output.[36] Transistor conduction during transitions is governed by gate voltages: rising edges on equal inputs activate PMOS paths with low threshold drops, while falling edges on unequal inputs enable NMOS discharge, with short-circuit currents minimized due to complementary switching.[38] This phase-independent behavior ensures glitch-free operation in combinational circuits, though brief contention occurs at transitions before steady-state is reached.[37] Compared to TTL implementations, CMOS XNOR designs offer lower static power dissipation (near-zero when inputs are stable) and higher integration density, enabling more gates per chip area.[39] In VLSI layout, these advantages are enhanced by Euler paths, which trace transistor connections in a single continuous diffusion strip for the NMOS and PMOS networks separately, minimizing shared diffusion regions and reducing parasitic capacitance for the XNOR's complex series-parallel topology.[40] As of 2025, modern variants of CMOS XNOR gates utilize 7nm FinFET technology in AI accelerators, where multi-fin structures improve drive current and reduce leakage for in-memory computing tasks like similarity matching in neural networks.[41] These designs integrate XNOR operations within ternary SRAM cells for low-power binary/ternary logic, achieving significant power reductions of up to approximately 75% compared to conventional 10T XNOR-based designs (as of September 2025).[42] However, scaling below 7nm introduces quantum tunneling effects in thin gate oxides and channels, increasing subthreshold leakage and limiting further miniaturization without emerging devices like gate-all-around FETs.[43]Extensions
Multi-Input Configurations
For multi-bit equality checking, the XNOR gate extends beyond its two-input form by applying it pairwise to corresponding bits of two n-bit inputs, A = (A_{n-1} ... A_0) and B = (B_{n-1} ... B_0). The overall equality output Y is the logical AND of these n individual bit-wise XNOR results, ensuring Y = 1 only if all corresponding bits match (i.e., A equals B). This configuration is expressed as: Y = \bigwedge_{i=0}^{n-1} \overline{A_i \oplus B_i} or equivalently, the product of the pairwise equalities between bits.[44] To realize this in hardware, n two-input XNOR gates compute the bit-wise equalities in parallel, followed by a reduction tree of two-input AND gates to combine the results into a single output. The AND tree is structured associatively, pairing outputs level by level (e.g., for n=8, first pair into 4 ANDs, then 2, then 1), achieving logarithmic depth O(\log n) while using O(n) gates total. This cascaded approach avoids direct multi-input AND gates, which suffer from increased delay and power due to high fan-in.[45] In field-programmable gate arrays (FPGAs), this multi-bit XNOR-AND function can be implemented using lookup tables (LUTs) configured for small n (e.g., 4-6 bits per LUT in common 6-LUT architectures), with larger n handled by chaining multiple LUTs in a tree topology. However, long chains introduce fan-out delays from routing congestion and signal propagation, potentially limiting clock speeds; balanced tree structures mitigate this by minimizing depth. For example, a 32-bit equality checker might use 32 XNOR-configured LUTs feeding a 5-level AND tree, trading area for reduced latency.[46][47] These configurations find key applications in arithmetic logic units (ALUs) as multi-bit comparators, where the equality output sets the zero flag for operations like subtraction (A - B = 0 implies equality) or conditional branching. In content-addressable memory (CAM), XNOR gates enable parallel pattern matching: each CAM row uses bit-wise XNORs across stored words, with row-wise ANDs (or wired-OR for match lines) to detect full matches, accelerating searches in networking routers and databases.[48][49] Despite its utility, direct implementations of high-fan-in ANDs for n > 4 exhibit exponential growth in transistor count and parasitic capacitance in CMOS, leading to higher power dissipation and propagation delays that exceed tree-based alternatives. For very large n (e.g., >64 bits), parity-based checks using cascaded XOR/XNOR trees serve as efficient approximations or complements, detecting mismatches via even/odd errors rather than exact equality, though at the cost of reduced precision.[50][51]Functional Equivalents and Alternatives
Pass-transistor logic (PTL) provides an alternative hardware implementation for XNOR functionality by leveraging transmission gates or multiplexers, requiring as few as 4 transistors in some designs compared to around 10-12 transistors in standard full CMOS XNOR gates.[52][53] This reduction in transistor count stems from PTL's use of pass transistors to directly route signals based on input conditions, avoiding the complementary pull-up and pull-down networks of CMOS. PTL-based XNOR designs exhibit lower static power dissipation and improved performance at reduced supply voltages, making them suitable for low-power VLSI applications.[54] In software environments, XNOR operations can be emulated efficiently using bitwise operators, such as in C programming where the expression!(a ^ b) computes the logical equivalence for single bits or corresponding bit positions in integers. This approach is particularly valuable in microcontrollers or embedded systems for performing low-cost equality checks on binary data, as it leverages existing CPU instructions without dedicated hardware. Software emulation offers high flexibility for algorithmic adjustments and is cost-effective for non-time-critical applications, though it incurs higher latency than native hardware gates due to sequential execution.
Emerging photonic implementations achieve XNOR functionality using Mach-Zehnder interferometers (MZIs), where cascaded chiral MZIs enable all-optical logic with ultra-low power consumption by exploiting interference patterns in light signals.[55] Designs operate at speeds of 200 Gb/s using semiconductor optical amplifier-based MZI with delayed interferometer schemes.[56] In quantum computing, qubit-based XNOR equivalents are realized through reversible circuits, such as combining controlled-NOT (CNOT) gates with Pauli-X operations, allowing equality checks on superposed states via amplitude overlap measurements like the swap test.[57] This enables parallel evaluation of multiple input combinations in superposition, contrasting classical sequential processing.[58]
Hybrid approaches incorporate memristors for XNOR in neuromorphic systems, where memristor crossbars perform binary operations like XNOR-popcount for efficient AI inference, reducing the number of memristors by 50% compared to dual-crossbar designs, which helps alleviate power overhead in image recognition tasks.[59] These devices mimic synaptic weights with non-volatile conductance states, facilitating low-energy equality computations in spiking neural networks.[60]
Alternatives like PTL are preferred for high-speed, area-constrained hardware where reduced delay (up to 20% faster than CMOS at low voltages) outweighs potential signal degradation, while software emulation excels in flexible, low-volume scenarios with minimal upfront costs.[54] Photonic and quantum options suit emerging paradigms for ultra-high throughput or parallel superposition processing, though they require specialized fabrication; memristor hybrids optimize power in AI edge devices but face variability challenges in conductance tuning.[61] Quantum extensions, including superposition-based equality, remain underexplored beyond reversible gate decompositions in current literature.[57]