NAND Gates

NAND Gates Are Negated AND Gates: Both Inputs Must be Identical For The Output To Switch State

NAND gates have two inputs. To better understand what they do, first look at the underlying AND gate: when both inputs are high, then the result is high, else low. Here is the truth table for an AND gate:

A B A AND B
0 0 0
0 1 0
1 0 0
1 1 1

A NAND gate is an AND gate with an added NOT, inverting the result. So whenever an AND gate would be true, the NAND gate is false - and vice versa.

Here is the truth table for a NAND gate:

A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0

When both inputs are high, then the result is low, else high - the exact opposite of an AND gate.

Use Cases

A NAND gate is flexible and can be used for many different operations, depending on how you wire it.

For example, a NAND gate can invert a signal (flipping the state of a GPIO around) simply by connecting the signal to both inputs of the gate.

Key Aspects When Selecting NAND Gates

There are many different NAND chips available that differ in just a few aspects:

Property Note
Voltage make sure the component supports the voltage you need. Some components require a minimum voltage of 5V and cannot be used with 3.3V circuitry
Current If you want to directly drive electronic components off the component, i.e. a LED, make sure it can sink and/or source the required current. Typically, components can sink and source small currents of up to 10mA. Anything beyond requires additional transistors
Number of Gates Most chips come with a number of NAND gates. The popular CD4011 for example comes with four NAND gates
Trigger Simple NAND gates require clean logic levels to work properly which is not an issue in digital circuits. When input signals are not clean, may contain noise or may not always have clear and distinct high and low voltages, then built-in Schmitt Triggers (like in the CD4093) help: they use hysteresis and make sure than indistinct intermediate voltages may cause oscillations

Comments

Please do leave comments below. I am using utteran.ce, an open-source and ad-free light-weight commenting system.

Here is how your comments are stored

Whenever you leave a comment, a new github issue is created on your behalf.

  • All comments become trackable issues in the Github Issues section, and I (and you) can follow up on them.

  • There is no third-party provider, no disrupting ads, and everything remains transparent inside github.

Github Users Yes, Spammers No

To keep spammers out and comments attributable, all you do is log in using your (free) github account and grant utteranc.es the permission to submit issues on your behalf.

If you don’t have a github account yet, go get yourself one - it’s free and simple.

If for any reason you do not feel comfortable with letting the commenting system submit issues for you, then visit Github Issues directly, i.e. by clicking the red button Submit Issue at the bottom of each page, and submit your issue manually. You control everything.

Discussions

For chit-chat and quick questions, feel free to visit and participate in Discussions. They work much like classic forums or bulletin boards. Just keep in mind: your valued input isn’t equally well trackable there.

  Show on Github    Submit Issue

(content created Aug 28, 2024)