Safekipedia

Logic gate

Explorer · ages 7 and underAdapted from Wikipedia
A diagram showing where each pin sits on the 7400 chip, a popular electronic component that contains four NAND logic gates. Two pins supply power (+5 volts) and ground, and the chip was made in 1976.

What is a logic gate?

A logic gate is a small device that works with Boolean functions. A Boolean function is a logical operation that uses 0s and 1s. A logic gate takes in some 0s and 1s and gives back one answer, which is also a 0 or a 1.

Most logic gates are made with tiny parts called MOSFETs. These are special transistors, which are like electronic switches. Each switch can be turned on or off, and that is how the gate makes its choice.

Gates in computers

Logic gates can be joined together in a chain, like a line of helpers passing along a message. Engineers use them to build things like registers, multiplexers, and computer memory. With enough gates, they can even build a whole microprocessor, which is the brain of a computer. Some microprocessors have more than 100 million logic gates!

There are seven basic logic gates. They have names like NOT, NAND, XOR, and XNOR. Each one follows its own simple rule for turning inputs into an output.

Long ago

People have been thinking about logic gates for a long time. In 1705, Gottfried Wilhelm Leibniz helped improve the binary number system, which uses only 0s and 1s. In 1837, Charles Babbage designed a machine called an analytical engine. It used gears to do logic.

Today, logic gates are found inside almost every computer. They help computers think and solve problems.

Quiz time!

3 questions about Logic gate

Question 1 of 3

What do logic gates work with?

Pictures

An animated diagram showing how an R-S flip-flop works. It is a simple electronic circuit that can remember one bit of information, either a 0 or a 1.
A logic circuit diagram for a 4-bit carry lookahead binary adder design using only the AND, OR, and XOR logic gates
A synchronous 4-bit up/down decade counter symbol (74LS192) in accordance with ANSI/IEEE Std 91-1984 and IEC Publication 60617-12 [missing "C3" at pin 11]
Diagram showing a way of making a logical inverter (NOT gate) from a NAND gate.
Diagram showing a way of making a NOT gate from NOR gates.
AND Gate constructed only from NAND Gates.
Construction of an AND gate using only NOR gates
A labelled MIL/ANSI symbol for an NAND gate. A and B are the inputs, Q is the output
A way of making a NAND gate using only NOR gates.
OR Gate constructed from a NAND Gates.
OR Gate constructed from NOR Gates
A way of building a NOR gate from only NAND gates.
A labelled MIL/ANSI symbol for an NOR gate. A and B are the inputs, Q is the output
A way of building an XOR gate from only NAND gates. This construction has a propagation delay 3 times that of a single gate and uses 4 gates.
An XOR gate made from only NOR gates, using the expression (A+B)+(A‾+B‾). This construction has a propagation delay 3 times that of a single gate and uses 5 gates.
A way of building an XNOR gate from only NAND gates, using the expression A⋅B+A‾⋅B‾. This construction has a propagation delay 3 times that of a single gate and uses 5 gates.
A way of building an XOR gate from only NOR gates. This construction has a propagation delay 3 times that of a single NOR gate and uses 4 gates.
​利用與非閘組成的蘊含閘
​利用或非閘組成的蘊含閘
CMOS diagram of a NOT gate, also known as an inverter. MOSFETs are the most common way to make logic gates.

Keep exploring

This article is a child-friendly adaptation of the Wikipedia article on Logic gate, available under CC BY-SA 4.0.

Images from Wikimedia Commons. Tap any image to view credits and license.