This is educational tutorial on how to build digital logic gates with transistors. Digital logic gates AND, OR, NOT, NOR, NAND and XOR are illustrated with 2N3904 and resistors. LEDs are used to indicate the logical HIGH and LOW signals.
AND gate with transistors
The truth table of an AND gate is below.
The following shows the circuit diagram of making AND gate using two 2N3904 transistors.When A=0 and B=0, then output C=0
When A=0 and B=1, then output C=0
When A=0 and B=1, then output C=0
When A=1 and B=1, then output C=1OR gate with transistors
The truth table of an OR gate is below.
The following shows the circuit diagram of making OR gate using two 2N3904 transistors.When A=0 and B=0, then output C=0
When A=0 and B=1, then output C=1When A=1 and B=0, then output C=1
When A=1 and B=1, then output C=1
NAND gate with transistors
The following shows the circuit diagram of making NAND universal gate using two 2N3904 transistors.
When A=0 and B=0, then output C=1
When A=0 and B=1, then output C=1
When A=1 and B=0, then output C=1 When A=1 and B=1, then output C=0NOR gate with transistors
The truth table for NOR gate is as follows.
The following shows the circuit diagram of making NOR universal gate using two 2N3904 transistors.
When A=0 and B=0, then output C=1
When A=0 and B=1, then output C=0
When A=1 and B=0, then output C=0
When A=1 and B=1, then output C=0
The following shows the circuit diagram of implementing NOR universal gate using simple 2N3904 transistors.
When A=0 and B=0, then output C=1
When A=0 and B=1, then output C=0
When A=1 and B=0, then output C=0
When A=1 and B=1, then output C=0
Note gate with transistor
The next circuit below shows how to implement NOT gate with a single 2n3904 transistor.
As shown when the input A=1 then then the output C=0 and vice versa so this circuit is NOT gate.
Watch the following video which demonstrates how to build logic gates with transistors.
So in this educational tutorial it was illustrated how to build various logic gates using 2N3904 general purpose transistor. Similar transistor like 2N2222 and BC547 can also be used. We can also implement the different logic gates using diodes which is illustrated in the tutorial How to make logic gates with diodes?. For universal gate implementation see the tutorials 74S02 two input NOR gate and 74ALS00AN NAND gate which shows how one can build and test a NOR gate and a NAND on breadboard respectively.