Digital Logic Gates Just Using Transistors NAND

Both inputs need to be on to switch the output off, if both inputs are high then the output is low. Both Diodes are needed to prevent feedback, The input resistors could be lower values if used in a lower voltage circuit or input voltages are less than 9v. The 220 ohm and 500ohm resistors are required to make the circuit switch on and off. The 1K Base resistor could be changed for a variable resistor to create a variable output voltage.