15

In this diagram

http://upload.wikimedia.org/wikipedia/commons/thumb/c/c6/R-S_mk2.gif/220px-R-S_mk2.gif

what would be the beginning state for Q? Since the first NOR for S and R rely on previous results, there must be something for the first iteration?

NOTE: I'm in a first year digital logic class, so the question is for theoretical use (table making, various homework problems it applies to, etc.), not actual implementation. Just for things like "if R is __ and S is __ what is Q?" Simple things like that.

Marty
  • 271
  • 2
  • 7
  • 1
    ah - well for homework type purposes, you just assume that Q and !Q are both high, and go from there - but be sure to state that this is an assumption you've made. for completeness, you can then assume that they both start out low, and do another analysis. professors like it when you clearly state what assumptions you make, and also why you are forced to make them, and then follow through on the analysis. – JustJeff May 25 '11 at 20:00
  • 1
    A non-reset SR latch should go into a logic chain that goes through a reset sequence that clears the latch to a known state. – Toybuilder May 25 '11 at 21:13

4 Answers4

15

If you just powered that on, the initial state would be the outcome of a race condition, depending on which gate output can become high first. In actuality, one gate or the other would tend to have a faster rise time, so it probably would tend to come up in one state or the other, but there'd be no guarantee.

JustJeff
  • 19,163
  • 3
  • 48
  • 75
  • 2
    Note: even with a output pullup, it is still metastable on powerup. Board debris or strange output loading could still cause it to come up in the alternate state. A power-on reset system is the only real way to be confident it will always power up in the same state. – Connor Wolf May 25 '11 at 02:50
  • 1
    @Fake Name - feel free to describe a power-on-reset circuit. i've expunged the pull up. – JustJeff May 25 '11 at 12:03
  • @JustJeff, With TTL I thought there often was a default state. [on wiki](http://en.wikipedia.org/wiki/Transistor%E2%80%93transistor_logic) the first example nand gate will clearly default to an output of high. Now, if you wanted to design an SR latch I think the POR state could be controlled. – Kortuk May 25 '11 at 15:33
  • @Kortuk - let's say a lone NAND defaults to high; if you cross-connect two of them, it's still going to be a race condition. And just b/c those two NAND implementation default high, is it necessarily so that *all* NAND implementations would do so? Does it imply anything about NOR gates? I don't think there's a whole lot can be said beyond "it's indeterminate, don't count on it coming up the same way every time". Still hoping @Fake Name will be forthcoming with a POR. – JustJeff May 25 '11 at 17:48
  • @JustJeff, yes, but if you wanted to design a system that had a controlled POR state you would design, lets say the R side, to default to off by using pull downs and the transistors as pull ups. It really comes down to the design and datasheet, as most things. – Kortuk May 25 '11 at 18:05
  • please see edit – Marty May 25 '11 at 19:48
6

An RS latch has a stable Q high state and a stable !Q high state, but it also has an essentially infinite number of metastable states. When the latch is in a metastable state, the outputs may arbitrarily switch high and low for an arbitrary length of time, though in practice most metastable states fairly quickly resolve into a stable state.

Suppose that each gate had an output propagation time of precisely one nanosecond, both inputs simultaneously switched from high to low. While the inputs were high, both outputs would be low. Then one nanosecond after they switched, both outputs would be high. A nanosecond later, both outputs would be low, then both high, etc. In practice, the gates aren't going to behave in such perfectly-balanced fashion, of course, but simply imbalancing things won't entirely prevent metastability. No matter how one might try to tweak the circuit, were it not for quantum limitations, it would be theoretically possible to construct a stimulus with one input leading the other by just the right amount to throw the thing into a metastable state for an arbitrary length of time. In practice, one can construct circuits so that extended metastability would require such a precise stimulus that the probability of such a stimulus actually occurring would be infinitesimal. Nonetheless, it's important to be aware of metastability, since it can cause weird and unexpected behaviors.

Just about any latch can be thrown into a metastable state if VDD rises and falls in just the right pattern. Such metastable states will usually resolve pretty quickly, but it's important to note that it's possible for the output of a metastable latch to seem to switch one way and then some time later switch to the opposite state.

supercat
  • 45,939
  • 2
  • 84
  • 143
0

The same question was asked and answered there:
How does a latch determine its initial state?

I have added an answer that explains how a desired initial state can be achieved when a flipflop is built by yourself:
https://electronics.stackexchange.com/a/446285/224980

I know that we should not post "link-only" answers, but as this link points to StackExchange again and as my answer is quite long, I think it would be inadequate to copy it here.

-2

I think you just want the truth table.

This is the truth table:

 R | S |  Q
---+---+-------
 0 | 0 | No change
 0 | 1 | High(1)
 1 | 0 | Low (0)
 1 | 1 | Unpredictable

For the last case, Q and Q' are same which is not possible.

Kevin Vermeer
  • 19,989
  • 8
  • 57
  • 102
Gouse Shaik
  • 1,153
  • 3
  • 10
  • 17
  • 3
    I understand that you might not have English as a first language, but please try to use proper spelling and capitalization. Capitalize the pronoun "I", spell out "You", "Just", "Your", etc. Also, read the [formatting help](http://electronics.stackexchange.com/editing-help) and check the formatting and spelling of your answer after it's posted. – Kevin Vermeer Sep 21 '11 at 10:42
  • Hey Dude thanks for ur suggession but actually i use those words for good looking.it was jst once style of writing dude.this comment is for kevin but i dont want to use this site for these kind of discussions.sorry for in-convinience – Gouse Shaik Sep 21 '11 at 10:52
  • 7
    @Gouse - Well, Kevin's remark didn't seem to help, looking at your reply. We appreciate proper spelling. Please keep your texting language for your mobile phone. – stevenvh Sep 21 '11 at 11:34