I'd like a latch where the output only changes when both inputs have changed. If only one input has changed, the latch output should stay constant.
Here's the state table I want:
S R | Qnext ----+------ 0 0 | Q 0 1 | 0 1 0 | 1 1 1 | Q
The above looks just like a standard SR latch, except that the (1, 1) forbidden state is replaced with a hold state.
How can I design the above latch? I could add some logic to convert the (1, 1) inputs to (0, 0) (e.g.,
S' = S(~R),
R' = R(~S)), but I'm worried about glitches.
I have a double pole single throw (DPST) switch (one normally open, one normally closed). I assumed that when the switch is toggled, the pole that is closing would bounce while the pole that is opening would not. If this assumption had been correct, I would have been able to debounce the switch with the above latch.
If my assumption had been correct, then the main challenge would have been the fact that the two poles are racy: pole #1 might change before or after pole #2 changes. This would mean that during a transition the poles could be in any state: (0,0), (0,1), (1,0), or (1,1). But, there would be a property I could rely on: Once the switch went from (0,1) to (1,0) (or vice-versa), it wouldn't bounce back. This property would have allowed the above latch to debounce the switch.