Different ways to make digital gates.

One of the reasons why I picked NPN transistors to make all of the digital gates in the series of videos I made three years ago was that NPN transistors were cheap on Amazon. I could buy a hundred 2N3904 transistors for around $6.

But they are not the most power effective way to build circuits.

We’ve known this collectively for decades, which is why most modern circuits are made using CMOS circuits–using a combination of N- MOSFETs and P- MOSFETs to create digital gates. You can also create gates using PNP transistors, using only N- MOSFETs and only using P- MOSFETs. In all cases except with CMOS, the single transistor is either ‘on’ which allows current to flow through the transistor, pulling the circuit voltage either up or down (depending on the type of transistor), and when it’s ‘off’ a resistor allows a small amount of current to pull the output value the other way.

The problem, of course, is that when your transistor is ‘on’, power flows from power to ground through that resistor, dissipating heat.

CMOS circuits solve this problem by gating both the power and ground, meaning the only power consumed by your circuit is the power necessary to make the next ‘gate’ activate. There is no resistor draining power to ground in the circuit.

Over the next few weeks I hope to put together samples of these circuits showing a different way to build logic gates than using NPN transistors and resistors.


One interesting thing about all of this, by the way, is that once you have the fundamentals: that is, once you have a working NAND gate, for example, it doesn’t matter how your NAND gate is constructed. You can build the rest of your digital circuits by using that same NAND gate over and over again, regardless of how the underlying NAND gate was built.

I can almost imagine a collection of building blocks about the size of small LEGOs, but each is a NAND gate that can be connected to other building blocks to make these various digital circuits. Because, in some sense, that’s what we’re doing when we make a digital computer: we wire up thousands (or, for more modern systems, millions) of these NAND gates together to make something that appears to ‘think.’

Published by

William Woody

I'm a software developer who has been writing code for over 30 years in everything from mobile to embedded to client/server. Now I tinker with stuff and occasionally help out someone with their startup.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

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

Facebook photo

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

Connecting to %s