Logical design of switching circuits