Home
LogicRoo / Sequential Circuits / T Flip-Flop Circuit
SEQUENTIAL · FLIP-FLOP

T Flip-Flop Circuit

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

Hold it, or toggle it.

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.

1Data input T
2Modes: hold, toggle
÷2Divides the clock by two
74HC112Memory IC
Set T, then pulse CLK, or flip the view to see the clock being halved →
SCH-05 · 74HC112_TFF
mode hold
⇄ Show timing diagram
Q
Q̄
T0 Q0 Q̄1 Clocks0 Q cycles0
Falling edges0 Q0
T0
CLK · pulse ↓
PRE · set Q
CLR · reset Q

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

What you need

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.

×1 74HC112 — dual JK flip-flop IC (one half used, J and K tied) IC1
×1 Slide switch (SPDT) — T input SW-T
×1 Pushbutton — clock SW-CLK
×2 LED — Q and Q̄ indicators LED1–2
×2 330 Ω Resistor — LED current limit R1–R2
×1 10 kΩ Resistor — CLK pull-down R3
×1 100 nF Capacitor — supply decoupling C1
×1 Breadboard BASE
×— Jumper Wires BASE
×1 5V Supply (2–6V accepted) PWR

Reference

74HC112 pin overview (flip-flop 1)

The chip has two identical flip-flops. These are the pins of the first one, with J and K wired together as T.

PinNumberTypeWhat it does
VCC 16 Power Supply voltage, +2V to +6V
GND 8 Power Ground, 0V
1J 3 Input Tied to 1K: together they form the T input
1K 2 Input Tied to 1J: together they form the T input
1CLK 1 Input Clock, triggers on the HIGH → LOW edge
1PRE 4 Input Preset, active LOW: forces Q = 1 at once
1CLR 15 Input Clear, active LOW: forces Q = 0 at once
1Q 5 Output The stored bit
1Q̄ 6 Output Always the opposite of Q

Behaviour

Truth table

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.

TQ(next)Q̄(next)Action
0 Q Q̄ Hold
1 Q̄ Q Toggle

Operating principle

How a T flip-flop decides

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.

01

Choose T: 0 to hold, 1 to toggle.

02

Nothing happens to Q while the clock is steady.

03

On the clock's falling edge, the flip-flop reads T.

04

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).

Two control pins worth knowing

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

Building it on a breadboard

Seven steps. The same footprint becomes one stage of a counter later.

Seat the 74HC112

Straddle the chip across the centre gap, notch to the left, so pins 1–8 and 9–16 land in separate rows.

Power it and park the unused half

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.

Disable preset and clear

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.

Join J and K into one T input

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).

Wire the clock

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.

Add the output LEDs

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.

Power up and test it

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

Jumpy, stuck, or both LEDs lit

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.

  • Q changes on release, not on press — that is correct. The 74HC112 triggers on the falling edge, so the change happens when CLK goes from HIGH back to LOW.
  • Q toggles several times per click — the pushbutton is bouncing and sending a burst of clock edges; feed the clock from a debounced source, such as an SR-latch debouncer.
  • Q only ever sets, or only ever resets — J and K are not really tied together. Only one of them is on the T node and the other is floating or on a fixed level.
  • Q never toggles — T is LOW (hold), or the clock wire is on pin 13 (the second flip-flop) instead of pin 1.
  • Q is stuck at 0 or 1 and ignores the clock — PRE or CLR is floating or LOW; tie both to VCC.
  • Both LEDs are lit — PRE and CLR are LOW at the same time, which is an invalid combination for this chip.
  • The first state after power-up is random — that is normal. A flip-flop has no defined start state, so pulse CLR once to start from a known 0.