Debounced toggle switch 2026-10-25
A sampled toggle controller can reject short disturbances by requiring three consecutive high samples to toggle, and then three consecutive low samples before another high run is allowed to toggle. One four-bit synchronous sequential circuit stores output , an armed bit , and input history . Initially . SetThe two three-sample run detectors cannot assert simultaneously. A high run toggles once and clears ; only a complete low run rearms it. All right-hand sides use the old state, so the toggling event occurs at the third qualifying clock edge.
The controller has twelve distinguishable behaviours: for each , three armed states count trailing highs of lengths , and three disarmed states count trailing lows of lengths . The run lengths are distinguished by the number of further matching samples needed before a toggle or rearm. Armed and disarmed states are distinguished by an all-high continuation. Thus at least state bits are required, and the displayed design attains that bound.
Use a three-sample run detector. Just before clock edge , let two stored bits and hold the input values at edges and . Initialise both to zero. With input , definePrimes denote the next stored state, with all assignments simultaneous at the clock edge. The output is the logical conjunction of the present input and its two preceding samples. By induction on clock edges, the stated interpretation of is maintained, proving the required behaviour. Two bits of state suffice.