0
$\begingroup$

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?

$\endgroup$
  • $\begingroup$ What makes you think that anything other than NAND gates are used during fabrication? $\endgroup$ – Derek Elkins Sep 21 '17 at 0:31
  • $\begingroup$ Related question: cs.stackexchange.com/questions/63687/… $\endgroup$ – Pseudonym Sep 21 '17 at 8:07
  • $\begingroup$ Long story, but the short version is that so-called "digital circuits" are really analogue circuits when you actually try to build them. Inverting gates are better-behaved than non-inverting gates when you realise them in CMOS. $\endgroup$ – Pseudonym Sep 21 '17 at 8:16
  • $\begingroup$ @Pseudonym whhhat. To see why we use inverting gates, try to make any other gate from an and or or. And the circuits is circuits bit, while correct (when viewed from the right direction), is confusing. $\endgroup$ – ctrl-alt-delor Sep 22 '17 at 18:35
  • $\begingroup$ @ctrl-alt-delor I'm well aware that inverting gates are functionally complete. In practice, real (combinational) circuits are built from NAND, NOR, and NOT gates, not because we can't build non-inverting CMOS gates (we totally can), but because non-inverting gates are not as well-behaved when understood as analogue circuits. $\endgroup$ – Pseudonym Sep 23 '17 at 8:44
1
$\begingroup$

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 or or
  • nand or nor → 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 … ?

$\endgroup$
  • 1
    $\begingroup$ I 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. $\endgroup$ – David Richerby Sep 20 '17 at 17:40
0
$\begingroup$

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

$\endgroup$
  • $\begingroup$ 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 $\endgroup$ – Rip My Logic To shreds Sep 20 '17 at 18:50
  • $\begingroup$ 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. $\endgroup$ – rus9384 Sep 21 '17 at 7:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.