This will be a short post… but useful. You will learn how to build different logic gates with just one chip (or several… but the same kind).
Of course… I will not use just this chip in my project… but this will help you understand how to do it if you want.
In the previous posts I showed you how the NAND, NOT and AND gates works, and I promised to show you how to create the last two with just the first one.
Well, we are going to use a 7400 chip, in my case I usually use the 74LS00 chip, but it doesn’t matter for this example. The first 2 digits are the family (7400), the 2 letters are the subfamily (if none, they are the original ones), and the last digits are the actual component, in this case 00 is a quad 2-input NAND gate.
Yo already know the NAND symbol, you can see that there are 4 of them inside this chip. VCC is for positive voltage, and GND is for ground.
If we play a little with this pins, we can create the NOT and NAND Gates, as you can see in the following picture, in the bottom we connect the pins 1 and 2 (d3 and d4) which are the inputs of one of our NAND gates, and the 3rd pin (d4) which is our output, will become a NOT gate, our first INVERTER (line 5 at the bottom of our breadboard)
On top of that we are using 2 NAND gates, the inputs (lines 4 and 5 at the top) are not connected, but the output of this first NAND gate, pin 11 (g6), is connected to both inputs of the next one at pins 10 and 9 (g6 to h7 and h8) which we are using as an INVERTER too, and we know from our previous post that NAND + INVERTER = AND, which is our output at pin 8 of our chip (line 9 on top of our breadboard)
We can also use the output of the top NAND to the combined input of the first INVERTER too, but I wanted to show you both examples in the same breadboard :). These chips are less than 1USD a piece, we are not going to worry about using more NANDs than needed… at least for now.
We have more Logic Gates to learn…. OR, XOR, NOR and XNOR. Let’s see the tables for input and output for each one (and how to build it with NAND gates, just the diagram, I’ll let you play with the 7400 chip and figure it out).
Of course… there are 74?? chips with each one of this gates, we are just using the NAND as an exercise. But I promise… it will be easier in the future
|A||B||A OR B|
If ANY of the inputs are 1 (or both), the OUTPUT will be 1.
XOR Gate (Exclusive OR)
|A||B||A XOR B|
If A or B are 1 (but not both), the OUTPUT will be 1
|A||B||A NOR B|
ONLY when A and B are both 0 the OUTPUT will be 1
XNOR Gate (Exclusive NOR)
|A||B||A XNOR B|
When A and B are the same (0 or 1) the OUTPUT will be 1