jodo

Logic Gates And How They Work

I was first introduced to logic gates when I was around 14 years old. I had heard that computers consisted of ones and zeroes. But I didn’t understand what that really meant.





So I asked my father to explain it. And I loved because it was so simple and easy to understand. Read that article first if you’re not sure what a 1 and a 0 is yet.





Logic gates are components that we use for “doing stuff” with the 1s and 0s. You can combine them to create building blocks like flip-flops, adders, and more. Which you can use to build calculators, Arduinos, and even smartphones and computers!





Below, you’ll find an overview of the logic gates, their logic gate symbols, and how they work.





NOT gate/Inverter





The simplest logic gate of all is the NOT gate. It takes one bit as input (A). And it gives as an output (Y) what is NOT on the input. So if there is a 1 on the input, its output is 0. And if there is 0 on the input, its output is 1. It’s also called an inverter.





If you want to use a NOT gate in your circuit, you can for example use the or .





Logic gate symbol for NOT gate




Input (A)Output (Y)
01
10
NOT Gate Truth Table






AND gate





The AND gate takes two (or more) inputs and gives out a 1 if all the inputs are 1. Otherwise, it gives out a 0.





If you want to use it in a circuit, the contains 4 AND gates.





The truth table is below, but all you really need to remember is that the AND gate needs a 1 on input A and input B to give out 1.





Logic gate symbol for AND gate




Input AInput BOutput Y
000
010
100
111
AND Gate Truth Table






OR gate





The OR gate takes two (or more) inputs and gives out a 1 if any of the inputs are 1. Otherwise, it gives out a 0.





If you want to use it in a circuit, the contains 4 OR gates.





The truth table is below, but all you really need to remember is that the OR gate needs a 1 on input A or input B to give out 1.





Logic gate symbol for OR gate




Input AInput BOutput Y
000
011
101
111
OR Gate Truth Table






NAND gate





The NAND (or NOT AND) gate operates in the opposite way of the AND gate. It’s like if an AND gate had a NOT gate on its output:





A NAND gate made from logic gates AND + NOT




If you want to use NAND gates in a circuit, the contains 4 NAND gates.





You’ll find the truth table below. But all you need to remember is that the only time the output of a NAND gate is 0 is when both the inputs are 1.





Logic gate symbol for NAND gate




Input AInput BOutput Y
001
011
101
110
NAND Gate Truth Table






NOR gate





The NOR (or NOT OR) gate operates in the opposite way of the OR gate. It’s like if an OR gate had a NOT gate on its output.





A NOR gate made from logic gates OR + NOT




If you want to use NOR gates in a circuit, the contains 4 NOR gates.





You’ll find the truth table below. But all you need to remember is that the only time the output of a NOR gate is 1 is when both the inputs are 0.





Logic gate symbol for NOR gate




Input AInput BOutput Y
001
010
100
110
NOR Gate Truth Table






XOR gate





Logic gate symbol for XOR gate




The XOR (or Exclusive OR) gate outputs 1 if its two inputs are not equal. You’ll find four XOR gates in the .





Input AInput BOutput Y
000
011
101
110
XOR Gate Truth Table






XNOR gate





Logic gate symbol for XNOR gate




The XNOR (or Exclusive NOT OR) gate outputs 1 if its two inputs are equal. It basically works like an XOR gate with an inverter on the output. You’ll find four XNOR gates in the .





Input AInput BOutput Y
001
010
100
111
XNOR Gate Truth Table






Using Logic Gates in Circuits





A logic gate can be built with transistors and usually comes as an Integrated Circuit (IC).









There are two classic IC series that contain a lot of the same functions; the 7400-series and the 4000-series.





The 7400-series is the oldest series. The 4000-series was introduced as a lower-power and more versatile option to the 7400. But today, several families of the 7400-series exist, some with similar properties as the 4000-series.











Copyright

[fixed][/fixed]
[poll] {poll} [/poll]
4j