# Latches - Question regarding states

In an assignment we had to build a Clock D-Latch and give the boolean function and the truth table for the states $Q_1$/$Q_1^*$ and the following states $Q_2$/$Q_2^*$.

The latch looks like this: I've got the functions but I don't know how I proceed with the truth table for the states $Q_2$ and $Q_2^*$. At first I thought I could just replace the $Q_0$ in the boolean function with $Q_1$ and could calculate the states, but that doesn't work.

Functions are: $Q_1 = Q_0^* (D+ {\sim}CK)$ and $Q_1^* = {\sim}Q_0^*({\sim}D + {\sim}CK)$ where $\sim$ means not.

To be more specific: With $Q_0 = 0$, $D = CK = 1$ we get $Q_1 = Q_1^* = 0$. But the state two is $Q_2 = 1$ and $Q_2^* = 0$. I don't understand how we get from 0,0 to 1,0?

• I edited your question improving the math formatting. There were times where your meaning was ambiguous (was that supposed to be a $Q^*$ or $Q \times ...$?), so I made a best guess. Please edit your question if I made any mistakes. – Wasabi Jan 15 '17 at 20:33

Your question is very ambiguously worded making it hard to explain the behaviour that you do not understand. D-type latches are very common and their behaviour is straightforward once their operation is explained.

Please find a full truth table and explanation of your particular logic circuit here.

Note: $Q$ and $Q^*$ should always be opposites so I believe you have made a false statement when saying $Q1 = Q1* = 0$.

The truth table for moment i would be:

CK_i| D_i|Q_(i-1)|| Q_i
------------------------
0 | 0  | 0     || 0
0 | 0  | 1     || 1
0 | 1  | 0     || 0
0 | 1  | 1     || 1
1 | 0  | 0     || 0
1 | 0  | 1     || 0
1 | 1  | 0     || 1
1 | 1  | 1     || 1


$Q^*_i$ is always trivially $\sim Q_i$.

Describing this simply: for $CK_i=0: Q_i=Q_{i-1}.$ - Q is retained from previous state. For $CK_i=1 : Q_i=D_i$.

If you need to rewrite that into a function, $Q_i = ( CK_i \cdot D_i ) + (\sim CK_i \cdot Q_{i-1})$

Your question didn't tag CK or D with their moments. I'll assume they are not changing.

$$Q_0=0$$ $$D_1=D_2=CK_1=CK_2=1$$ $$Q_1=?; Q_2 = ?$$

Since we have write enabled at all times, previous state is not retained and input is directly rewritten to output, Q=D. $Q_1 = 1; Q_2 = 1$

And no, $Q_1=Q^∗_1=0$ only if the mains switch is off or the circuit is on fire. $Q_1 = 1; Q^*_1 = 0$, period.