Makestation
[Informational] The 7 basic logic gates (repost) - Printable Version

+- Makestation (https://makestation.net)
+-- Forum: Technical Arts (https://makestation.net/forumdisplay.php?fid=45)
+--- Forum: Technology & Hardware (https://makestation.net/forumdisplay.php?fid=29)
+---- Forum: Resources & Tutorials (https://makestation.net/forumdisplay.php?fid=132)
+---- Thread: [Informational] The 7 basic logic gates (repost) (/showthread.php?tid=3641)



[Informational] The 7 basic logic gates (repost) - SpookyZalost - July 15th, 2021

So some of you might have heard of logic gates, usually regarding transistors and the like.  Well they're actually pretty simple, I'm going to attach a nice diagram that shows the symbol and what they do but I'm also going to explain in detail about them.

[Image: gPTJDYk.png]

1 = has power, 0 = does not have power, logic gates are by nature, binary on/off state switches that use their inputs to determine the output.

AND
And gates... basically if A and B = 1 (has power), then X=1, if either or both = 0 then X = 0
A B X
0 0 0
1 0 0
0 1 0
1 1 1

OR
if A or B is = 1, then X = 1, if both are = to 1 or 0 then x = 0.
a b x
0 0 0
0 1 1
1 0 1
1 1 1

NAND
Not - And gate, it's a bit more complicated, basically x= 1 if not all the inputs are 1, so if a b and C = 1, then x = 0, but if a and b = 1 and c = 0, then x =1.
a b x
0 0 1
0 1 1
1 0 1
1 1 0

NOR
Not - Or Gate, opposite of Or gate, x= 1 if a and b = 0, if either or both = 1 then output is 0
a b x
0 0 1
1 0 0
0 1 0
1 1 0

XOR
ex-or gate, x=1 only if both a and b = 0
This one would be good if you have a video switch and want to prevent cross signal contamination by basically preventing output from 2 if 1 is active and vice versa.
a b x
0 0 0
0 1 1
1 0 1
1 1 0

XNOR
Ex-Nor gate, x=1 when either both inputs are 1 or 1, x= 0 when one input = 0 and another =1
a b x
1 1 1
1 0 0
0 1 0
0 0 1

NOT
NOT gate, also known as an inverter gate, inputs are inverted so if a=1 then x =0, if a = 0, then x=1
a x
1 0
0 1

you could replace the Xor gate with a Xnor and a Not gate to invert the state and make x=1 only if the input to the Not gate is 0.  It's Generally easier to use an Xor gate though.