Nepedia
Back to Discover
Fluent Reader
💻

XOR gate

technology Maturity 11-13 Next article →

The XOR gate is a very important part of digital logic.

XOR ANSI
XOR ANSI

Its name stands for "exclusive OR." You might also see it called EOR or EXOR. This gate helps computers make decisions by looking at inputs. It provides a "true" output, which is also called a HIGH signal or a 1. This only happens when the number of true inputs is odd.

XOR IEC
XOR IEC

If you have two inputs, the output is true only if one input is true. If both inputs are false, the output is false. If both inputs are true, the output is also false. You can think of it as a rule that says "one or the other, but not both."

This gate works by checking if inputs are different.

XOR DIN
XOR DIN

If the inputs are not alike, the output is true. This is why it is sometimes called an inequality function. You can also use an XOR gate as a programmable inverter. An inverter is a part that flips a signal from true to false. In this setup, one input acts like a switch. It decides whether to flip the other input or just let it pass through. This makes the XOR gate very flexible for different electronic tasks.

Engineers use many different ways to build these gates.

CmosXORGate
CmosXORGate

One common way is using CMOS, which stands for metal–oxide–semiconductor. This method uses transistors to connect power to the output. Another way uses transmission gates to make the gate smaller. A version using transmission gates only needs eight transistors. This is four fewer than the CMOS version. Some designs are even more optimized to use only six transistors. Engineers must be careful when connecting many gates together. This is because some parts can cause the signal to get weaker.

There are many ways to create an XOR gate if you do not have one.

XOR from NAND
XOR from NAND

You can build one using only NAND gates. NAND gates are called "universal gates" because they can build any other kind of gate. You can also build an XOR gate using only NOR gates. Another way is to use a mix of AND, OR, and NOT gates. Using a mix of different gates can sometimes take up more space. For example, one method uses five different gates. However, using only NAND gates might be simpler for some circuits.

We see XOR gates working in many places every day.

Half Adder
Half Adder

They are used in a part called a half adder. This part helps computers perform binary addition by adding bits together. XOR gates also help create pseudo-random numbers. This is done using a setup called a linear-feedback shift register. They are also great at finding patterns in long strings of data. In communications, they help extract specific signals from a crowded group of signals. You can even find them on standard chips, like the 7486 or the 4070.

DOV-1X - Philips HEF4070BP on printed circuit board-9802
DOV-1X - Philips HEF4070BP on printed circuit board-9802
473 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (16)
File:XOR ANSI.svg
XOR ANSI.svg
File:XOR IEC.svg
XOR IEC.svg
File:XOR DIN.svg
XOR DIN.svg
File:XOR gate implemented with pass gates.svg
XOR gate implemented with pass gates.svg
File:CmosXORGate.png
CmosXORGate.png
File:ANDNOR XOR Gate implementation.png
ANDNOR XOR Gate implementation.png
File:254px 3gate XOR.svg
254px 3gate XOR.svg
File:XOR ANSI Labelled.svg
XOR ANSI Labelled.svg
File:XOR from NAND.svg
XOR from NAND.svg
File:XOR from NOR 2.svg
XOR from NOR 2.svg
File:XOR from NAND 2.svg
XOR from NAND 2.svg
File:XOR from NOR.svg
XOR from NOR.svg

+ 4 more

More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.