In my digital electronics labs and lectures we are told to try and make things from NAND gates, because they are the cheapest kind of gate available to buy. Why is this? Why isn't an OR/AND gate the cheapest to buy?
|
|
NAND gates are cheap because there are so many of them lying around from the 1980s. Seriously though, a NAND gate is about the simplest logic gate. You can think of it as a multi-input inverter. Electrically, that's exactly what TTL NAND gates are. Each input is just another emitter added to the input transistor. The rest of the circuit is just a inverter. It's different in CMOS, but a NAND gate is still very simple. Since the chips require few transistors, they can be small, which allows lots of them per silicon wafer, which makes them cheap. |
|||||||
|
|
Any logical function can be built from NAND (or NOR) gates, even complete systems. OR and AND gates cost about the same as NANDs, but you need inverters as well. 1,000 NAND gates will be cheaper than a mixture of ORs, ANDs and inverters. Seymour Cray used to build his Cray super-computers from ECL NOR gates for that reason. |
||||
|
|
|
A few points not yet mentioned:
Any logic design which doesn't desire three-state logic or optimal speed can be implemented entirely with NAND gates. That isn't to suggest that NAND gates are always the most practical way of implementing things. An exclusive-or gate, for example, would take four two-input NAND gates to build, representing a total of sixteen transistors in CMOS. If one builds a CMOS exclusive-OR gate directly out of transistors, however, the job may be done with eight. |
|||
|
|
|
One of the reasons this may be said is that in CMOS circuits, a NAND gate is both smaller, area-wise, and faster than a NOR gate, whereas AND and OR gates require an explicit inverter circuit which is comparable in size to NAND/NOR. So in CMOS, NAND is a tiny bit cheaper. This is not true of nMOS (it's the other way round there), and most certainly doesn't apply to packaged gates like the 74x series - the area cost is completely eclipsed by the cost of packaging and other overheads. Reference: VLSI Design by Peter Robinson, p.14, "In CMOS, the NAND gate has better speed and area characteristics than the NOR gate". Reference 2: here, paraphrased: "In CMOS, the NOR gate has two pMOS in series making it slower due to the poor mobility of the holes." |
|||||||||||
|
|
I seem to remember there is a natural inversion. So an AND gate would need an extra inverter but the NAND does not. Or I could be wrong... |
|||
|
|
As well as being simple, NAND gates can be used in the place of all other gates, therefore, when companies buy in bulk, they buy only NAND gates because they can be used for everything. This saves them storage space and cheaper in bulk. Therefore, producers follow trend - more demand allows them to decrease price to increase future profits. |
|||||
|
