Home-brew Computer Step 1: Transistor to Gate Logic

To simulate a home-brew computer from the smallest discrete components, I’ll start with transistors, resisters, and a clock signal. We could go smaller and make the clock from a RLC network (resistor, inductor, and capacitor in series), but that would require a simulator other than Logisim.  While there are several methods of going from transistor to gate, my example is based on Resistor-Transistor Logic.

Since it’s possible with De Morgan’s laws to change any NOR to NAND or NOT and vice versa, I’m limiting this exercise to only NAND gates (it’s also easier with the transistors I’m simulating).

Transistors to NAND

NAND Gate from NPN Transistors

Since Logisim doesn’t have components for resistors, instead of coupling resistors to the ground and power sources (necessary to avoid shorting the wire if both transistors are allowing current), I am instead connecting a pull-up transistor as the source and a pull-down transistor as a sink.  The transistors used were NPN type (and while I don’t think it makes a difference from a logic standpoint, the icon implies they are MOSFET).

Running through the truth table for a NAND gate confirms the above circuit.

You might be wondering why we don’t just connect power and ground instead of the pull-up and pull-down resisters.  It’s because doing that would short circuit the network if both gates were allowing current, since it would flow directly from the power source to ground.  Not only is shorting bad, but it gives an error as output, since it’d be a floating (unknown) value.  Using the resistors ensures that the output value is either pulled high to True or low to False in all scenarios.