deviation counter

An up/down counter that counts two types of input signals.
For example, if signals of A(+), A(-), B(+), and B(-) are input, the count goes up when A(+) or B(+) is input while it goes down when A(-) or  B(-) is input.
As a result, the difference in pulse numbers(deviation) between the two types of signals will be counted.