Hello Guest

Sign in / Register

Welcome,{$name}!

/ Logout
English
EnglishDeutschItaliaFrançais한국의русскийSvenskaNederlandespañolPortuguêspolski繁体中文SuomiGaeilgeSlovenskáSlovenijaČeštinaMelayuMagyarországHrvatskaDanskromânescIndonesiaΕλλάδαБългарски езикGalegolietuviųMaoriRepublika e ShqipërisëالعربيةአማርኛAzərbaycanEesti VabariikEuskeraБеларусьLëtzebuergeschAyitiAfrikaansBosnaíslenskaCambodiaမြန်မာМонголулсМакедонскиmalaɡasʲພາສາລາວKurdîსაქართველოIsiXhosaفارسیisiZuluPilipinoසිංහලTürk diliTiếng ViệtहिंदीТоҷикӣاردوภาษาไทยO'zbekKongeriketবাংলা ভাষারChicheŵaSamoaSesothoCрпскиKiswahiliУкраїнаनेपालीעִבְרִיתپښتوКыргыз тилиҚазақшаCatalàCorsaLatviešuHausaગુજરાતીಕನ್ನಡkannaḍaमराठी
Home > Blog > T Flip-Flop: Working Principle, Truth Table, Circuit, and Applications

T Flip-Flop: Working Principle, Truth Table, Circuit, and Applications

A T flip-flop is an edge-triggered sequential logic circuit that stores one bit and changes its output state when toggling is enabled. Unlike a D flip-flop, which captures an input value, a T flip-flop either retains or inverts its previous state at the active clock edge. Understanding its truth table, circuit connections, and timing behavior helps in designing binary counters, frequency dividers, and toggle-based control circuits.

Catalog

1. T Flip-Flop Operation
2. T Flip-Flop Truth Table and Characteristic Equation
3. T Flip-Flop Circuit Construction
4. T Flip-Flop Timing Diagram
5. T Flip-Flop Frequency Division
6. T Flip-Flop vs. JK Flip-Flop vs. D Flip-Flop
7. Applications of T Flip-Flops
8. T Flip-Flop Design Considerations
9. Conclusion

CD4027B Dual JK Flip-Flop for T Operation

T Flip-Flop Operation

A T flip-flop has two stable output states, logic 0 and logic 1. Its T input selects hold or toggle operation, while the clock determines when that selection takes effect.

T Flip-Flop Symbol and Inputs

Figure 2 shows a positive-edge-triggered T flip-flop. The triangle at CLK identifies the active rising edge, and Q̅ is the complementary output during normal operation.

T Flip-Flop Symbol and Inputs

The clock input symbol indicates the triggering edge:

Positive-edge-triggered: A triangle without an inversion bubble indicates operation on the LOW-to-HIGH clock transition.

Negative-edge-triggered: A triangle with an inversion bubble indicates operation on the HIGH-to-LOW transition.

Hold and Toggle States

When T = 0, the flip-flop holds its previously stored state. Clock pulses can continue, but Q remains unchanged as long as no asynchronous control overrides it.

When T = 1, the flip-flop inverts Q at each active clock edge. If Q is initially 0, the next state becomes 1. At the following qualifying clock edge, it returns to 0.

The toggling operation depends on the active clock edge rather than a change in the T signal itself. For example, setting T HIGH while the clock is stationary does not change Q in a normal edge-triggered configuration.

This distinction separates synchronous state changes from asynchronous preset or reset functions. Devices such as the Texas Instruments CD4027B change their normal JK-controlled state on the rising clock edge, while their dedicated Set and Reset inputs can override the clock.

T Flip-Flop Truth Table and Characteristic Equation

The T flip-flop truth table describes the next output state using the current value of Q and the logic level applied to T. Its characteristic equation expresses the same behavior in Boolean algebra.

T Flip-Flop Truth Table

CLK
T
Qₙ
Qₙ₊₁
Action
↑
0
0
0
Hold
↑
0
1
1
Hold
↑
1
0
1
Toggle
↑
1
1
0
Toggle

Where:

CLK is the clock signal, and ↑ represents its active rising edge.

T is the toggle input.

Qₙ is the present output state.

Qₙ₊₁ is the state after the active clock edge.

The table assumes a positive-edge-triggered flip-flop, valid input timing, and inactive asynchronous preset or reset controls. For a negative-edge-triggered device, the same state relationships apply at the falling edge, represented by ↓.

Characteristic Equation and XOR Logic

The characteristic equation describes the relationship between the present state, toggle input, and next state:

Qn+1 = TQn + TQn

Where:

Qₙ₊₁ is the next output state.

Qₙ is the present output state.

T is the toggle input. These variables are dimensionless binary logic values.

The overbar represents logical NOT.

Multiplication represents logical AND.

Addition represents logical OR.

The first term preserves Q when T is LOW. The second term produces the inverted state when T is HIGH.

This expression is equivalent to the Exclusive-OR (XOR) function:

Qn+1 = T ⊕ Qn

XOR produces 1 when its two inputs differ and 0 when they are equal. The SN74HC86, for example, contains four independent two-input XOR gates implementing this Boolean operation.

The equation describes the logical state after a qualifying clock event. It does not imply that the output responds instantaneously, because physical flip-flops have propagation delays.

T Flip-Flop Circuit Construction

A T flip-flop can be constructed from other edge-triggered flip-flops without requiring a dedicated T-type device. Two practical methods use a JK flip-flop with connected data inputs or a D flip-flop with XOR feedback.

T Flip-Flop Using a JK Flip-Flop

Figure 3 shows how a common T signal drives both J and K, selecting either hold or toggle operation.

T Flip-Flop Using a JK Flip-Flop

A JK flip-flop has J and K data inputs and a clock input. Its normal next-state equation is:

Qn+1 = JQn + KQn

Connecting J and K creates one common toggle input:

J = K = T

A suitable implementation is the Texas Instruments CD4027B, a CMOS device containing two independent positive-edge-triggered JK flip-flops. Each stage has individual J, K, Clock, Set, and Reset inputs, together with complementary outputs.

For channel 1 of the 16-pin CD4027B, connect J1 (pin 10) and K1 (pin 11) to T, CLOCK1 (pin 13) to CLK, VDD (pin 16) to the positive supply, and VSS (pin 8) to ground. Q1 is available at pin 15. Hold the active-HIGH SET1 (pin 9) and RESET1 (pin 12) LOW during normal operation. An optional reset control can assert RESET1 HIGH, and local supply decoupling should be placed close to the IC. The manufacturer specifies a recommended supply-voltage range of 3 V to 18 V. Keep every unused CMOS input at a defined logic level.

Figure 3A shows the practical channel-1 connections while Figure 3 retains the functional J = K = T representation.

CD4027B Channel 1 Connections for T Flip-Flop Operation

A useful distinction is that this method requires an edge-triggered JK circuit. Simply connecting the inputs of a basic level-sensitive JK latch does not necessarily produce stable single-transition operation. In a level-sensitive feedback circuit, the state may change repeatedly while the clock remains active, producing a race-around condition.

T Flip-Flop Using a D Flip-Flop

Figure 4 routes Q back through an XOR gate so that the next D value depends on both T and the stored state.

T Flip-Flop Using a D Flip-Flop

A D flip-flop stores the logic value applied to its D input when the specified clock edge occurs. Its next-state relationship is:

Qn+1 = D

To reproduce T flip-flop behavior, the D input must equal the current state when T = 0 and its complement when T = 1.

An XOR gate provides both conditions:

D = T ⊕ Qn

The Texas Instruments SN74HC74 provides two independent positive-edge-triggered D flip-flops with asynchronous preset and clear inputs. It can be combined with an SN74HC86 XOR gate to implement this arrangement.

For standard 14-pin packages, connect SN74HC74 Q1 (pin 5) and T to SN74HC86 XOR inputs 1A (pin 1) and 1B (pin 2), then connect XOR output 1Y (pin 3) to SN74HC74 D1 (pin 2). Apply CLK to SN74HC74 1CLK (pin 3). Both ICs use VCC on pin 14 and GND on pin 7. Hold the SN74HC74 active-LOW 1PRE (pin 4) and 1CLR (pin 1) HIGH during normal operation. Both devices support a recommended 2 V to 6 V supply range. Place a 0.1 µF bypass capacitor close to each IC and keep unused CMOS inputs at defined logic levels.

Figure 4A adds the physical IC connections that are omitted from the functional XOR-feedback diagram in Figure 4.

SN74HC74 and SN74HC86 T Flip-Flop Implementation

A D flip-flop does not continuously follow its D input whenever the clock is HIGH. Its output captures D at the specified active edge, provided the required setup and hold intervals are met.

T Flip-Flop Timing Diagram

Figure 5 shows that T is sampled at each rising clock edge. Q changes only when T is HIGH at that edge, assuming inactive asynchronous controls and valid input timing.

T Flip-Flop Timing Diagram

Assume the flip-flop begins with Q = 0. At t₁, T is LOW, so the first rising clock edge leaves Q unchanged. At t₂, T is HIGH, causing Q to become 1 after the device's propagation delay.

T remains HIGH at t₃, so Q returns to 0. At t₄, T is LOW, and the output holds its state. The next two rising edges, t₅ and t₆, occur with T HIGH, producing two additional output transitions.

The falling edges between these events do not change Q in this positive-edge-triggered example.

For a negative-edge-triggered device, interpret the waveform at HIGH-to-LOW clock transitions instead. The SN74LS76A is an older LS-family example documented in TI’s SDLS121 datasheet.

The timing diagram represents ideal logical behavior with a small illustrative output delay. Actual transitions depend on clock-to-output propagation delay, input timing, output loading, supply voltage, and operating temperature.

T Flip-Flop Frequency Division

A T flip-flop can divide a periodic clock frequency by two when T remains HIGH. Under this condition, Q changes state at every active clock edge, completing one HIGH-to-LOW-to-HIGH cycle after two clock periods.

For continuous periodic operation:

fQ = fCLK / 2

Where:

fQ is the output frequency in hertz (Hz).

fCLK is the input clock frequency in hertz (Hz).

The relationship also means that the output period is twice the input clock period:

TQ = 2TCLK

TQ and TCLK are the output and input periods in seconds. These period symbols are distinct from the toggle input T.

Figure 6 is a ripple configuration. The external input clock drives only the first stage. Q0 then serves as the clock for the second stage, and Q1 serves as the clock for the third stage. The idealized waveforms omit ripple propagation delays.

Three-Stage Ripple T Flip-Flop Frequency Divider

Calculated Example for a Three-Stage Divider

Consider a periodic 1 kHz external clock applied to the first stage in Figure 6, with every T input held HIGH. The first stage output is 500 Hz, that 500 Hz output clocks the second stage to produce 250 Hz, and the second-stage output clocks the third stage to produce 125 Hz.

For the first stage:

f1 = 1000 Hz / 2 = 500 Hz

The second stage divides the preceding frequency by two:

f2 = 500 Hz / 2 = 250 Hz

The third stage produces:

f3 = 250 Hz / 2 = 125 Hz

The general equation for an ideal cascade of n divide-by-two stages is:

fout = fCLK / 2n

fout is the final output frequency in hertz, fCLK is the input clock frequency in hertz, and n is the dimensionless number of cascaded stages.

These are calculated steady-state frequencies, not measured results. The example assumes a periodic clock, valid logic transitions, properly connected stages, and device timing limits that permit the selected frequencies.

An ideal continuously toggling output has a 50% duty cycle because its HIGH and LOW intervals each occupy one input clock period. Actual duty-cycle accuracy depends on device timing characteristics and the input waveform.

In a ripple counter, the clock transition propagates through successive stages. The outputs therefore do not all update simultaneously. Propagation delays must be considered when downstream logic interprets multiple counter outputs together.

Figure 6 uses negative-edge-triggered stages with Q driving the next clock input. The positive-edge-triggered CD4027B described in Section 3.1 can be used for the same ripple count sequence by clocking each following stage from the preceding complementary output Q̅, so the next stage responds when the preceding Q output falls. The required connection depends on the desired count sequence and phase relationship.

Ripple vs. Synchronous T Flip-Flop Counters

A ripple counter cascades clock connections, so each stage changes only after the preceding stage output propagates to its clock input. The delays therefore accumulate through the chain, and multiple counter bits do not change at the same instant.

A synchronous counter instead applies one shared clock to all flip-flops. For a three-bit binary up-counter built from T functions, the toggle conditions are:

T0 = 1

T1 = Q0

T2 = Q0Q1

These equations make Q0 toggle on every active edge, Q1 toggle when Q0 is HIGH, and Q2 toggle when Q0 and Q1 are both HIGH. Because all stages use the same clock, the design avoids the cascaded clock path used by a ripple counter.

For FPGA designs, use a shared system clock with synchronous counter logic or clock-enable conditions rather than implementing a ripple chain from register outputs. Altera’s Quartus Prime Pro guidance documents counter coding in Section 1.6.8 and specifically recommends avoiding ripple counters in Section 2.2.3.3 because generated ripple clocks complicate timing analysis.

T Flip-Flop vs. JK Flip-Flop vs. D Flip-Flop

T, JK, and D flip-flops each store one bit, but their normal clocked input behavior and implementation requirements differ. Table 2 compares the input and next-state distinctions without treating one flip-flop type as inherently faster or more efficient.

Flip-Flop
Data Inputs
Next-State Rule
Clocked Operation
Implementation Requirements
T
T
Qn+1 = T ⊕ Qn
T = 0 holds; T = 1 toggles at the active clock edge.
Requires a T function directly, a JK flip-flop with J = K = T, or a D flip-flop with XOR feedback.
JK
J, K
Qn+1 = JQn + KQn
J and K select hold, set, reset, or toggle behavior at the active clock edge.
Requires an edge-triggered JK flip-flop or equivalent logic. Any asynchronous set or reset controls are separate from J and K.
D
D
Qn+1 = D
Captures the applied D value at the active clock edge, so the next state equals the sampled data value.
Requires a D flip-flop. T behavior requires feedback logic such as D = T ⊕ Q.

Comparison assumes normal clocked operation with asynchronous controls inactive.

These differences describe logical functions rather than device-level performance. Actual supply voltage, timing limits, propagation delay, power consumption, output drive, and compatibility depend on the selected IC and implementation, not simply on whether the function is T, JK, or D. The CD4027B, SN74HC74, and SN74LS76A should not be treated as interchangeable without checking their device specifications.

Applications of T Flip-Flops

T flip-flops are useful when a stored output must alternate between two states after accepted clocked events.

Binary counters use T behavior to change selected bits as a count advances. Frequency dividers use the same toggling action to derive lower-frequency signals, while the detailed divide-by-two and multi-stage relationships are covered in Section 5.

A practical event-toggle application is a pushbutton-controlled LED state. The button signal should first be debounced, then synchronized to the system clock, and converted into one clock-cycle toggle-enable pulse for each accepted press.

That one-cycle pulse drives T HIGH for one active clock edge, so Q changes state once per accepted press. Contact bounce and a sustained HIGH button level therefore do not cause repeated output changes. Q can control an LED through an appropriate current-limiting resistor or driver selected for the IC and supply conditions. Figure 7 is an illustrative design concept, not a report of measured hardware performance.

Figure 7 shows the signal-conditioning path for the illustrative pushbutton-controlled LED toggle.

Pushbutton-Controlled LED Toggle Using a T Flip-Flop

T Flip-Flop Design Considerations

Correct logical connections do not guarantee reliable physical operation. A T flip-flop circuit must also meet its clocking requirements, input voltage limits, output loading conditions, and initialization requirements.

Clock Timing and Initial State

A physical flip-flop has timing restrictions that must be satisfied before its output behavior can be predicted reliably.

• Setup time: The minimum interval for which the data input must remain stable before the active clock edge.

• Hold time: The required interval for which the input remains stable after the active edge.

• Clock pulse width: The minimum HIGH or LOW clock duration specified for valid operation.

• Propagation delay: The time between a qualifying input or clock event and the corresponding output transition.

• Maximum clock frequency: The device-specific clock-rate limit under the stated operating conditions.

The SN74HC74 datasheet specifies timing requirements and switching characteristics under defined supply voltage and temperature conditions. Its values should not be applied directly to a CD4027B or another flip-flop family.

For the D-plus-XOR implementation, the setup timing budget for a common-clock design can be written as:

TCLK ≥ tCQ,max + tXOR,max + tsetup + tuncertainty

The terms represent the maximum clock-to-Q delay of the flip-flop, the maximum XOR propagation delay, the D-input setup time, and an appropriate allowance for clock and timing uncertainty. Numerical values should be taken from the SN74HC74 and SN74HC86 datasheets under consistent supply-voltage, temperature, and loading conditions.

The minimum feedback-path delay must also satisfy the SN74HC74 hold-time requirement at D. A hold violation is a minimum-delay problem and cannot be corrected simply by lowering the clock frequency.

The initial output state is another design consideration. A flip-flop without a controlled initialization sequence may power up with an unknown state. A preset input can establish Q = 1, while a clear or reset input can establish Q = 0, depending on the device's supported control functions.

The CD4027B has active-HIGH asynchronous Set and Reset inputs. The SN74HC74 instead provides active-LOW asynchronous preset and clear inputs. These controls should not be assumed to have the same polarity.

Keep asynchronous controls inactive at defined logic levels during normal operation. Avoid asserting preset and clear together. Follow the device requirements for their pulse widths and release timing relative to CLK.

Check logic thresholds, supply range, drive capability, and loading across connected devices. Provide local supply bypassing and keep unused CMOS inputs at defined levels according to the manufacturer’s recommendations.

Functional Testing

A functional test can establish whether the circuit holds its stored state when T is LOW and toggles correctly when T is HIGH.

Required Equipment: A suitable regulated power supply, a clock or pulse generator, an assembled T flip-flop circuit, and a logic analyzer or oscilloscope. Use only low-voltage circuits operating within the selected components' recommended conditions.

Test Procedure

1. With power disconnected, verify the circuit connections, supply polarity, clock input, and preset or clear wiring against the applicable manufacturer pinout.

2. Apply the recommended supply voltage, establish a known Q state, and release initialization with the timing required by the datasheet.

3. Set T = 0 and apply several valid clock pulses. Confirm that Q remains at its initial state.

4. Set T = 1, keeping the signal stable across the required setup and hold intervals.

5. Apply additional clock pulses and observe Q changing after each active clock edge.

6. With T continuously HIGH and a periodic clock applied, measure the output frequency and compare it with the calculated divide-by-two value.

The observations should agree with Table 1 and the device’s triggering polarity.

Diagnosing Incorrect Operation

If Q remains fixed, check CLK and T at the actual device pins and confirm that asynchronous controls are inactive. If Q changes unexpectedly, check for incorrect wiring, slow clock edges, noise, switch bounce, or supply disturbances.

A circuit that fails as frequency increases may violate setup time, pulse width, or clock-rate limits. Input changes near the active edge can violate setup or hold timing and cause unpredictable behavior. Compare measured waveforms with the datasheet at the actual supply voltage and loading.

Conclusion

A T flip-flop holds or inverts one stored bit at the selected clock edge. JK input coupling and D-plus-XOR feedback provide practical ways to implement the function. Reliable counters, dividers, and toggle controls depend on correct edge selection, valid timing, a known initial state, and compatible device operating conditions.






Frequently Asked Questions [FAQ]

1. Can a T Flip-Flop Be Implemented in an FPGA?

Yes. Describe a clocked register that holds its state when T is LOW and inverts it when T is HIGH. Synthesis maps the behavior to the target FPGA’s register and logic resources. The exact implementation depends on the device and synthesis tool.

2. What Should Be Done With the Unused Flip-Flop in a Dual IC?

Unused inputs should be connected to defined logic levels that comply with the manufacturer's recommendations. An unused flip-flop should not have floating CMOS inputs. Confirm the required connections and permitted output handling in the applicable manufacturer datasheet.

3. Can a T Flip-Flop Operate Without a Complementary Q̅ Output?

Yes. The T flip-flop function only requires its stored state Q and the toggle control. If a complementary output is needed but unavailable, an external inverter can produce it, with additional propagation delay.

4. Can a T Flip-Flop Be Used to Generate an Arbitrary Frequency Division Ratio?

A continuously enabled single T flip-flop produces a divide-by-two output. Other integer division ratios require additional counting or control logic, and the resulting output duty cycle may not be 50%. The selected circuit must be evaluated for the required output frequency, timing, and duty cycle.

Related Blog