A T flip-flop walkthrough — toggle operation, truth table, use as a divide-by-2 counter, wiring steps, and an interactive flip-flop you can explore in the browser.
Sequential logic · 1 memory IC
A T flip-flop has a single data input. On each falling clock edge, T=0 leaves Q alone and T=1 flips it. Tie T high and Q switches on every clock, which makes the output exactly half the clock frequency: the heart of every binary counter.
Set T to 1, then press CLK repeatedly · Q makes one full cycle for every two clocks · hold PRE or CLR to force Q · flip the view above to see the waveforms
Parts bin
One IC holds the bit. There is no dedicated T flip-flop in the 74HC family, so a JK chip with J and K tied together does the job.
Reference
The chip has two identical flip-flops. These are the pins of the first one, with J and K wired together as T.
Behaviour
Values apply on each falling clock edge, with PRE and CLR inactive. The characteristic equation is Q(next) = T ⊕ Q: an XOR of the input with the current state.
Operating principle
Flip to the timing view above, set T=1 and pulse the clock a few times to watch Q run at half the clock frequency.
Choose T: 0 to hold, 1 to toggle.
Nothing happens to Q while the clock is steady.
On the clock's falling edge, the flip-flop reads T.
If T=1, Q flips once and holds until the next falling edge.
A T flip-flop (T for toggle) is the simplest memory cell that still does something interesting. It is a JK flip-flop with J and K joined, so the only two modes left are the two that matter: hold (T=0) and toggle (T=1).
With T held HIGH, Q changes on every falling clock edge. It takes two edges to go 0 → 1 → 0, so Q is a clock at half the input frequency. Feed Q of one stage into the clock of the next and each stage halves again: ÷2, ÷4, ÷8 and so on. That chain is a binary ripple counter.
Use T as an enable. With T=0 the stage ignores the clock completely and keeps its value, so you can gate when counting happens. The usual rule still applies: keep T steady for a tiny moment before the edge (setup time) and just after it (hold time).
PRE (Preset): pull it LOW and Q is forced to 1 immediately, without waiting for the clock.
CLR (Clear): pull it LOW and Q is forced to 0 immediately. Handy for starting a counter from a known state at power-up.
Both are asynchronous and active LOW. Holding both LOW at once is invalid, and the chip drives Q and Q̄ HIGH together.
Assembly
Seven steps. The same footprint becomes one stage of a counter later.
Straddle the chip across the centre gap, notch to the left, so pins 1–8 and 9–16 land in separate rows.
VCC (16) to the positive rail, GND (8) to the negative rail, with the 100 nF capacitor right beside the chip. Only one of the two flip-flops is used: tie the other half's PRE and CLR (10 and 14) to VCC, and its J, K and CLK (11, 12 and 13) to GND. Floating CMOS inputs pick up noise and waste power.
PRE (4) and CLR (15) are active LOW, so tie both straight to VCC for normal operation. Left floating, they can force the flip-flop at random.
Run a short jumper between J (3) and K (2) so they always see the same level. That shared node is your T input. Connect it to the slide switch, which selects +V (toggle) or GND (hold).
The clock pushbutton goes from +V to CLK (1), with a 10 kΩ resistor from CLK to GND so the pin reads a clean LOW until you press. The chip triggers on the falling edge, so the output updates when you release the button.
Q (5) and Q̄ (6) each drive an LED through its own 330 Ω resistor to GND. Exactly one LED should be lit at any time.
Set T to 1, then press and release the clock button a few times. Q flips on every release, so it completes one full cycle for every two clock pulses. Set T to 0 and the output freezes, whatever the clock does.
If it misbehaves
Almost always a bouncing clock button, J and K not truly joined, a floating PRE/CLR pin, or forgetting that the edge is the falling one.