Building logic gates from transistors

The use of transistors for construction of logic gates depends on their utility as fast switches. Recall that a NPN transistor allows current to flow from the collector to the emitter only if a certain threshold voltage is applied to the base.

AND gate, both A and B must be high to make Out high
NAND gate, both A and B must be high to drive Out low
NOR gate, either of A or B being high will drive the Out low.
OR gate, either of A or B being high will drive Out high