Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

If both inputs in SR latch are zero

  1. Sep 30, 2012 #1
    If both the inputs in SR latch are zero and there was no previous output then what would be the output? If both the NOR gates are different then depending which one is faster the output will be accordingly, but what if both are identical?
     
  2. jcsd
  3. Sep 30, 2012 #2
    They can't be identical. One will always have slightly higher gain or speed. It also may by that the designers deliberately bias the SR Latch to favor one output.
     
  4. Sep 30, 2012 #3
    Why cannot they be identical ? Of course it would be very rare but still if they are then what?
     
  5. Sep 30, 2012 #4

    Averagesupernova

    User Avatar
    Gold Member

    I suspect you don't understand how the outputs are configured and wired together. If you did you would know the answer.
     
  6. Sep 30, 2012 #5
    I think I know how they are configured and wired but maybe I have some misunderstanding. Help me understand it. I don't get why they can't be identical
     
  7. Oct 1, 2012 #6

    NascentOxygen

    User Avatar

    Staff: Mentor

    Even if all else is identical, random electrical noise will tip one output faster towards one state or the other, and this in turn forces the other output towards the complementary state.
     
  8. Oct 3, 2012 #7

    Averagesupernova

    User Avatar
    Gold Member

    Voltage going positive on Q reinforces the voltage going negative on /Q. They reinforce each other to go opposite directions. Without a schematic that is the best I can explain it.
     
  9. Oct 4, 2012 #8
    Okay I just figured out that I don't understand the basic SR latch properly. I am continuously finding myself in the chicken-or-egg first position.
    Let's say S input is 1 and R input is 0. So for the first NOR gate to give input it has to get the output from the other NOR gate but it won't get it until it give its own output!
    Maybe because I have not studied how a gate works internally I am having trouble but still if anyone can help me understand, it would be great.
    Thank You
     
  10. Oct 4, 2012 #9

    es1

    User Avatar

    This is a known problem with the ideal SR latch with perfectly matched gates. If the gates have any mismatch in delay, like a real latch will, then the circuit will find a stable state. The only problem is, you don't necessarily know which gate is slower.

    So like the old joke goes, if it hurts, then don't do that.

    http://www.cs.ucr.edu/~ehwang/courses/cs120b/flipflops.pdf

    "A problem exists if both S' and R' are de-asserted at exactly the same time as shown at time t6. If both gates have exactly the same delay then they will both output a 0 at exactly the same time. Feeding the zeros back to the gate input will produce a 1, again at exactly the same time, which again will produce a 0, and so on and on. This oscillating behavior, called the critical race, will continue forever. If the two gates do not have exactly the same delay then the situation is similar to de-asserting one input before the other, and so the latch will go into one state or the other. However, since we do not know which is the faster gate, therefore, we do not know which state the latch will go into. Thus, the latch’s next state is undefined.
    In order to avoid this indeterministic behavior, we must make sure that the two inputs are never de-asserted at the same time. Note that both of them can be de-asserted, but just not at the same time. In practice, this is guaranteed by not having both of them asserted. Another reason why we do not want both inputs to be asserted is that when they are both asserted, Q is equal to Q', but we usually want Q to be the inverse of Q'."
     
  11. Oct 4, 2012 #10

    es1

    User Avatar

    Does this work? If phase of the S and R falling edge equals the mismatch then you're back into the same situation, no? It seems like the external rule imposed on the driving circuit of "don't let S and R falling edges be within the time of the worst case possible mismatch" is the only thing that works for the basic cross coupled latch.
     
  12. Oct 4, 2012 #11

    es1

    User Avatar

    Nevermind, I just realized it would get cleaned up on the next cycle around. So it is different in the sense that the oscillation doesn't persist.
     
  13. Oct 4, 2012 #12

    vk6kro

    User Avatar
    Science Advisor

    No, there is no chicken-egg situation with a SR flipflop.

    Have a look at this circuit which is from Wikipedia:
    http://dl.dropbox.com/u/4222062/SR%20FFlop.PNG [Broken]

    It is made of 2 NOR gates. A NOR gate output is high unless one (or both) of the inputs is high. Then it goes low.

    So, in the diagram the R input is high (shown as red in the diagram), so the output of that gate has to be low because it is a NOR gate.

    The S input is low and the output from the top gate is low, so the lower gate has to have a high output.

    This means that the top gate has to have a low output even if the R input is removed, because one of its inputs is still high.

    Every time you make an input high, the input next to it on the same gate goes high and stays high.

    You can see from this diagram, that if both inputs were high, then both outputs would be low. This is because each NOR gate has a high input and so its output must be low. This is not a problem.

    The problem with this circuit is that if the gates were identical, there could be oscillation when you first turned it on. Both inputs would be low but both outputs would become high at the same time, forcing the outputs to go low. Very unfortunate oscillation would possibly happen until an input pulse hopefully forced the oscillation to stop.
     
    Last edited by a moderator: May 6, 2017
  14. Oct 6, 2012 #13

    NascentOxygen

    User Avatar

    Staff: Mentor

    I'm not sure that the whole story has been told here. Logic gates come in two basic versions: buffered and unbuffered. Let me demonstrate the distinction. A buffered inverting gate cannot have its output connected back to its own inputs without causing logic oscillations, as an example, a NOR gate with both inputs connected together. On the other hand, an unbuffered inverting gate cannot have its output connected back to its inputs and still produce a logic output. (It instead acts as a linear amplifier, with output settling around 2-3 volts for TTL, and can in fact be used as a rudimentary amplifier, e.g., to amplify audio tones.)

    If an SR latch is constructed using a pair of buffered gates, then in the worst case scenario it could exhibit continuous logic level oscillations as mentioned. But if constructed using two unbuffered gates, I think we'll see the electronics race to immediately attain a stable state with no logical oscillations.
     
  15. Oct 6, 2012 #14
    I think it's called "invalid state", you may try to add some control logic gates to enable and disable the SR latch
     
  16. Oct 6, 2012 #15

    vk6kro

    User Avatar
    Science Advisor

    In practice, there is never a problem with SR gates. They always settle on one input or the other and the first input pulse controls the outputs from then on. They are extremely tame and reliable.

    If it is critical to know which way the latch starts off, then there are simple circuits, involving a capacitor being charged, to deliberately force the output one way or the other.

    The issue here was that the poster asked what happens in the million to one chance that the gates are totally identical.

    Having two zeros on the gates of an SR latch is not a forbidden condition, though. It is only at the moment of turn-on that there could conceivably be a problem. After that it is quite normal to have low inputs on both gates.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: If both inputs in SR latch are zero
  1. Latching relay (Replies: 10)

  2. D-Latch schematic help (Replies: 6)

Loading...