🔄 Flip-Flops: Digital Memory Elements

Building Blocks of Sequential Circuits

1. Context: Where Flip-Flops Fit

In digital systems, we have two types of circuits:

🔹 Combinational circuits → Output depends only on current input. (No memory)

🔹 Sequential circuits → Output depends on current input + past history (needs memory).

Memory Elements

To build Sequential Circuits, we need a way to store a bit of information (0 or 1).

That's exactly what Flip-Flops do:

  • They are 1-bit memory elements built using logic gates.
  • So, every register, counter, and even computer memory is made up of Flip-Flops.

2. Definition

A Flip-Flop is a bistable multivibrator (fancy word meaning it has two stable states, 0 and 1).

Key Features
  • It stores one binary digit (1-bit) of data.
  • Its state changes based on input signals and often a clock signal.
  • Once set, it remembers the state until changed again.

✅ Example: If a flip-flop stores 1, it will stay 1 until an input/clock event makes it 0.

3. Characteristics of Flip-Flops

Bistability

Can stay in one of two stable states (0 or 1).

Edge/Level Sensitivity

Many flip-flops change state only on clock edges (rising or falling).

Storage

Can hold data until explicitly changed.

Basic Building Block of Memory

Registers, RAM, and even CPUs rely on flip-flops.

4. Types of Flip-Flops

SR Flip-Flop (Set-Reset)

Inputs: S (Set), R (Reset)

Output: Q, Q′ (always complementary)

S R Q(next)
0 0 No change
0 1 Reset (Q=0)
1 0 Set (Q=1)
1 1 Invalid

👉 Used for simple ON/OFF control.

JK Flip-Flop

Improvement of SR (no invalid state)

Inputs: J, K

J K Q(next)
0 0 No change
0 1 Reset (Q=0)
1 0 Set (Q=1)
1 1 Toggle

👉 Very flexible; used in counters.

D Flip-Flop (Data or Delay)

Simplest and most widely used

Input: D (Data)

Output: follows D on the clock edge

D Q(next)
0 0
1 1

👉 Stores the value of D when clock ticks.

👉 Used in registers and memory.

T Flip-Flop (Toggle)

Input: T

Behavior:

  • If T=0 → No change
  • If T=1 → Toggle (Q flips)

👉 Used in frequency dividers, binary counters.

5. Applications of Flip-Flops

Registers

Group of flip-flops to store multi-bit data (e.g., 8 flip-flops = 1 byte).

Counters

Counting clock pulses (digital clocks, timers).

Memory Units

Basis of RAM and cache memory.

Control Circuits

Used in finite state machines (FSMs).

Synchronization

Aligning signals with clock cycles.

6. Real-Life Analogy

Think of a Flip-Flop like a light switch:

  • A Set command = Switch ON (store 1).
  • A Reset command = Switch OFF (store 0).
  • It stays in that state until you change it again.

That's why Flip-Flops are called memory cells of digital circuits.

A Flip-Flop is a 1-bit memory cell used in sequential circuits. It stores a binary value and updates only on certain input/clock conditions. All computer memory, registers, and counters are built using flip-flops.

1. Context: Why SR Flip-Flop?

In digital systems, we need a way to store 1 bit of data (0 or 1).

Limitation of Combinational Circuits

Combinational circuits cannot store data because they have no memory.

Sequential Circuits

To build memory, we use Sequential Circuits, and the basic building block is the Flip-Flop.

SR Flip-Flop

The SR (Set-Reset) Flip-Flop is the simplest type of flip-flop.

It stores one bit and has two main actions:

  • Set (S=1) → Store 1.
  • Reset (R=1) → Store 0.

That's why it's called Set-Reset Flip-Flop.

2. Definition

An SR Flip-Flop is a bistable device (two stable states) that:

Inputs

Takes two inputs: S (Set) and R (Reset).

Outputs

Produces two outputs: Q (main output) and Q′ (the complement).

Storage

Stores 1 bit of binary data.

👉 If S=1, the flip-flop is set (Q=1).

👉 If R=1, the flip-flop is reset (Q=0).

3. How it Works (NAND-based SR Flip-Flop)

The SR flip-flop can be built using two cross-coupled NAND gates:

Structure

Each gate's output is fed back to the input of the other gate (feedback loop).

This feedback is what gives the flip-flop memory.

S
→
NAND
→
Q
R
→
NAND
→
Q'
↗
↖
↖
↗

âš¡ Inputs: S and R

⚡ Outputs: Q and Q′ (Q-prime, the opposite of Q)

4. Rules of Operation

Set State (S=0, R=1)

R=1, S=0 → Output Q=1, Q′=0.

This stores a 1.

We say the flip-flop is "Set".

Reset State (S=1, R=0)

S=1, R=0 → Output Q=0, Q′=1.

This stores a 0.

We say the flip-flop is "Reset".

No Change (S=1, R=1)

Both inputs = 1 → Output remains in the previous state.

This is the memory feature: it holds its last value.

Invalid State (S=0, R=0)

Both inputs = 0 → Both outputs become 1 (Q=1, Q′=1), which breaks the rule that Q and Q′ must be opposites.

This is undefined/forbidden.

5. Truth Table of SR Flip-Flop (NAND Version)

S R Q (next state) Q′ (next state) Description
1 1 No change No change Memory (hold)
0 1 1 0 Set
1 0 0 1 Reset
0 0 Invalid Invalid Forbidden

6. Example

Imagine a lamp controlled by SR Flip-Flop:

  • If you press Set (S=0) → The lamp turns ON (Q=1).
  • If you press Reset (R=0) → The lamp turns OFF (Q=0).
  • If you don't press anything (S=R=1) → The lamp stays in its last state (memory).
  • If you press both Set and Reset (S=R=0) → The circuit breaks down (invalid state).

7. Key Points to Remember

Basic Building Block

SR Flip-Flop is the simplest flip-flop (basis of all others).

Two Stable States

Has two stable states: Set (Q=1) and Reset (Q=0).

Invalid Condition

Has one invalid condition (S=R=0).

Fundamental Storage Element

It is the fundamental storage element in sequential logic.

The SR Flip-Flop is like a switch with memory.

Set = Turn ON (store 1)

Reset = Turn OFF (store 0)

No change = Remember last state

Invalid = Error (don't use)

Summary

🔄 Flip-Flops are the basic memory elements in digital systems, storing 1-bit of information.

🔧 SR Flip-Flop is the simplest type, with Set and Reset inputs to control the stored value.

âš¡ All computer memory, registers, and counters are built using flip-flops as the fundamental building blocks.

🧠 They enable sequential circuits to have memory, making them essential for building complex digital systems.

Flip-flops bridge the gap between combinational and sequential circuits, providing the memory needed for modern computing systems.