How to eliminate the forbidden state in an SR latch?

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.

Background/motivation:

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.

• Your latch definition doesn't address the problem. If the switch is as unpredictable as you say, then all four input combinations could occur during the bouncing period. You'll have to define a time interval that starts at the first transition on either input, and then declare the new state at the end of the interval. Jan 1, 2013 at 22:49
• First, sounds like the switch is really DPDT. Second, sounds like you are trying to detect the final position of a switch that has two positions. I recommend using the switch as a SPST and debounce that signal. Jan 2, 2013 at 4:02
• @DaveTweed: Yes, all four input combinations can occur before the switch settles. However, because one pole is normally open and the other is normally closed, there is a temporal restriction. Suppose the switch is in the (0,1) state. When the switch is toggled, it can jump around between the (0,1), (1,1), and (0,0) states before hitting (1,0). However, once the switch hits (1,0) it can't bounce back to (0,1). The same goes for the opposite case. I believe this means that the latch I described can be used to debounce the switch. Jan 2, 2013 at 6:21
• @DaveTweed: I'm assuming that a pole only bounces when contact is being made---that it opens cleanly. Maybe that's a flawed assumption; if so then this switch can't be debounced with a latch. But I'm still curious to know how to construct the described latch. Jan 2, 2013 at 6:23
• @MichaelPruitt: The switch is a DPST, with one pole normally open and the other pole normally closed. It has four terminals. When the switch is in the off position, terminals A and B are not connected and terminals C and D are connected---(0,1). When the switch is in the on position, terminals A and B are connected and terminals C and D are not connected---(1,0). The switch has two positions---on and off---but there are four possible pole states: When the switch has settled, it is either in (0,1) or (1,0), but during a transition it can also be in (0,0) or (1,1). Jan 2, 2013 at 6:32