Logic Synthesis and Optimization