-1
\$\begingroup\$

i am a novice to electronics,actually i am java and android developer who doesn't know the very basic concepts of computing and trying to learn from ground level. i was checking out a video which explains about logical gates very well but i did not understand on thing in this pic:

enter image description here

the xor gate has NAND gate and OR gates with output connecting to AND gate so if both switches are on out put of right bulb will be off. my question is if instead of XOR gate we put just NAND gate isn't it gonna be same thing? because all we want is output off if both switches are on.

\$\endgroup\$
  • 1
    \$\begingroup\$ XOR gate's truth table and NAND truth table aren't same. What if both inputs are zero? Its supposed to be 0 but NAND gives different. \$\endgroup\$ – Umar Mar 20 '17 at 12:04
  • \$\begingroup\$ hi thanx,thank you,but how nand gate gives output 1 while its inputs are off? \$\endgroup\$ – Nav Sandhu Mar 20 '17 at 12:12
  • 1
    \$\begingroup\$ A NAND gate gives output 1 if either input is off, which includes the case of both inputs being off. \$\endgroup\$ – Dave Tweed Mar 20 '17 at 12:31
  • 1
    \$\begingroup\$ You may be missing the idea that gates have their own power supply, not always shown on diagrams. \$\endgroup\$ – pjc50 Mar 20 '17 at 13:28
2
\$\begingroup\$

my question is if instead of XOR gate we put just NAND gate isn't it gonna be same thing? because all we want is output off if both switches are on.

Nope. In binary,

0 + 0 =  00
0 + 1 =  01
1 + 0 =  01
1 + 1 =  10

As you can see, a NAND gate would give incorrect results (the first line would have 0+0=01 instead of 00).

\$\endgroup\$
  • \$\begingroup\$ thank you,but how nand gate gives output 1 while its inputs are off? \$\endgroup\$ – Nav Sandhu Mar 20 '17 at 12:02
  • \$\begingroup\$ Well, check out the truth table of NAND gate ;) en.wikipedia.org/wiki/NAND_gate \$\endgroup\$ – peufeu Mar 20 '17 at 12:42
  • \$\begingroup\$ @NavSandhu gates don't exist in isolation, they have separate supply and ground lines that aren't shown in logic diagrams. \$\endgroup\$ – ratchet freak Mar 20 '17 at 14:20
0
\$\begingroup\$

These are all examples of XOR Boolean logic.

Either input high, otherwise low = EXCLUSIVE OR

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

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.