D Flip-Flop - The Data or Delay Flip-Flop
đĄ What Is a D Flip-Flop?â
A D flip-flop (Delay or Data flip-flop) is a sequential circuit that captures and stores a single bit of data. It's the most widely used flip-flop type!
đ How It Worksâ
Inputsâ
- D (Data): The bit to store
- CLK (Clock): Synchronizes when the flip-flop updates
Outputsâ
- Q: Current stored value
- QĖ (Q bar): Inverse of Q
Behaviorâ
On the active clock edge (usually rising edge from 0 to 1):
- Q captures the value of D
- Q remains stored until the next clock edge
đ Truth Tableâ
| D | CLK | Q (next) |
|---|---|---|
| 0 | â | 0 |
| 1 | â | 1 |
| X | 0 | Q (hold) |
| X | 1 | Q (hold) |
â = rising edge (0â1)
đ§ How to Build a D Flip-Flopâ
Simple Constructionâ
A D flip-flop can be built from:
- SR latch + AND gates
- Or from NAND gates
Edge-Triggeredâ
Edge-triggered D flip-flops only update on the clock edge, making them very stable and reliable.
đĄ Common Usesâ
1. Registersâ
Multiple D flip-flops form a register to store multi-bit data.
Example: 8 D flip-flops = 8-bit register
2. Shift Registersâ
Chaining D flip-flops creates a shift register that can move data serially.
3. Countersâ
D flip-flops can form counters by feeding outputs back into inputs.
4. Synchronizationâ
D flip-flops synchronize signals crossing between different clock domains.
The D flip-flop is called a "delay" flip-flop because it delays the input D by one clock cycle - the output at time t+1 is equal to the input at time t.
D flip-flops are the building blocks for almost all sequential circuits in modern digital design. Their simplicity makes them ideal for building complex systems like CPUs and memory!
đ Classroom Exampleâ
Create a Simple Memory:
- Connect a single D flip-flop
- Connect a switch to D input
- Connect a pushbutton to CLK (momentary high)
- Connect an LED to Q
Students can see how:
- Setting D and pressing the button stores the value
- The LED stays lit (or dark) even after D changes
- New values are only stored on the button press
This demonstrates memory in action!
đĄ Summaryâ
- D flip-flop: Simple data storage element
- Captures D on active clock edge
- Holds state until next clock edge
- Key uses: Registers, shift registers, counters, synchronization
- Most common: Edge-triggered (rising edge)