Discrete TTL NAND Gate


Have you ever seen the diagrams from textbooks or datasheets describing the internal workings of and NAND IC and wanted to make one out of discrete components, but then think it was too hard or complicated? Well it isn’t, with a little knowledge of electronics you can make your you discrete NAND logic.

The NAND gate is one of the universal bulding blocks used to build complex systems like computers.

nand_symbol

IN OUT
A B A NAND B
0 0 1
0 1 1
1 0 1
1 1 0

I will not go in to the details of how to solder (or use a prototyping bradboard) and assume you know how to read simple electronic circuit diagrams.

If you don’t remember what the logic input and output of a NAND gate are, if you you are totally confused the folowing Wikipedia page for more background information on NAND Gates.

There are many ways to implement logic but one very popular way is using TTL logic. There are other types of ways to implment logic such as the more modern CMOS and the ancient DTL, but the TTL can be implemented with common inespensive parts using 5 volts.

74 series TTL (Transister Transitor Logic) integrated ICs are quite dated but are still used by electronics hobbyist.

This is what a TTL quad (ie contains 4) NAND gate package looks like:

nand_ic_package

And this is standard diagram of the internals of a single NAND gate inside such a package.

ttl_nand

Almost any small signal diodes and NPN transistors can be used. Also note the resistor values don’t have to be exact as real versions of this logic gate are implented with different resistor values to increase the switching speed or reducing power consumption. Once you have implented one you may want to do further research to look at more refined versions.

Of course the above structures are etched in to silicon and that would be way to expensive to do at home. We are going to do it with discrete BJTs (bipolar junction transistors) that look like this:

BJT_TO-92
A discrete transistor in a TO-92 package

One of the first problems you will run in to is inout transistor Q1,  which is a multiple emitter transistor which you can’t get as a discrete component. Although they are easy to make when working directly on the silicon they don’t make sense when working with discrete components.

discrete_nand

To implement the TTL NAND gate you can replace the Q1 transistor with two seperate transistors QA and QB, and just join both their base leads together and also join both their colector leads together. In prinicple it is aslo possible to extend this and add extra input transistors along with a diode to extend this to make a three or four input NAND gate. The reverse is also true. If you want to convert the NAND gate in to a NOT gate, you can just remove transistor QB and diode D2!

In the Discrete NAND diagram I have added an LED (D4) to show the output. For inputs A and B you either connect them to ground (logic 0) or to +5V (logic 1). You will need to do further reading elsewhere for a more precise description of the TTL logic levels. TTL inputs behave like a logic level 1 when left floating (not connected to eitehr ground or +5Volts) but I can’t gaurentee this will always be the case in this discrete version and it may be best to connect them high to make sure they work as expected.

I was able connect the descrete NAND circuit to switches (not shown in the circuit diagram) through some low value pull down resistors when not active but high when pressed.

nand_with_buttons

I hope this dispells some fears that basic logic used in computers on the tiny scale today cannot be understood or implemented using simple discrete components.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s