Electronic – TTL 7400 NAND gate circuit not functioning

nandttl

I recently made a circuit using the ttl 7400 NAND gate IC. The concept is simple. There are two 4 bit inputs going into the 7400 IC. The 7400 IC does a 4 bit NAND operation on these bits, and outputs them. The outputs are used to drive 4 LED's(each LED represents one bit). I made the circuit and it does nothing. The LED's are all off when all input bits are LOW. If I change the input bits nothing happens. Here is a chart to sumarize the behavior of the circuit I built:

enter image description here

As you can see, no matter what the input the outputs is always 0000.

Here is a diagram of the circuit:

enter image description here

Here is the data sheet of the 7400 IC(I'm not sure who manufactured the chip but it says 7400N on it): http://www.ti.com.cn/cn/lit/ds/symlink/sn74ls00.pdf

(The top left diagram on the data sheets first page is the 7400's pinout diagram)

Best Answer

The LED's are all off when all input bits are LOW

No, your input bits are never low. When a switch is ON it connects +5V to an input. When the switch is OFF it connects nothing, and the input is 'floating'. Floating is not LOW. In TTL logic, LOW is a voltage between 0V and 0.8V (see datasheet page 4, "VIL Low-level input voltage").

Perhaps you thought that with nothing connected the input would naturally go down to 0V. But it won't, because the input circuit of a TTL NAND gate looks like this (datasheet page 3):-

enter image description here

I added a red line to show how voltage gets from Vcc to the input pin. With nothing connected the input will float at about 1.8V. To make the input LOW you must sink the Input Low current (IIL, datasheet page 4) by pulling the input below 0.8V.

There are two ways to pull an input LOW with a switch. One way is to connect a pull down resistor from the input to ground. Since IIL can be up to 1.6mA, and the voltage across the resistor needs to be less than 0.8V, the resistance value must be less than 0.8V/1.6mA = 500Ω. This method has the disadvantage that when the switch is ON it puts 5V across the resistor, which wastes current.

The other way is to connect the switch to Ground rather than +5V, then switch ON = LOW. Since TLL inputs float high you may get away with just doing this, but to produce a properly defined HIGH (>=2.4V) you should add a pull up resistor to Vcc. Input High current (IIH) is only 40uA, so a large value resistor will do, eg. 10KΩ. There is still some wasted current, but much less than with a pull down resistor.