Fault detection in logic circuits