You're currently on: Catalog » Guides » SN74S74N: D-flipflop forklaret trin for trin » Guides » SN74S74N: the D flip-flop explained step by step
A D flip-flop is a one-bit memory that only listens at one precise moment: the rising edge of its clock. The Texas Instruments SN74S74N contains two of them in a 14-pin DIP, built in fast Schottky TTL (74S). This guide explains what “edge-triggered” means, what the PRE and CLR pins do, which timing rules you must respect, and how one flip-flop divides a clock by two.
Think of the D input as a question (“what should I store?”) and the clock as a camera shutter. While the clock is steady, D may change as much as it likes and the output Q ignores it. At the instant the clock goes from LOW to HIGH – the rising edge – the flip-flop takes a snapshot of D and copies it to Q. Q then holds that value until the next rising edge.
Every flip-flop also has an inverted output Q, which is always the opposite of Q in normal operation. Two extra inputs override the clock: PRE (preset) forces Q HIGH and CLR (clear) forces Q LOW. The bar over the names means they are active low: they do something when you pull them to 0 V and nothing when they sit HIGH.
This is different from a transparent latch such as the 74HC373, whose output follows the input during the whole enable time. A flip-flop reacts only to the edge, which is why it is the building block of counters, shift registers and synchronous logic.
The SN74S74N is the PDIP (N) version, rated 0–70 °C. Both flip-flops share VCC (pin 14) and GND (pin 7):
Edge triggering has rules. D must be stable for a short time before the edge (setup time) and stay stable a short time after it (hold time). For the SN74S74 TI specifies a minimum setup time of 3 ns and a minimum hold time of 2 ns. Break these rules and Q may take the wrong value.
After a valid edge, Q changes after the propagation delay: typically 6 ns and at most 9 ns from CLK to Q or Q (VCC = 5 V, 25 °C). The clock may run at up to 75 MHz guaranteed (110 MHz typical), with a HIGH pulse of at least 6 ns and a LOW pulse of at least 7.3 ns.
CLR does not wait for the clock. Pull it LOW for at least 7 ns and Q goes LOW within at most 13.5 ns (CLK high) or 8 ns (CLK low), whatever D and CLK do.
The classic first circuit is the toggle, or divide-by-2. Connect Q back to D. If Q is LOW, Q is HIGH, so the next rising edge stores HIGH; then Q becomes LOW and the following edge stores LOW. Q therefore changes state on every rising edge, and its frequency is exactly half the clock frequency with a 50 % duty cycle.
The example uses flip-flop 2: Q on pin 8 goes to D on pin 12, the clock enters CLK on pin 11, and the output is taken from pin 8 (or pin 9). PRE and CLR are pulled HIGH so the clock is in control.
An LED with a 330 Ω resistor from +5 V to Q (pin 9) shows the state. TTL outputs are strong when pulling LOW: the SN74S74 is specified for 20 mA at no more than 0.5 V, but only 1 mA when HIGH. Letting the output sink the current is therefore correct; with a red LED the current is about 8 mA. With a 1 Hz clock the LED blinks with a two-second period.
Standard TTL voltage levels and why outputs should sink current are explained in the SN7404N hex inverter guide. For the difference between a flip-flop and a latch, compare with the SN74HC373N transparent latch guide. Multi-bit registers are shown in the MC74HC173 register guide, and the J-K variant in the MC14027B J-K flip-flop guide. For a clean clock source see the LMC555 timer guide, and for cleaning up slow or bouncy signals the MC14093B Schmitt-trigger guide.
Pinout, package, function table, operating conditions, DC values and switching times: Texas Instruments, SN5474, SN54LS74A, SN54S74, SN7474, SN74LS74A, SN74S74 Dual D-Type Positive-Edge-Triggered Flip-Flops With Preset and Clear, SDLS119 (December 1983, revised March 1988), including its package option addendum. The example is a teaching circuit, not a tested product design.
See the SN74S74N product · Texas Instruments SN74S74 datasheet (PDF)
We use cookies to provide you with the best possible experience. They also allow us to analyze user behavior in order to constantly improve the website for you.