Getting Started With Digital Logic - Logic Gates

### New Book Reviews!

 Getting Started With Digital Logic - Logic Gates
Article Index
Getting Started With Digital Logic - Logic Gates
Logic in hardware

## 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:

The final problem is which way round does the LED go?

The usual answer is that if you look at the case of an LED it has a flat side. This marks the negative terminal i.e. the one that has to be connected to ground or zero volts.

Almost done but we now need to work out how to connect the switches. Each switch has to connect the input of the gate to either +5V or to 0V and this is just a matter of a two position or two way switch. Simple and again it would work for a while. The problem is once again limiting the current. We need to put a resistor into the connection to the +5V to limit the current and again the calculation is simple as long as you know the characteristics of the gate. In practice lots of other people have worked this out before so you simply look at another circuit and see that has been used. In this case we need a 470 ohm resistor as shown:

You can see now that with the switch in the up position the input is connected to +5V and with it in the down position the input is connected to 0V. Of course you also need a switch for the other input but this is identical.

It is also worth saying that there is an easier way to wire up the input switch but for the moment lets stay with the direct approach.

So how does this translate to the prototype board?

Assuming that you have a +5V power supply and the components - 2 resistors, one 7400 and one Red LED it is fairly easy.

You also need to know that resistors are identified by a color code - the first three colors give the value. You can look this up on Wikipedia but a 330 ohm resistor is Orange, Orange, Brown and a 470 is Yellow, Violet, Brown.

The finished circuit can be seen below. Notice that the LED is has to be the correct way round and the 7400 has to be connected to power - pin 17 at +5V and ground pin 7 at 0V.

Click to enlarge

If you do make this circuit, then you will find that the LED goes on and off according to the switch positions, just as in the simulator.

I hope now you believe me when I say that the simulator is so much simpler than real hardware! If you get the wiring wrong and, say, short an output to ground or apply the wrong power voltage then things will get hot. It's not dangerous, just costly and embarrassing.

Even though it is harder, I hope you give it a try because we have lots of other interesting circuits to try out - but mainly using the simulator.

CEDAR

#### Related Articles

Boolean Logic

<ASIN:B0002H4W1Y@COM>

<ASIN:B0040Z1ERO@COM>

<ASIN:B001IRZ3AQ@COM>

<ASIN:B0002HBQHC@COM>

<ASIN:B007L3I1ZA@COM>

<ASIN:B003N3W6DU@COM>

Last Updated ( Saturday, 11 August 2012 )