โšก ELT 102 ยท Digital Logic & Solid State Devices Lesson 6 ยท Learning Activity
Unit 3 ยท Learning Activity

Latches & Flip-Flops

Read the eight device symbols, work through two paired analogies for level-sensitive and edge-triggered storage, then prove every behavior yourself in the Sequential Logic Lab.

๐Ÿ“ Symbol Library (8 devices) ๐Ÿš— Two Paired Analogies ๐Ÿ“ˆ Sequential Logic Lab + Timing Diagram โœ… 10-Question Knowledge Check

๐Ÿ“ Latch & Flip-Flop Symbol Library

Eight devices, one reading system. Latch symbols show only data and enable pins; flip-flop symbols add a clock pin marked with the edge triangle (โ–ท) โ€” the single visual cue that says "this device listens only at the clock transition." A bubble before the triangle would mean falling-edge triggering. Each card carries the device's characteristic table; red rows are forbidden.

R S Q Q̅
The Bistable Core
Two cross-coupled NOR gates โ€” each output holds the other's input. This feedback loop is the memory.
SR QQ̅
SR Latch
Set/Reset flag storage ยท remembers that a condition occurred
SRQ
00hold
101
010
11invalid
SENR QQ̅
Gated SR Latch
EN=1: responds to S/R ยท EN=0: ignores inputs, holds
ENSRQ
0xxhold
1101
1010
111invalid
DEN QQ̅
D (Transparent) Latch
EN=1: Q follows D live ยท EN=0: Q freezes ยท no invalid state
ENDQ
0xhold
100
111
SCLKR QQ̅
SR Flip-Flop
SR behavior, but only at the clock edge โ–ท ยท same invalid case
SRQ next
00hold
101
010
11invalid
DCLK QQ̅
D Flip-Flop
Q captures D at the edge, then ignores D ยท Qnext = D
DQ next
00
11
DENCLK QQ̅
D Flip-Flop + Enable
Loads at the edge only if EN=1 ยท conditional storage, same clock
ENDQ next
0xhold
100
111
JCLKK QQ̅
JK Flip-Flop ยท universal
The SR fix: J=K=1 toggles instead of being forbidden
JKQ next
00hold
101
010
11toggle
TCLK QQ̅
T (Toggle) Flip-Flop
T=1: Q inverts every edge ยท the divide-by-2 stage
TQ next
0hold
1toggle

๐Ÿš— Level vs. Edge: Two Paired Analogies

A latch is a window; a flip-flop is a camera. These two analogies are built as a matched pair โ€” same street, same cars, same one-bit question ("is a car there?") โ€” so the only thing that differs between them is when the answer gets recorded. That is exactly the difference between a latch and a flip-flop.

Level-sensitive (latch family)Edge-triggered (flip-flop family)
Analogy 1 ยท Level-sensitive ยท D latch

The One-Car Garage Door

ONE-CAR GARAGE = ONE BITdoor up: contents follow the drivewayneighbor turning around โ€”stored if door drops now!OPENER HELDEN = 1car inside = Q = 1 ยท empty = Q = 0

You hold the opener button, and the door stays up as long as you hold it. While it's up, the garage's contents simply follow the driveway: a car pulls in โ€” occupied; it backs out โ€” empty; it pulls in again โ€” occupied. The garage is transparent. Release the button, the door comes down, and whatever is inside at that moment stays there, no matter what happens on the driveway afterward.

The danger is the open interval. If a neighbor noses in to turn around just as the door drops, the neighbor's car is what you've stored. Every glitch on the input during the window can end up as the answer.

Button held (EN=1) โ†’ contents follow driveway (Q = D)
Button released (EN=0) โ†’ door down, contents frozen (hold)
Analogy 2 ยท Edge-triggered ยท D flip-flop

The Red-Light Camera

intersection (the data: car here or not?)GREEN โ†’ RED= the clock EDGEearlier car: ignoredlater cars:ignoredQ = 1snapshot per change

A red-light camera doesn't care how long the light has been red or green. It fires once, at the instant the signal changes to red, and records one fact: was a car in the intersection at that instant? The photo is kept until the next change. Cars that crossed a second earlier, or roll through a second later, never appear in it.

Its only vulnerable moment is the flash itself. A car sitting exactly on the stop line is the camera's version of a setup/hold violation โ€” was it in or out? That ambiguous photo is the traffic-court equivalent of metastability.

Light turns red (rising CLK edge) โ†’ one snapshot: Q = D at that instant
Any other time โ†’ camera blind (hold)
โš ๏ธ Where the Analogies Stop Being Accurate
A real garage door takes seconds to move; a latch responds in nanoseconds (its propagation delay). A real camera needs light and a shutter; a flip-flop's "flash" is a master-slave or pulse-capture circuit inside the chip, and its setup/hold window is measured in picoseconds to nanoseconds. And both analogies store one yes/no fact โ€” the one-car garage is deliberately small. A register is simply a row of garages (or cameras) sharing one button (or one traffic signal).
๐ŸŽฏ Classroom Activity: Human Latch vs. Human Flip-Flop (5 minutes)
Pick two students. The instructor raises and lowers a hand at random (that's D). Student A is the latch: whenever a second student holds up a green card (EN), A mirrors the instructor's hand continuously; when the card drops, A freezes. Student B is the flip-flop: B may move only at the instant the instructor claps (the clock edge), copying the hand position at that clap. Run 30 seconds, then ask the class: who moved more? Who copied the "mistake" when the instructor twitched? Then have the class sketch the EN/CLK, D, and both Q waveforms from memory and check the sketch in the Lab below.

๐Ÿ“ˆ Sequential Logic Lab โ€” Operation Simulator

All eight devices from the symbol library, live. The left side of the canvas shows the device with its current input and output states; the right side is a scrolling timing diagram recording everything you do. Toggle inputs with the buttons (or click the input pins on the canvas), pulse the clock manually to see edge-triggering, or switch on the auto-clock and watch behaviors like divide-by-2 draw themselves.

๐Ÿ’ก Input pins on the device symbol are clickable too.

Auto-clock (free-running)
๐Ÿ’ก Guided Explorations
1. Memory itself (SR Latch): pulse S on then off โ€” Q stays set with both inputs at 0. That hold is the bistable remembering. 2. The forbidden state: set S=1 and R=1 โ€” read the red INVALID warning, then release both and notice the outcome is arbitrary. 3. Gating (Gated SR): wiggle S with EN=0 โ€” nothing; raise EN โ€” instant response. 4. Transparency (D Latch): toggle D rapidly with EN=1 and watch Q chase it in the timing lanes; drop EN and the chase freezes. 5. The camera (D FF): change D two or three times without pulsing the clock โ€” Q ignores everything; now pulse once โ€” Q captures only the value at the edge. 6. Universal toggle (JK): J=K=1, auto-clock on โ€” Q flips every rising edge. 7. Divide-by-2 (T FF): T=1, auto-clock on โ€” count edges in the CLK lane vs the Q lane: exactly 2:1, frequency division drawn live.

Interactive Knowledge Check

Test your understanding with ten questions. Select your answers and click "Submit Answers" for your score and detailed feedback.

Score: 0 / 10

Please complete all questions to view your results.

โ† Lesson 5: Gates & Boolean Algebra ๐Ÿ  ELT 102 Home Next: Lesson 7 โ†’