Logic gate facts for kids
A logic gate is a tiny electronic part that helps control how electricity flows in a circuit. Think of it like a switch that follows a special rule. It takes one or more "inputs" (like signals from wires or other gates) and gives out one "output" based on its rule.
These gates are "digital" because they usually work with only two states: On or Off. When a gate is On, it means there's a positive voltage (like 3.5 to 5 volts) flowing through it. When it's Off, there's no voltage, or it's at zero. Logic gates check their inputs and then decide if their output should be On or Off.
Logic gates are like the building blocks of computers and other electronic devices. They are based on something called Boolean algebra, which is a type of math that uses true/false or on/off ideas. A "truth table" is a simple chart that shows you exactly what a logic gate's output will be for every possible combination of inputs.
Contents
How Does an AND Gate Work?
An AND gate is a type of logic gate that usually has two inputs. Its output will only be On if both of its inputs are On. If even one of the inputs is Off, then the output will be Off.
Imagine the picture on the right. If input A is On AND input B is On, then the output will be On. But if A is Off (or B is Off, or both are Off), the output will be Off. Both inputs must be On for the output to be On.
Input A | Input B | Output |
---|---|---|
Off | Off | Off |
On | Off | Off |
Off | On | Off |
On | On | On |
How Does an OR Gate Work?
An OR gate also usually has two inputs. Its output will be On if at least one of its inputs is On. The only time its output will be Off is if both inputs are Off.
Looking at the image, if input A is On OR input B is On, then the output will be On. If both A and B are Off, then the output will be Off.
Input A | Input B | Output |
---|---|---|
Off | Off | Off |
On | Off | On |
Off | On | On |
On | On | On |
How Does a NOT Gate Work?
The NOT logic gate is special because it only has one input. Its job is to simply reverse the signal. If the input is On, the output will be Off. If the input is Off, the output will be On.
Because it flips the signal, a NOT gate is sometimes called an "inverter".
Input | Output |
---|---|
Off | On |
On | Off |
How Does an XOR Gate Work?
XOR gates have two inputs. The output of an XOR gate will be On only if the two inputs are different from each other. If both inputs are the same (both On or both Off), the output will be Off.
Input A | Input B | Output |
---|---|---|
On | On | Off |
On | Off | On |
Off | On | On |
Off | Off | Off |
Images for kids
See also
In Spanish: Puerta lógica para niños