Flip-Flop Using CMOS NAND Gates

Using just two NAND or inverter gates its possible to build a D type (or ‘toggle’) flip-flop with a push-button input. At power-up the output of gate N2 is at a logical ‘1’, ensuring that transistor T2 is switched off. When the push-button is pressed the output of N2 changes to a logical ‘0’ and transistor T2 conducts. The coupling between N1 and N2 ensures that the output of N1 will always be the inverse of N2 so T1 and T2 will always be in opposite states and will flip each time the push-button is pressed. In some cases it is possible to omit T1 and T2 and use the outputs of N2 and N1 to drive external circuitry directly but only if the loading on these outputs is low enough.

The 4000 series CMOS family can source/sink a maximum of 0.5mA (at 5 V) so for the sake of safety its best to use these open-collector configured transistor buffers. This circuit is particularly useful if you have some unused gates left over in a circuit design, avoiding the need to add a dedicated flip-flop IC. It is worth remembering that all other unused CMOS gates must have their inputs connected to either the positive or ground rail. The supply voltage can be in the range 3 V to 15 V for CMOS ICs and the current taken by this circuit is between 0.2 mA and 5 mA (no load).