I am trying to understand how a flip-flop stabilizes internally after setting up, before the clock starts ticking.
I assume:
- An electric signal takes no time to transmit from one end of a wire to the other;
- A NAND gate takes 3 time units to generate output;
- A NOT gate takes 2 time units to generate output;
- All wires start with signal 0;
- D and CLK stay 0.
The states of all wires of first 20 time unit follows:
time | D | D' | CLK | T1 | T2 | Q | Q' |
---|---|---|---|---|---|---|---|
0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
3 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
4 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
5 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
6 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
7 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
8 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
9 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
10 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
11 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
12 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
13 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
14 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
15 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
16 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
17 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
18 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
19 | 0 | 1 | 0 | 1 | 1 | 1 | 1 |
It is clear that Q and Q' are repeating a pattern with cycle length 5 and never stabilize. Is there any mistake with the assumptions I made? How does a flip-flop stabilize in practice?
(This question is a duplicate of https://stackoverflow.com/questions/75230504/how-does-d-flip-flop-stabilize. Will delete the other once one of them gets answered.)