Working of NAND gate using diodes and transistors
D3 and D4 are there to provide a voltage drop of about 650 mV each when forward biased. Does this provide enough of a hint to understand the rest of the circuit? 

Note that D1 and D2 also have an implicit forward voltage drop. What does this imply about noise margins at the base of the transistor?