How the simulator decide the Q and QBar of the SR latch terminal

Awalluddin

Newbie level 5
Joined
Nov 13, 2021
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
118
Hi everyone, an SR latch that build using Nand gate, how do the simulator decide the Q and QBar terminal. The SR latch is symmetry, and either the terminal could be Q and vice versa.


 

If both inputs were low , the last one to go high asserts both output states to be complementary.
Otherwise if the inputs are exclusive, it is obvious. Using de Morgan’s it could also be +ve input logic using NOR gates and swapping output labels


… Negative input logic which ought to be labelled like Q-bar
 
Last edited:

The simulator doesn't assign topology. You do. In the
netlist and in your mind (the two should agree).
 

If you are referring as to how the simulator comes up at the start, it's purely arbitrary if S and R are both high, unless you assign a state (and you should).
 

The simulator applies simple rules of logic of a NAND gate with analog voltages and assumed thresholds for the logic family and Vdd.

S R Q Q
1 1 x x ( no change, x previous state but complementary)
0 1 1 0
1 1 1 0 ( previous state latched)
1 0 0 1
1 1 0 1 ( previous state latched)
0 0 1 1 ( illegal states as SR state will become valid (complimentary outputs ) when 1st SR goes high)
--- Updated ---

 

Cookies are required to use this site. You must accept them to continue using the site. Learn more…