SN7404N: a beginner's guide to the TTL hex inverter

An inverter is the simplest logic building block: it flips a signal over. The SN7404N packs six of them into one 14-pin DIP and is classic standard TTL from the 7400 series. This guide explains what TTL levels mean in practice, how to connect a button and an LED the right way, and what happens between pressing the button and seeing the light.

The basics: a NOT gate

Digital logic works with two states: low (L, close to 0 V) and high (H, close to the supply). An inverter – also called a NOT gate – has one input A and one output Y, and the output is always the opposite of the input: A = L gives Y = H, and A = H gives Y = L. That is the datasheet's whole function table.

It sounds trivial, but inverters are used everywhere: to turn an active-low signal into an active-high one (or the reverse), to buffer a weak signal so it can drive several inputs, and to build simple delays and oscillators. The six inverters in the SN7404N are completely independent; they share only power and ground.

The SN7404N is standard TTL (transistor-transistor logic). It runs on 5 V only, draws more current than modern CMOS, and its inputs and outputs are asymmetric: an output can pull a lot of current towards ground but can supply only a little when it is high. That directly affects how you wire buttons and LEDs.

The SN7404N pins

The chip comes in a 14-pin plastic DIP (TI's N package) with 2.54 mm pin pitch. Seen from above with the notch pointing away from you, pin 1 is at the top left and the pins are numbered anticlockwise:

  • Pin 14 = VCC (+5 V) and pin 7 = GND, diagonally opposite each other as on most 14-pin 74xx chips.
  • Inverters 1–3 on the left side: 1A/1Y on pins 1/2, 2A/2Y on pins 3/4, 3A/3Y on pins 5/6 – the input always comes first.
  • Inverters 4–6 on the right side: 4Y/4A on pins 8/9, 5Y/5A on pins 10/11, 6Y/6A on pins 12/13 – here the output comes first as you count upwards.
  • The gates are numbered 1 to 6; there is no inverter 0.
Top-view pinout of the SN7404N in PDIP-14: pin 1 1A, 2 1Y, 3 2A, 4 2Y, 5 3A, 6 3Y, 7 GND, 8 4Y, 9 4A, 10 5Y, 11 5A, 12 6Y, 13 6A, 14 VCC.
SN7404N seen from above. The notch and dot mark the pin-1 end.

TTL levels: what counts as high and low

A TTL input distinguishes only two ranges. The datasheet guarantees that anything above 2.0 V (VIH) reads as high and anything below 0.8 V (VIL) as low. Voltages between 0.8 and 2.0 V are undefined: the output may sit anywhere, and a slow signal crossing this range can make the output oscillate.

In return, the output promises at least 2.4 V when high (with a 0.4 mA load) and at most 0.4 V when low (even while sinking 16 mA). The gap between what an output guarantees and what an input requires is the noise margin: 0.4 V in each direction. That is the room noise and voltage drop in the wiring can use up before a signal is misread.

The currents matter just as much. A low TTL input itself pushes up to 1.6 mA out of the pin, while a high input draws at most 40 µA. An output can sink 16 mA towards ground but may only source 0.4 mA when high. One output can therefore drive ten standard TTL inputs (16 mA ÷ 1.6 mA), but it is a poor choice for supplying current to an LED.

Diagram of TTL levels: the input reads 2.0–5 V as high, 0–0.8 V as low and 0.8–2.0 V as undefined; the output guarantees at least 2.4 V high and at most 0.4 V low, giving a 0.4 V noise margin in each direction.
The guaranteed SN7404 levels from the datasheet. The gap between the output and input limits is the noise margin.

Example: a button lights an LED through two inverters

The example uses two of the six inverters: a button should light an LED. The asymmetry described above decides the layout.

The button goes to ground, with a pull-up resistor. With the button released, 4.7 kΩ holds input 1A high; the input current of at most 40 µA drops only about 0.2 V, so the input sits close to 5 V. When the button is pressed, 1A goes to 0 V and the input's 1.6 mA simply flows through the button to ground. The reverse – button to +5 V and a resistor to ground – works badly: the resistor would have to hold the input below 0.8 V while carrying 1.6 mA, which requires 500 Ω or less.

The LED sits between +5 V and the output. When output 2Y is low, it sinks the current through the LED and 330 Ω to ground. With about 2 V across a red LED and at most 0.4 V across the output, the current is around 8 mA – well below the 16 mA limit. The second inverter is needed because the first one gives a high output when the button is pressed; the second flips it back to low so the LED lights while the button is held.

The four unused inputs (3A, 4A, 5A and 6A) are tied to ground and the unused outputs are left unconnected. A 100 nF capacitor goes directly between pin 14 and pin 7.

Schematic: +5 V through 4.7 kΩ to pin 1 (1A) and a button to ground; pin 2 (1Y) to pin 3 (2A); pin 4 (2Y) to the cathode of an LED whose anode goes through 330 Ω to +5 V. Unused inputs 3A, 4A, 5A and 6A to ground and 100 nF between pins 14 and 7.
Teaching example: pressing the button drives 2Y low, sinking about 8 mA through the LED.

One button press from start to finish

  1. Connect pin 14 to +5 V (4.75–5.25 V) and pin 7 to ground, with 100 nF close to the chip. Build the circuit as shown in the figure.
  2. Button released: 1A sits close to 5 V, safely above 2.0 V. 1Y is therefore low (at most 0.4 V), and that low level on 2A makes 2Y high. There is almost no voltage across the LED and resistor, so the LED is off.
  3. Press the button. 1A drops to 0 V – below the 0.8 V limit – and 1Y switches high. According to the datasheet this takes 12 ns typical and 22 ns maximum (tPLH, measured at 5 V and 25 °C with the datasheet's test load).
  4. 1Y is now above 2.4 V, so 2A is seen as high and 2Y switches low: 8 ns typical, 15 ns maximum (tPHL). From the button press until 2Y is low therefore takes about 20 ns typical and about 37 ns at most.
  5. 2Y is now at most 0.4 V, and about 8 mA flows from +5 V through 330 Ω and the LED into pin 4 and on to ground. The LED lights.
  6. Release the button. The pull-up pulls 1A high again, 1Y goes low, 2Y goes high and the LED current stops. The button contacts bounce for a few milliseconds; your eye will not see it, but if 2Y were counting presses, one press could become many.

Limits and practical notes

  • 5 V only. The SN7404 is specified for 4.75–5.25 V and 0–70 °C. The absolute maximum is 7 V supply and 5.5 V on the inputs.
  • Never leave inputs floating. The datasheet requires unused inputs to be held at VCC or GND. An open TTL input often behaves as high, but it picks up noise.
  • The output is good at sinking, not sourcing. Drive LEDs and relay coils active-low (from +5 V into the output); a high output may only be loaded with 0.4 mA. Use a transistor or a driver chip for larger currents.
  • Not a Schmitt trigger. Slow or noisy signals – from an RC delay or a long wire, for example – can make the output oscillate in the undefined range. Use a Schmitt-trigger input for those.
  • Mixing with CMOS. A 74HC input at 5 V typically needs about 70 % of VCC to see a high, which is more than the guaranteed 2.4 V from a TTL output. Use an HCT part, which accepts TTL levels, when TTL has to drive CMOS.
  • Power consumption. The whole chip draws up to 12 mA with all outputs high and up to 33 mA with all outputs low. Short-circuit no more than one output at a time.
  • Vintage NOS. These parts are new old stock. Test a chip in your own circuit before building it into anything important.

Related guides

If you need to drive a bus or many inputs at once, see the 74HCT541 bus buffer guide; HCT chips also accept TTL levels. For buttons and slow signals, the MC14093B Schmitt-trigger guide is the natural next step. Lifting a 3.3 V logic output to 5 V is covered in the SN74AHCT08 guide, and the 74HC08 guide shows how AND gates combine signals.

Source

Pinout, package, function table, operating conditions, DC values and delays: Texas Instruments, SN5404, SN54LS04, SN54S04, SN7404, SN74LS04, SN74S04 Hex Inverters, SDLS029C (December 1983, revised January 2004). The example is a teaching circuit, not a tested product design.

See the SN7404N product · Texas Instruments SN7404 datasheet (PDF)