# SR flipflop logic minimization

+1 vote
Hello,

in case we need to create the control logic for an SR flipflop and have to apply logic minimization:

Suppose for some input variable assignments the values of r and s are irrelevant. If you would get smaller DNFs for example in the KV diagrams if you set these don't care values to 1, would that be wrong because r&s holds for some assignments?

Kind regards!

+1 vote

To keep it short: That will be no problem.

Side story: There are many rumors about SR-Flipflops which are not true. Consider a typical implementation by two NOR gates:

```        next(p) = !(s | q)
next(q) = !(r | p)```

This leads to the following cases for the four possible inputs if these are kept stable:

1. s=0 & r=0 : (next(p) = !q) & (next(q) = !p)
2. s=0 & r=1 : (next(p) = !q) & (next(q) = 0) and thus (p =1) & (q = 0) after two steps
3. s=1 & r=0 : (next(p) = 0) & (next(q) = !p) and thus (p =0) & (q = 1) after two steps
4. s=1 & r=1 : (next(p) = 0) & (next(q) = 0)

Hence, you can see that s=1&r=1 do not lead to unstable outputs as often stated, but they violate the invariant that we want that q=!p. That is established by one of the inputs s=0&r=1 or s=1&r=0 and kept invariant by s=0&r=0. However, if we would have once the input s=1&r=1 which makes p=q=0, then the input s=0&r=0 would lead to an unstable state where p and q will oscillate.

You can look at is also from the perspective of the states

1. p=0 & q=0 : (next(p) = !s) & (next(q) = !r), i.e. all four states are reachable from here
2. p=0 & q=1 : (next(p) = 0) & (next(q) = !r), i.e. with r=1 we switch to p=q=0 and otherwise remain in p=0 & q=1
3. p=1 & q=0 : (next(p) = !s) & (next(q) = 0), i.e. with s=1 we switch to p=q=0 and otherwise remain in p=1 & q=0
4. p=1 & q=1 : (next(p) = 0) & (next(q) = 0), i.e. we switch to p=q=0 As you can see, it is unavoidable to go through state p=q=0.
Having written way too much, let me emphasize here finally, that all of this is not relevant for the exam tomorrow. I don't want to create the impression that this is maybe something you should look at in detail. Please don't waste your time!
by (162k points)
edited by
Thank you very much!

+1 vote