Getting Started With Digital Logic - Logic Gates
Thursday, 17 October 2019
Article Index
Getting Started With Digital Logic - Logic Gates
SmartSim
Logic in hardware
LEDS

## The real thing

A simulation is a slight simplification - no real voltages, no need to provide power to a chip, and you have switches that just work. If you wanted to build this circuit for real there are some additional complications but not many.

The first thing you have to come to terms with is the way the NAND gates are packaged inside a real 7400: The way the four NAND gates are connected inside a 14-pin DIL package.

There are many different types of packaging for an integrated circuit but they often follow the same pin-out configuration. In this case the packing is assumed to be an old fashioned DIL (Dual In Line) package which is still available and still very useful if you want to build a circuit using a prototyping board or a simple printed circuit board.

A prototyping board is a very simple idea consisting of connections that you can plug a wire into or a complete integrated circuit. They are usually arranged so that the central block of rows is connected horizontally and a number of columns are connected together to supply power and earth to the circuits. Using a prototyping board you can build circuits without needing to solder.

To build our simple demonstration circuit we need to solve two small problems. The first is we need to connect an LED to the output of one of the gates. Given that there are four identical gates inside a 7400, we might as well use the one connected to pins 1, 2 and 3.

Unlike the simulator we have to wire up the LED so that it is connected to the output of the logic gate and ground and we have to wire the LED the correct way round - this is why simulation is so much easier. The simulator suggests that we need to wire the LED up as follows: Note that the triangle of lines at the bottom of the diagram is the usual symbol for ground, earth or zero volts.

And as long was we got the LED the correct way round this would work - for a while. The problem is that there is nothing limiting the current that the LED would take from the gate. This might make it look very bright but it would ensure a short like for both the LED and the gate.

The solution is to put a current limiting resistor into the circuit.

Resistors simply resist the flow of current and they are often used in the same way to limit the current flow. Resistors are measured in ohms and working out the correct size for a resistor is just a matter of knowing Ohms law V=IR and knowning how much current the gate can supply and how much the LED needs. To go into Ohms law and calculating the size of the resistor needed would, for the moment, take us too far off topic and too far into pure electronics and physics.

The good news is that, in practice, you can usually find the correct size of resistor needed by looking at other people's circuits. In this case for a typical red LED we need around 330 ohms: Last Updated ( Thursday, 17 October 2019 )