Skip to content
BetterDL

Gated D latch

Also called: D latch, transparent latch, gated latch, data latch, D-type latch, enabled D latch

A latch with a data input D and an enable: while enabled, Q follows D (transparent); when disabled, Q holds the last value it saw.

A gated D latch stores whatever is on its data input D, but only while its enable (EN, or E in expressions) lets it.

  • EN = 1: the latch is transparent. Q follows D, live, including every change.
  • EN = 0: the latch is closed. Q holds the value D had at the moment EN fell.

Picture a window. While EN = 1 the window is open and Q shows whatever D does. When EN drops, the window shuts on the last thing it saw.

Inside, it is a NOR SR latch with two AND gates in front: S = and R = . When E = 0 both are 0, so the latch holds. When E = 1, D = 1 sets and D = 0 resets. S and R can never both be 1, because one needs D = 1 and the other D = 0. So the D latch has no forbidden input.

Its characteristic equation is Q⁺ = : pass D when enabled, keep Q when not.

The D latch is level sensitive, which is its weakness. Chain two of them on the same enable and data can race through both while the enable is high. That is why clocked designs use the edge-triggered D flip-flop instead. Some latches are transparent while the enable is low, shown by a bubble on EN.

0000
0011
0100
0111
1000
1010
1101
1111

Worked examples

Example

Tracing a D latch

The latch is transparent while EN = 1. Q starts at 0. Split the diagram into enabled and disabled stretches.

ENDQ
  1. 1.

    Slot 1: EN = 0. Q holds its starting 0, and D = 1 is ignored.

  2. 2.

    Slots 2–3: EN = 1. Q copies D: 0, then 1.

  3. 3.

    Slots 4–5: EN = 0. Q freezes at 1, the value D had when EN fell. D drops to 0 in slot 5 but Q ignores it.

  4. 4.

    Slots 6–8: EN = 1 again. Q copies D: 0, 1, 0. Three values in one enable pulse.

  5. 5.

    Slots 9–10: EN = 0. Q holds 0, so D's rise in slot 10 is missed.

  6. 6.

    Shortcut: EN = 1 means copy D; EN = 0 means copy the slot to the left.

Example

Inside the latch: S and R

With S = and R = , find S and R for E = 1, D = 0, and for E = 0, D = 1.

  1. 1.

    E = 1, D = 0: S = 0·1 = 0 and R = 1·1 = 1. The inner latch resets, so Q = 0.

  2. 2.

    E = 0, D = 1: S = 1·0 = 0 and R = 0·0 = 0. The inner latch holds.

  3. 3.

    In no case are S and R both 1, so the forbidden row can never be reached.

Common mistakes

  • Treating the D latch as edge-triggered. It responds for the whole time EN is active, so Q can change several times in one enable pulse.

  • Thinking EN = 0 clears Q. It holds the last value instead.

  • Forgetting that the latch freezes on D's value at the moment EN falls, not at the moment EN rose.

Practice Gated D latch

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Gated D latch is taught in Latches and Flip-Flops.