# Converting boolean function (dnf) to only 2-input NANDs

I'm currently preparing for an exam and was doing some exercices regarding boolean logic. Commonly asked question is to build a function from a truth table and simplify it with a karnaugh map.

After that we mostly have to convert the dnf to a circuit with NAND or NOR logic only, usually not the problem, but im struggling to convert this dnf to a circuit with NAND-Gates that only use 2 inputs:

(¬B ∧ D) ∨ (A ∧ ¬B ∧ C) ∨ (¬A ∧ ¬C ∧ ¬D) ∨ (¬A ∧ B ∧ ¬C)


The inputs are available in a double-rail-system, so normal and inverted.

I tried using the rules for boolean logic to extract a variable, so i'd only have 2 variables/inputs per gate left, but was getting confused due to having initial 3 inputs/variable for the AND gates.

Appreciate any help on this!