3.4.2 · D4Sequential Circuits

Exercises — D latch and gated latches

2,197 words10 min readBack to topic

Level 1 — Recognition

Recall Solution 1.1

When the latch is transparent: the output simply copies . Answer: . The old is overwritten because the "door is open."

Recall Solution 1.2

means hold (opaque). The new is ignored. Answer: — the latch keeps its old value, it does not copy .

Recall Solution 1.3

True. Internally the D latch wires and . Since and are always opposite, and can never both be 1. The forbidden state is designed out.


Level 2 — Application

Recall Solution 2.1

Apply column by column, carrying forward.

  • t1: → transparent → .
  • t2: → hold → (ignore ).
  • t3: → hold → .
  • t4: → transparent → .
  • t5: → transparent → (follows the new immediately — this is the "transparency" you can see in the waveform below).
  • t6: → hold → .

Answer row: 0 0 0 1 0 0.

Figure — D latch and gated latches

Look at the green line: while is high (shaded bands) chases ; while is low it flat-lines.

Recall Solution 2.2

Compare (from 2.1) with each step:

t 1 2 3 4 5 6
D 0 1 0 1 0 1
Q 0 0 0 1 0 0
Q=D?

Answer: 4 steps (). Note that steps where they happen to match while holding (t3) still count as equal, but the cause differs — only during is the equality guaranteed.


Level 3 — Analysis

Recall Solution 3.1

Track the "old " (call it ) and reason step by step.

  • t1: , output became . Only can produce ; holding would keep . → .
  • t2: , , output stayed . If we'd get — wrong. So we must hold.
  • t3: , , output . Both work: gives ; holds . → or .
  • t4: same as t3 (, , out ) → or .

Answer: . The forced values are .

Recall Solution 3.2

A 2:1 MUX with select outputs . Substitute : By commutativity of OR this is identical to . Proven. So a D latch is literally a 2:1 MUX with its own output fed back into input-0.


Level 4 — Synthesis

Recall Solution 4.1

Put one inverter on the enable pin: feed into the standard latch. Then transparency () happens exactly when . Substitute into the master equation: Check: (transparent). (hold). ✓ Minimum extra hardware = one NOT gate.

Recall Solution 4.2

We want: (flip); (hold). This is exactly XOR: Feed that into the latch (with pulsed). Verify:

  • : → stores → hold. ✓
  • : → stores → flip. ✓

Answer: , i.e. an XOR gate between the control and the fed-back output . (Note: with a level-triggered latch this would oscillate while is high — see the L4 trap. A proper toggle needs an edge-triggered D Flip-Flop.)


Level 5 — Mastery

Recall Solution 5.1

D latch (level-triggered): because it is transparent while , copies continuously. So goes — the glitch passes straight through to the output. This is the danger of transparency (Clocking and Timing).

D flip-flop (edge-triggered): it only samples at the clock edge. If no edge occurs during the glitch, is unaffected — it captured whatever was at the last edge. This edge-rejection is exactly why registers are built from flip-flops, not latches (Registers).

Answer: latch passes the glitch; flip-flop (if the glitch misses the edge) rejects it.

Recall Solution 5.2

Trace ( starts at 0):

  • t1: .
  • t2: .
  • t3: → hold → .
  • t4: .
  • t5: → hold → .

Answer row: 1 0 0 1 1.

Cross-check t4 with , using : Matches the trace → both methods agree.

Recall Solution 5.3

Each latch obeys its own copy of the master equation: While both are transparent, so they load . When drops to , both freeze at that value. Answer: stored value (decimal 2). This 2-bit array of latches sharing one enable is the seed idea behind a register.


Recall

Recall One-line self-tests
  • , any : output? ::: holds previous .
  • D latch as a MUX: select, input-0, input-1? ::: select , input-0 , input-1 .
  • builds what behaviour? ::: toggle when , hold when .
  • Why does a glitch pass through a latch but not a flip-flop? ::: latch is transparent (level), flip-flop samples only at an edge.

Connections