The D Latch
The SR latch requires two separate control inputs. Furthermore, designers must ensure that glitches from combinational logic do not assert both inputs simultaneously.
Because storing a single binary bit requires only two states (0 or 1), a single input line is sufficient. Adding an inverter to the input removes the invalid state and creates the Data (D) latch.
Circuit Construction
The D latch derives its inputs from a single data signal, $D$. The circuit connects $D$ to the set path and the inverted signal $\bar{D}$ to the reset path.
Because $D$ and $\bar{D}$ are always complementary, the inputs can never assert set and reset at the same time. This structure eliminates the invalid condition.
To control when data is stored, the circuit includes an Enable ($EN$) input. Figure 1 shows the four-NAND gate implementation of the D latch.
The operation follows this truth table:
| EN | D | $Q_{\text{next}}$ | Operating Mode |
|---|---|---|---|
| 0 | 0 | Previous $Q$ | Hold (Opaque) |
| 0 | 1 | Previous $Q$ | Hold (Opaque) |
| 1 | 0 | 0 | Transparent (Follows D) |
| 1 | 1 | 1 | Transparent (Follows D) |
When $EN$ is high, the latch is transparent. Output $Q$ follows changes on input $D$ after gate propagation delays.
When $EN$ is low, the latch is opaque. Output $Q$ latches and holds the value that existed on input $D$ when $EN$ transitioned low.
The characteristic equation for the D latch is:
$$Q_{\text{next}} = D \cdot EN + Q \cdot \overline{EN}$$
Figure 2 illustrates the transparent and opaque operating phases.
During the transparent phase, every signal transition on input $D$ propagates directly to output $Q$. If combinational hazards occur on $D$, output $Q$ reproduces those glitches.
Transmission-Gate Implementation
In integrated circuits, standard cell libraries implement the D latch using CMOS transmission gates (Figure 3).
One transmission gate passes input $D$ into the storage loop when $EN$ is high. Two inverters form the bistable storage loop. A second transmission gate closes the feedback loop when $EN$ is low to maintain the stored state.
This circuit uses only six transistors plus an inverter for the enable signal, minimizing silicon area.
Level-Sensitive Timing Limitations
The D latch is level-sensitive. The device remains transparent during the entire duration that $EN$ remains high.
In synchronous systems, this level sensitivity introduces race conditions. Suppose output $Q$ connects through combinational logic back to input $D$. While $EN$ is high, a change at $Q$ propagates through the logic and modifies $D$. The new value at $D$ passes immediately to $Q$, initiating another cycle.
The circuit can transition through multiple states during a single active enable pulse. The final stored value depends on exact wire and gate delays.
To eliminate this race condition, synchronous digital designs use edge-triggered flip-flops. Flip-flops sample data only at a single clock edge transition instead of during a time interval.
Setup and Hold Times
The latch requires stable inputs around the falling transition of $EN$.
Input $D$ must remain stable for a setup time ($t_{\text{su}}$) before $EN$ falls to 0. If $D$ changes during this interval, the internal loop can enter metastability.
Input $D$ must also remain stable for a hold time ($t_h$) after $EN$ falls to 0. This interval allows the internal feedback loop to establish full control.
These intervals form a timing aperture around the falling edge of $EN$. The data signal must not change inside this aperture.
Practice Exercises
Problem 1
A D latch specifies $t_{\text{su}} = 2\text{ ns}$, $t_h = 1\text{ ns}$, and propagation delay $t_{\text{pd}} = 3\text{ ns}$. The enable signal $EN$ transitions low at time $t = 10\text{ ns}$.
- Determine the time window during which input $D$ must remain constant.
- Determine when the captured output value appears at output $Q$.
Solution
- Input $D$ must remain stable during the interval:
$$[t_{\text{fall}} - t_{\text{su}}, t_{\text{fall}} + t_h] = [10\text{ ns} - 2\text{ ns}, 10\text{ ns} + 1\text{ ns}] = [8\text{ ns}, 11\text{ ns}]$$
Input $D$ can transition freely after $11\text{ ns}$.
- Because the latch captures the data before $10\text{ ns}$, the valid data propagates to output $Q$ within the propagation delay, settling by $13\text{ ns}$.
Problem 2
Two D latches connect in series with identical enable signals ($EN_1 = EN_2$). Explain why this configuration does not prevent transparency race conditions.
Solution
When the enable signal is high, both latches are transparent simultaneously. Data passes through both latches continuously without isolation.
To isolate the stages, the two latches must receive complementary enable signals. When one latch is transparent, the other latch must be opaque. This complementary configuration forms a master-slave flip-flop.
Problem 3
A D latch stores $Q = 1$ while $EN = 0$. A noise glitch causes input $D$ to transition low for $1\text{ ns}$. Does output $Q$ change?
Solution
No. When $EN = 0$, the latch operates in opaque mode.
The input transmission gate isolates input $D$ from the internal storage loop. The glitch does not affect output $Q$.
The next article connects two D latches in a master-slave configuration to create the edge-triggered D flip-flop.