in input of a CPLD, I have a syncronization video signal that can be like this (positive polarity):
or like this (negative polarity):
I want to recognize the type of the sync signal and invert the signal only if it has positive polarity. How can I do this with digital logic and without using analog filter?
Thank you