To toggle a bit is to flip it: Q⁺ = . A 0 becomes 1 and a 1 becomes 0.
Three common ways a flip-flop toggles at a clock edge:
- A T flip-flop with T = 1.
- A JK flip-flop with J = K = 1.
- A D flip-flop with wired back to D.
The key fact about toggling: you must know the current Q to know the result. Toggle is relative, unlike set or reset, which always give the same answer.
Why it matters:
- A flip-flop that toggles every edge produces a square wave at half the clock frequency: a frequency divider.
- In a binary counter, bit 0 toggles every count, bit 1 toggles when bit 0 is 1, bit 2 toggles when bits 1 and 0 are both 1, and so on.
- XOR is the gate form of a conditional toggle: equals when T = 1 and Q when T = 0.
Parity shortcut: after k toggles, Q is back where it started if k is even and flipped if k is odd.