Some time back I found a circuit on the Internet that professed to build a logical OR gate with two transistors; accompanying it was a circuit that professed to build a logical AND gate, also with just two transistors.
But then I got to thinking that one transistor by itself is practically a logical AND gate, isn't it? If the voltage at an NPN transistor's base is high, then there will be no resistance between the collector and the emitter, so the voltage at the emitter will be high if the collector is high, and low if the collector is low. And if the voltage at the base is low, the voltage at the emitter will be low regardless of the voltage at the collector.
Similarly, if the voltage at a PNP transistor's base is low, then the voltage at the emitter will be roughly the voltage at the collector, while if the voltage at the base is high, then the voltage at the emitter will be low regardless of the voltage at the collector.
That being the case, could I build a multiplexer with just four transistors via the following circuit? The inputs are bits Co (for control), Il, and Ih, and the output is bit Ou. The semantics are that Ou will take the value of Il if Co is low, and the value of Ih if Co is high. Vcc is high voltage and Gnd is ground.
There are a lot of "tricks" to get a single stage non-inverting logic gate to work, but a lot of times they will suffer from some input or output characteristic that is undesirable. In this circuit's case, I can identify the following issues you may see (in no particular order, not exhaustive).
Ih = Co = '1', the output voltage will be two Vbe drops lower than
Il = '1', Co = '0', the output voltage will be one Vbe drop and Vsat lower than
Ou = 1
Il = '1', Co = '0',
Ilwill be shorted to
Cothrough the base-emitter junction of Q2
Ih = '0', Co = '1',
Ihwill be shorted to
Cothrough the base-collector junction of Q1
So it can probably be made to work, but there's a lot of issues with using it as a normal logic gate. You would likely need to test circuit behavior in every state of this gate, monitoring voltages and currents. If I grabbed a standard logic gate (TTL, CMOS, etc...), then I would generally expect none of these issues to really cause problems.