The main part is this circuit (primitive, yes). Put enough of these (we use 26) and wire them one to another - and voila, the core is complete. Works quite simple, there's an output for "empty", "half-cycle", "full cycle", "more than one cycle". Could be modified to display more exact data, but...