Pulse Pattern Generator and Error Detector