Parts
74HC74 dual D flip-flop: pinout, PRE and CLR, divide-by-2 speed and a push-button toggle
By Bulan Sarkar
The 74HC74 holds two separate D flip-flops in one 14-pin package. Each one copies its D input to Q on the rising edge of its clock and keeps it until the next edge. Pin 14 is VCC and pin 7 ground. Flip-flop 1 uses pins 1 to 6 (/CLR, D, CLK, /PRE, Q, /Q); flip-flop 2 uses pins 13 down to 8 (/CLR, D, CLK, /PRE, Q, /Q), so its outputs come out in the opposite order: /2Q on pin 8, 2Q on pin 9.
PRE and CLR are active low and act at once, without the clock. Hold both high for normal work. The usual jobs are halving a clock and turning a push button into an on/off switch; this page works through both with the numbers from Texas Instruments' SN74HC74 sheet (SCLS094F), plus the HCT and LVC versions from TI's own sheets.
Pinout by package
Top view, notch up: pin 1 (/1CLR) is top left. Flip-flop 1 takes pins 1 to 6 down the left side; flip-flop 2 takes pins 8 to 13 up the right side, with its inverted output on pin 8 and Q on pin 9.
The SOIC (SN74HC74D), SSOP (DB) and TSSOP (PW) versions use the same pin numbers.
Source: Texas Instruments SNx4HC74 Dual D-Type Positive-Edge-Triggered Flip-Flops With Clear and Preset (SCLS094F), p. 3 (D, DB, N, NS, PW, J or W package top view, and the pin functions table); Texas Instruments SNx4HC74 Dual D-Type Positive-Edge-Triggered Flip-Flops With Clear and Preset (SCLS094F), p. 1 (Device information: N (PDIP, 14), 19.30 mm × 6.40 mm)
Truth table: PRE, CLR, CLK and D
With PRE and CLR both high, the flip-flop does one thing: on each rising clock edge, Q takes the level on D and /Q takes the opposite. Between edges, D can do what it likes. Pull PRE low and Q goes high straight away; pull CLR low and Q goes low.
With PRE and CLR both low, Q and /Q both go high, which is not a real state. TI notes it does not persist: whichever pin is released last decides where Q ends up, and if both are released together you cannot know. Never drive both at once on purpose.
Absolute maximum ratings
| Parameter | SN74HC74NDIP-14 |
|---|---|
| Supply voltage, absolute maximum VCC | −0.5 to 7 V |
| Supply voltage, recommended VCC | 2 to 6 V (5 V nominal) |
| Input and output voltage, recommended VI, VO | 0 to VCC |
| Continuous output current, per pin IO | ±25 mA |
| Current through VCC or GND | ±50 mA |
| Input and output clamp current IIK, IOK | ±20 mA |
| ESD, human body model / charged device V(ESD) | ±2000 V / ±1500 V |
| Thermal resistance, PDIP-14 / SOIC-14 / TSSOP-14 RθJA | 61.9 / 133.6 / 151.7 °C/W |
| Operating temperature TA | −40 to 85 °C (SN74) |
| Input rise or fall time, max Δt/ΔvVCC = 4.5 V | 500 ns |
The output limit is 25 mA per pin and 50 mA through VCC or ground for the whole chip. That is enough for an indicator LED on each output at a few milliamps, but these are logic outputs, and TI writes its output figures at 4 mA.
Input levels, output drive and timing
| Parameter | SN74HC74NDIP-14 |
|---|---|
| High-level input voltage, min VIH4.5 V / 6 V | 3.15 V / 4.2 V |
| Low-level input voltage, max VIL4.5 V / 6 V | 1.35 V / 1.8 V |
| Output high, min VOHIOH = −4 mA, 25 °C / to 85 °C | 3.98 V (4.3 V typ) / 3.84 V |
| Output low, max VOLIOL = 4 mA, 25 °C / to 85 °C | 0.26 V (0.17 V typ) / 0.33 V |
| Supply current, max ICC6 V, inputs at a rail | 4 µA (25 °C), 40 µA (to 85 °C) |
| Clock frequency, max fclock25 °C / to 85 °C | 31 MHz / 25 MHz |
| Clock high or low time, min twto 85 °C | 20 ns |
| PRE or CLR low time, min twto 85 °C | 25 ns |
| Data setup before the clock edge, min tsu25 °C / to 85 °C | 20 ns / 25 ns |
| Data hold after the clock edge, min th | 0 ns |
| CLK to Q or Q-bar, max tpdCL = 50 pF, 25 °C / to 85 °C | 35 ns (20 ns typ) / 44 ns |
| PRE or CLR to Q or Q-bar, max tpdCL = 50 pF, to 85 °C | 58 ns |
| Power dissipation capacitance Cpdper flip-flop, typical, no load | 35 pF |
The input thresholds are 0.7 and 0.3 of VCC at both supplies TI lists, so on 5 V a high must be at least 3.5 V and a low at most 1.5 V. A 3.3 V controller's high falls 0.2 V short; the HCT74 in the substitutes table fixes that.
Setup and hold around the clock edge
D has to be steady for a setup time before the rising edge: 25 ns at 4.5 V up to 85 °C (20 ns at 25 °C). The hold time is 0 ns, so D may change the moment the edge has passed. Q shows the new value within 44 ns of the edge, measured into a 50 pF load.
The zero hold time is what lets one flip-flop feed another on the same clock: the second one has already taken its D before the first one's Q starts to move. It is also what makes the divide-by-2 below work.
Worked example: halving a 16 MHz clock
Tie D to /Q and every rising edge flips the output, so Q runs at half the clock. Chain a second flip-flop off the first one's Q and you get a quarter. From a 16 MHz crystal clock, the two outputs give 8 MHz and 4 MHz.
The clock-frequency row allows 16 MHz: it gives 25 MHz up to 85 °C. The loop itself is tighter than that row suggests. After an edge, /Q takes up to 44 ns to change, and it must then sit on D for 25 ns before the next edge.
1. The period. 1 / 16 MHz = 62.5 ns, high and low 31.25 ns each, above the 20 ns minimum width.
2. Worst case, 4.5 V, 85 °C. 44 ns + 25 ns = 69 ns, so the sheet's numbers guarantee the loop only to 14.5 MHz. 62.5 ns is 6.5 ns short.
3. At 25 °C. 35 ns + 20 ns = 55 ns, good to 18.2 MHz: 16 MHz passes with 7.5 ns spare.
In practice it works: the 44 ns figure is measured into 50 pF, and /Q here drives one input of at most 10 pF, so the real delay is shorter. But the sheet does not promise it at 85 °C. For a board that has to be sure, run the chip at a supply above 5 V (60 ns at 6 V), or use the 74LVC74A on 3.3 V, which TI rates to 100 MHz. The second stage only sees 8 MHz, so it has plenty of room, and its output settles 88 ns after the input edge, two delays in a row.
Worked example in numbers
- Clock limit, to 85 °C
- 25 MHz
- Divide-by-2 loop, worst case
- 14.5 MHz
- Setup / hold
- 25 / 0 ns
- Power-on reset held
- 3.57 ms
A push button that toggles: TI's circuit
TI's application section uses one flip-flop as a toggle switch: D tied to /Q, the button on CLK, so each press flips Q. Two details decide whether it works.
Power-on reset. A flip-flop can wake up either way. TI puts an RC on CLR so Q always starts low: with 10 kΩ to VCC and 1 µF to ground, CLR stays under 1.5 V for 3.57 ms after power-on and passes 3.5 V at 12 ms. The sheet needs only 25 ns of CLR low, so this is generous.
The button needs a Schmitt trigger. A contact bounces, so most builders smooth it with an RC. But a 100 kΩ and 100 nF debounce (10 ms) takes 8.47 ms to cross from 1.5 V to 3.5 V. The HC74's clock input asks for an edge faster than 500 ns, about 16,946 times quicker. A slow edge on a plain CMOS input can oscillate as it crosses the threshold and clock the flip-flop several times per press. TI's text says the same: debounce the switch, then pass it through a Schmitt-trigger buffer such as one gate of a 74HC14 before CLK.
CLR can take the slow RC directly. While it rises, the input may draw extra current for a few milliseconds, but every wobble only clears a flip-flop that is already clear.
What it draws when busy
Standing still, the chip draws at most 40 µA up to 85 °C. Clocking costs more: each flip-flop has a power dissipation capacitance of 35 pF. One flip-flop clocked at 16 MHz on 5 V draws 35 pF × 5 V × 16 MHz = 2.8 mA, or 14 mW, before the current that charges whatever the outputs drive. Fit 100 nF from VCC to ground right at pin 14, as TI asks.
Tips and checks
- Pins 8 and 9 are /2Q then 2Q, the reverse of flip-flop 1's pins 5 and 6. Check them on a new layout.
- Tie PRE and CLR high when unused. Never pull both low together.
- Tie every input of an unused flip-flop to VCC or ground.
- Feed CLK from a clean logic edge. A button or an RC goes through a Schmitt trigger (74HC14) first.
- For divide-by-2, wire D to /Q on the same flip-flop; for divide-by-4, clock the second flip-flop from the first one's Q.
- On 5 V, a 3.3 V controller cannot reliably clock the HC74: it needs 3.5 V. Fit an HCT74.
Substitutes
A 74HC74 from another maker drops into the same socket. The HCT and LVC parts below share the pinout but differ in supply range and input levels; check those first.
Bench check: is it working?
- Wire VCC to pin 14, ground to pin 7, 100 nF across them. Tie /1PRE (pin 4) and /1CLR (pin 1) to VCC.
- Put an LED and 1 kΩ from 1Q (pin 5) to ground. Tie the second flip-flop's pins 10 to 13 to VCC.
- Set 1D (pin 2) high, then touch 1CLK (pin 3) from ground to VCC with a wire: the LED lights.
- Set 1D low and give CLK another rising edge: the LED goes out.
- Briefly ground /1PRE: the LED lights without any clock. Ground /1CLR: it goes out.
A wire touched by hand bounces like a button, but with D held steady the extra edges change nothing. The switches lesson shows what that bounce looks like, and the logic levels lesson covers the 0.7 and 0.3 VCC thresholds.
What we'd do
Use the SN74HC74N on a 5 V board with 100 nF at pin 14 and every unused input tied to a rail. For a toggle button, follow TI's circuit: RC debounce, a 74HC14 gate, then CLK, with 10 kΩ and 1 µF on CLR for a known start. For clock division up to about 14 MHz the HC74 is guaranteed hot; above that, use the 74LVC74A.
Questions people ask
What is the 74HC74 used for?
Halving a clock, turning a push button into an on/off toggle, and holding a bit until the next clock edge. It has two independent flip-flops, each with its own clock.
Are PRE and CLR active high or low?
Active low. Pull PRE low to force Q high, CLR low to force Q low. Both act at once, without the clock. Hold them high for normal use.
How do I make a 74HC74 divide by 2?
Connect D to /Q on the same flip-flop and feed the clock to CLK. Q runs at half the clock with a 50 % duty cycle. The second flip-flop, clocked from the first one's Q, divides by 4.
What is the maximum clock frequency of the 74HC74?
TI gives 25 MHz at 4.5 V up to 85 °C (31 MHz at 25 °C). Wired as a divide-by-2, the worst-case delay plus setup limits it to about 14.5 MHz hot.
Why does my flip-flop toggle twice when I press the button?
The contacts bounce, and an RC alone makes an edge too slow for the clock input. Add a Schmitt-trigger gate (74HC14) between the debounce RC and CLK.
Buying a 74HC74 in India
Shops list it as 74HC74 or SN74HC74N in DIP-14, and as 74HC74D for boards. The 74LS74 and 74HCT74 sit on the same shelf and look identical; check the letters after 74. Our guide to buying electronic components in India compares ten online sellers and covers how to spot fakes.
One email a month from the bench
New circuits, lessons, part guides and calculators, on the first Sunday of each month.
Used in these lessons
Lessons that go deeper
Datasheets this page was checked against
- Texas Instruments, SNx4HC74 Dual D-Type Positive-Edge-Triggered Flip-Flops With Clear and Preset (SCLS094F) (SCLS094F, December 1982, revised June 2021)
- Texas Instruments, SNx4HCT74 Dual D-Type Positive-Edge-Triggered Flip-Flops With Clear and Preset (SCLS169G) (SCLS169G, December 1982, revised October 2022)
- Texas Instruments, SNx4LVC74A Dual Positive-Edge-Triggered D-Type Flip-Flops With Clear and Preset (SCAS287W) (SCAS287W, January 1993, revised December 2024)
Makers revise datasheets. If the copy you download has a newer revision and a number here disagrees with it, the datasheet wins, and we would like to hear about it.