We can make all the gates using nand or nor gates. My teacher told us that nand gates are cheap too, then why do we need other gates at all?
2 Answers
They logically exist, you can not un-invent them. Even if no one ever made one, they would still exist in your mind.
If is easier to say “open door if I want to go through door or you want to go through door” than to say “open door if I don't want to go through door nand you don't want to go through door”
An alternate question — Why do we build devices with just one gate? i.e. nand
or nor
?
We do this because it makes the electronics simpler, if all the devices are the some, as we only have to implement one type of gate. This is about simplicity of the device, not of the logic (as this could be a bit more complex). This logical complexity could push the size up, but the symmetry of all gates being the same pushes the size down. Also a lot of the logical complexity can cancel out.
A similar question — Why do we have multiply in maths. When we can do everything with addition?
- Why do we have addition when we can just use increment: 3+4 = 3+1+1+1+1
- Why do we have multiplication when we can use addition: 3×4 = 3+3+3+3
- Why do we have exponentiation when we can use multiplication 3⁴ = 3×3×3×3
If you were to continue to look inside the computer, then you will see that it is,some what, like this:
- transistors →
nand
oror
nand
ornor
→ all logic gates- logic gates → addition
- logic gates → flip flops
- flip flops → shift registers → multiply by 2
- multiply by 2 & addition → multiplication
- …
Why do we have steel, when you can just have iron, carbon, cobalt … ?

- 138
- 10
-
1I don't see how this answers the question. For example, the three-input gate that implements the function $((x\rightarrow y) \land z) \lor (x\land \neg y)$ "exists in my mind" but nobody ever talks about it. Whereas the gate implementing the function $x\lor y$ exists in my mind but people do talk about it. – David Richerby Sep 20 '17 at 17:40
Representing the logic is just cheaper on a physical chip. AND / OR gates take more components to build. Using a few NAND gates does the same job, in a smaller, cheaper footprint electronically.
Check this out: https://electronics.stackexchange.com/questions/20850/why-are-nand-gates-cheap
-
I'd also add that it is "cheaper" on a flow chart to use AND/OR since it uses less space and graphically it's easier to evaluate. NAND gates can be used at production time – Rip My Logic To shreds Sep 20 '17 at 18:50
-
Hm, from what I learned on electronics, NAND contains AND part (one field effect transistor) and inverter and thus I don't understand how it is cheaper. Almost surely, though, it's just because inverter is essential to increase the quality. – rus9384 Sep 21 '17 at 07:50
and
oror
. And the circuits is circuits bit, while correct (when viewed from the right direction), is confusing. – ctrl-alt-delor Sep 22 '17 at 18:35butand the inverting form is better behaved. – ctrl-alt-delor Sep 23 '17 at 10:18