Synthesis and Optimization of Digital Circuits