1.2

Flip-Flops & Latches

Discover how digital circuits remember information. Watch clock signals trigger state changes in flip-flops, the fundamental building blocks of registers, counters, and computer memory.

Digital Logic FoundationsPrerequisite: Logic Gates
Scenarios:
SR Latch
State: Q=0
0
S
0
R
CLK
SRFlip-Flop
S
R
Q
Q'
0
Q
1
Q'
Q:0
Q':1
Clock Cycles0
Transitions0
Current StateQ=0
State Transitions
SRQ(t)Q(t+1)
0000 (Hold)
0011 (Hold)
0100 (Reset)
0110 (Reset)
1001 (Set)
1011 (Set)
110X (Invalid)
111X (Invalid)
Signal Colors
Clock
Q High
Q Low
Invalid
1.0x
Understanding the SR Latch

How It Works

The Set-Reset latch is the simplest memory element. Setting S=1 stores a 1 (sets Q=1), setting R=1 stores a 0 (resets Q=0). When both S and R are 0, the latch holds its previous state. S=1, R=1 is an invalid/forbidden condition that leads to an unpredictable state.

Real-World Applications

Used in debouncing circuits for mechanical switches, alarm systems (set by trigger, reset manually), and as building blocks for more complex flip-flops.

Key InsightThe SR latch is the most basic memory element but has a critical flaw: the S=1, R=1 condition is invalid because it tries to simultaneously set and reset the output, leading to an unpredictable race condition when both inputs return to 0.

Flip-Flop Comparison

TypeInputsHas Invalid?Can Toggle?Primary Use
SR
S, RYes (S=R=1)NoBasic storage
D
DNoNoData registers
JK
J, KNoYesVersatile logic
T
TNoYesCounters