Functional Decomposition and Switching Circuit Design