Use Case: SR flip flop simulation
This use case demonstrates how the dependency mechanism copes with consistent
feed back loops in digital circuits. Here it is shown with an SR flip
flop. The use case illustrates the action with a sequence of 4 dependency
calls. The state of each component (viz. n1 and n2) is shown in curly braces: {x,y,z},
where x and y are the state of the two inputs (input 1 followed by input
2) and z is the state of the output terminal. Initially all terminals are
in the undefined state, so all components are in the state {u,u,u}. The
SR flip flop is has the following truth table, which this circuit mimics.
| S |
R |
Q |
Q' |
| 1 |
1 |
Q(n-1) |
Q'(n-1) |
| 1 |
0 |
0 |
1 |
| 0 |
1 |
1 |
0 |
| 0 |
0 |
u |
u |
-
Sequence number 1
The GUI sends a change value message for the S terminal. Which changes
its value to 0. This is an active low signal to the SR flip flop to set
its value. There is no change at the output because the R terminal is still
undefined.
-
Sequence number 2
The GUI sends a change value message for the R terminal. Which changes
its value to 1. Now the SR flip flop is in line 3 of the truth table and
true to its behaviour the Q becomes 1 and Q' becomes 0. This means that
the flip flop has stored the value 1 in its 1 bit memory. This shows the
set mechanism of the flip flop. The sequence diagram also shows that the
consistent loop in the dependency diagram is correctly handled.
-
Sequence number 3
The GUI sends a change value message for the S terminal, which changes
its value to 1. The flip flop in now in row 1 of the truth table, in which
it preserves the value that it saved in sequence 2.
-
Sequence number 4
The GUI sends a change value for the R terminal, which changes its value
to 0. The flip flop is now in row 2 of the truth table. This means that
the flip flop should reset its value. The new value in the memory element
is 0, since Q becomes 0 and Q' becomes 0.