D Latch with Clock
D latch demonstration with clock enable and oscilloscope. Learn level-triggered memory storage and timing analysis.
배울 내용
- Distinguish transparent mode (clock high) from hold mode (clock low).
- Trace D's effect on Q only while clock is high.
- Recognize that latches are level-sensitive, not edge-triggered.
- Understand setup/hold requirements around the clock falling edge.
- Build flip-flops by chaining two latches with opposite clock phases.
작동 원리
A clocked D latch adds a clock (or enable) input to the basic D latch. When clock = 1 (high), the latch is transparent — Q follows D directly. When clock = 0 (low), the latch is opaque — Q holds the last value it captured before the clock fell.
This level-sensitive behaviour is the defining feature of a latch (vs. a flip-flop, which is edge-triggered). The latch "opens" while the clock is high, letting D pass through; when the clock goes low, it "closes," trapping whatever D was at that moment.
Key timing considerations: - Transparency hazard: While clock is high, glitches on D propagate to Q. This is why latches are dangerous in synchronous design — output is sensitive to D for the full clock-high duration. - Setup/hold: D must be stable before and after the clock falls (the closing edge), or the latch may capture a wrong value or even enter a metastable state.
Latches were the standard storage element in early CPUs (Intel 4004, 8008) and are still used in master-slave flip-flops internally. Modern synchronous designs prefer edge-triggered flip-flops because their sample-on-edge behaviour is glitch-immune.
진리표
Latch behaviour by clock state. Q' is the previous Q value (memory).
| 입력 | 출력 | ||
|---|---|---|---|
| CLK | D | Q | |
| 0 | 0 | 0 | CLK low — Q holds previous value (here Q' = 0) |
| 0 | 1 | 0 | CLK low — Q holds. D's change ignored. |
| 1 | 0 | 0 | CLK high, D=0 → Q follows D = 0 (transparent) |
| 1 | 1 | 1 | CLK high, D=1 → Q follows D = 1 (transparent) |
불 대수식
When CLK = 1, Q follows D; when CLK = 0, Q holds its previous value.
단계별로 시도해 보세요
위 임베드에서 입력을 설정한 후, 예상 결과를 읽고 직접 확인하세요.
- 1CLK = 0 → 1 D = 1예상:
Q = 1관찰 포인트: Bring clock high while D = 1 — Q immediately follows. Transparent mode. - 2CLK = 1 D = 1 → 0예상:
Q = 0관찰 포인트: While clock is still high, change D — Q changes too. Latch is transparent throughout the high phase. - 3CLK = 1 → 0 D = 0예상:
Q = 0 (held)관찰 포인트: Clock falls to 0 — latch closes, Q holds whatever it was at the falling edge (here, 0). Now changes to D have no effect. - 4CLK = 0 D = 0 → 1예상:
Q = 0 (still held)관찰 포인트: Clock low, change D from 0 to 1 — Q stays 0. The latch ignores D in hold mode. Bring clock high again to capture the new D.
사용된 구성 요소
실제 응용 사례
Master-slave flip-flop construction. A D flip-flop is two D latches in series: master latches when clock is low, slave latches when clock is high. The combination samples on the clock edge.
Address latch enable (ALE). Some processors multiplex address and data on the same bus; an external D latch with ALE as the clock captures the address phase.
Wave-pipelined logic. High-speed designs sometimes use latch-based pipelines (instead of flip-flop pipelines) to overlap stage timing and squeeze more performance per clock cycle.
FIFO write enable. A FIFO's write-enable pulse can be used as a latch clock to capture the data into the head pointer.
Older microcontroller register files. Pre-1990s register files often used latches; modern ones use edge-triggered flip-flops.