At each rising edge, reset to state zero if reset is high. Otherwise toggle the state when x is high and hold it when x is low.
At each rising edge, reset to state zero if reset is high. Otherwise toggle the state when x is high and hold it when x is low.