A Logic Test Chip for Optimal Test and Diagnosis