Logic Gates and Function Simplification