Logic Gates, Explained

Logic Gates, Explained

By Writ10 | Informed Nonparticulars | 17 Aug 2021


Logic Gates are almost the most fundamental parts of computers (with the most fundamental being the transistors they are made out of... I guess you could go all the way down to atoms and quarks and stuff too... but, y'know... don't do me like that...) They're used to perform boolean logic calculations using bits.

There are 7 primary logic gates: AND, OR, NOT, NAND, NOR, XOR, and XNOR and what they do can be illustrated by what are called truth tables. Let's go through each one, note that each gate (except for the NOT gate) can have more than 2 inputs:

AND:

The AND gate is fairly self-explanatory. If input A AND input B are both "1" (or "true") (or if all inputs are "1") then the output is "1." Otherwise, the output is "0" (or "false.")

ac3a0a468bbe3d44cf73343e9e63a4a88948c557ffdad1e27adbeb4630efc8c3.jpg

 

OR:

Similarly OR gate is also self-explanatory. If either input A  OR input B are "1" then the output is "1." The output can ONLY be "0" if BOTH (or all) inputs are "0".

d8de83e1a8aff3f58bc837776be75da410aab9ab63ff4d24486843cac644498d.jpg

 

NOT:

The NOT gate is also known as an inverter because it, unsurprisingly, inverts bits.7067546ebee5b14d9b4c51537dc5822e8078d8817bf025f323857ecd3e8dbf1f.jpg

 

NAND:

A NAND gate is functionally an AND gate with an inverter added onto it. The reason it exists, however, is that a NAND has 2 qualities:

1. By itself, it is a universal gate, meaning it can be used to implement all other gates and logical functions.

2. One NAND gate is actually cheaper and simpler to make and design than one AND gate.

96457d23a8b38d480aae6e4a4158f185f8b416685df280abaf31bbd3fd16ab68.jpg

 

NOR:

A NOR gate is basically to the OR gate what the NAND gate is the the AND gate, and has the same 2 qualities:

1. It is a universal gate.

2. A NOR gate is simpler and cheaper than an OR gate.

ecc5445b023983aacc401926f4fb7e1176aa86df4bb987604b9cd7294d743119.jpg

 

XOR:

An XOR gate (sometimes it's labeled "EOR" or "EXOR"), also known as an "Exclusive OR" gate, it a little bit tricky. It works like an OR gate, but there's a twist: if BOTH of the inputs are "1," the output is "0." If both of the inputs are "1" or both are "0" the output will be "0" or "false."

f4d785015abb3a7807f0bb04afa47e7302f3497ce275318dda4d637c9007680e.jpg

 
XNOR:

And the XNOR, or "Exclusive NOR" gate is to the NOR gate what XOR is to the OR gate.

e45efa18b280ad1269040a4b81be6eb818270509cbc9c10e8fcf649bea01ea6f.jpg

This may all seem simple (and it is) but it's useful to know about and be used to it if you want to understand the technical side of crypto. Because if you are reading through anything sufficiently technical, it'll be assumed that you know all this.

How do you rate this article?

4



Informed Nonparticulars
Informed Nonparticulars

An attempt at informed writings on a litany of topics including, but not limited to: things, stuff, and crypto.

Publish0x

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.