Optimizing the circuit using a Karnaugh map