A Digital Polarity Correlator Featuring Built-In Self Test and Self Repair Mechanisms