8 Flip Flops And Latches

Digital Logic · Unit 8

Flip-Flops and Latches

Exam-focused notes for Flip-Flops and Latches (Digital Logic, BIT103): what the TU syllabus asks and how it has actually been tested, with 11 solved past questions from this unit.

Flip-Flops and Latches in short

Combinational circuits have no memory. To remember a bit, we need a circuit with feedback. A latch or flip-flop is the basic memory cell. It stores one bit and holds it until it is changed. Flip-flops are the building blocks of registers, counters and memory.

Flip-Flops and Latches: notes

SR latch and clocked RS flip-flop

The SR latch has two inputs, Set (S) and Reset (R), and two outputs, $Q$ and $Q'$. It is made from two cross-coupled NOR gates (or NAND gates). The output of each gate feeds back to the input of the other.

For the NOR latch:

SRQ (next)Action
00No changeHold
010Reset
101Set
11InvalidBoth outputs go to 0

When $S=R=1$ is released together, the final state cannot be predicted, so this input is forbidden. The NAND latch works the same way but its inputs are active low: $S'=0$ sets it, $R'=0$ resets it, and $S'=R'=0$ is forbidden.

A clocked RS flip-flop adds two AND gates in front of the latch. The clock pulse $CP$ enables the inputs. The latch changes only when $CP=1$.

SRQ(t+1)
00Q(t)
010
101
11Indeterminate

Characteristic equation: $Q(t+1) = S + R'Q$, with the condition $SR = 0$.

JK flip-flop design and operation

The JK flip-flop removes the forbidden state of the SR flip-flop. $J$ acts like Set and $K$ like Reset. When $J=K=1$ the output toggles (changes to its opposite). It is built from an SR flip-flop with feedback from $Q$ and $Q'$. The inputs become $S = JQ'$ and $R = KQ$.

JKQ(t+1)Action
00Q(t)No change
010Reset
101Set
11Q'(t)Toggle

Characteristic equation:

$$Q(t+1) = JQ' + K'Q$$

Check: with $J=1, K=1$ this gives $Q' + 0 = Q'$, which is the toggle.

What this unit covers

  • SR latch and clocked RS flip-flop
  • JK flip-flop design and operation
  • Master-slave JK flip-flop
  • D flip-flop design and characteristics
  • T flip-flop operation
  • Race condition and triggering methods
  • Flip-flop characteristic tables and equations

Flip-flop characteristic tables and equations

2081 · 5 marks

What is Flip Flop? Differentiate between Combinational circuit and Sequential Circuit. [2+3]

Show solved answer

Flip Flop, Combinational vs Sequential Circuits


What is a Flip Flop? [2 marks]

A Flip Flop is a basic bistable sequential logic circuit that can store one bit of binary information (either 0 or 1). It has two stable states and can remain in either state indefinitely until a triggering signal (clock pulse) causes it to change state.

Key characteristics:

  • It is a memory element -- it remembers its previous output.
  • It is clock-triggered (edge or level triggered).
  • It has two outputs: Q (normal output) and Q' (complemented output).

Common types: SR Flip Flop, D Flip Flop, JK Flip Flop, T Flip Flop.


Difference between Combinational and Sequential Circuit [3 marks]

FeatureCombinational CircuitSequential Circuit
DefinitionOutput depends only on the present inputsOutput depends on present inputs AND past outputs (states)
MemoryNo memory element is usedHas memory elements (flip flops, latches)
FeedbackNo feedback pathFeedback path is present
ClockDoes not require a clock signalGenerally requires a clock signal
SpeedFaster (no clock dependency)Relatively slower
ExamplesAdder, Subtractor, Multiplexer, Decoder, EncoderFlip Flops, Registers, Counters, Shift Registers
DesignDesigned using logic gates onlyDesigned using logic gates plus flip flops

Summary

A combinational circuit is memoryless -- its output is a pure function of current inputs only. A sequential circuit has memory -- its output is a function of both current inputs and the current state (stored in flip flops), making flip flops the fundamental building block of all sequential circuits.

Open this answer on its own page →

JK flip-flop design and operation

2081 · 5 marks

Realize JK flip-flop from RS flip-flop. [5]

Show solved answer

Realizing JK Flip-Flop from RS Flip-Flop

Review of Both Flip-Flops

RS Flip-Flop Truth Table

SRQ(next)Remarks
00QNo change
010Reset
101Set
11XForbidden

JK Flip-Flop Truth Table

JKQ(next)Remarks
00QNo change
010Reset
101Set
11Q'Toggle

Derivation

The key difference is that JK = 11 toggles the output, whereas SR = 11 is forbidden.

We need to find expressions for S and R in terms of J, K, and the current state Q.

Mapping Table

Compare each input combination and find required S, R inputs:

JKQQ(next)SR
00000X
0011X0
01000X
011001
100110
1011X0
110110
111001

S and R values are derived from the RS flip-flop excitation table (what S, R must be to achieve the required Q(next) from current Q).


K-Map Simplification for S

Variables: J, K, Q

JK \ Q01
000X
0100
1110
101X

Grouping 1s and X (don't cares):

$$\boxed{S = J \cdot Q'}$$


K-Map Simplification for R

Variables: J, K, Q

JK \ Q01
00X0
01X1
1101
1000

Grouping 1s and X (don't cares):

$$\boxed{R = K \cdot Q}$$


Final Result

The conversion equations are:

$$S = J \cdot Q' \qquad R = K \cdot Q$$

Logic Circuit Diagram

        +-------+
J ------|       |
        | AND   |----> S ----+
Q' -----|       |            |        Q
        +-------+            |   +--------+
                             +-->|        |---> Q
        +-------+            |   | RS F/F |
K ------|       |            +-->|        |---> Q'
        | AND   |----> R ----+   +--------+
Q  -----|       |                    |
        +-------+                    |
             ^                       |
             |                       |
             +----------- Q ---------+

The current output Q is fed back: Q' feeds the S-gate and Q feeds the R-gate, eliminating the forbidden state and enabling toggle operation.


Summary

ConditionS = JQ'R = KQRS Behavior
J=0, K=000No change
J=0, K=10QReset when Q=1
J=1, K=0Q'0Set when Q=0
J=1, K=1Q'QEither Set or Reset (never both 1 simultaneously), achieving toggle

This ensures SR = 11 never occurs, successfully realizing a JK flip-flop from an RS flip-flop.

Open this answer on its own page →

2079 · 10 marks

What are the drawbacks of clocked RS flip flop? Explain the operation of a JK flip flop along with its characteristic table, characteristic equation circuit diagram and timing diagram.[10]

Show solved answer

Drawbacks of Clocked RS Flip Flop and JK Flip Flop


Drawbacks of Clocked RS Flip Flop

The clocked (synchronous) RS flip flop has the following major drawbacks:

  1. Forbidden/Invalid State (S=1, R=1): When both inputs S and R are simultaneously HIGH (S=1, R=1), the output becomes indeterminate or unpredictable (Q and Q' both try to become 1, which is a contradiction). This is the most critical limitation.

  2. Restricted Input Combinations: The designer must always ensure S and R are never both 1 at the same time, which adds complexity to circuit design and requires extra gating logic.

  3. No Toggling Capability: The clocked RS flip flop cannot toggle its output (switch from current state to its complement) with a single input condition. This limits its use in counters and frequency dividers.

  4. Incomplete Utilization of Input States: Out of four possible input combinations (00, 01, 10, 11), one combination (11) is forbidden, meaning the flip flop does not make full use of all input states.

  5. Unreliable Behavior in Asynchronous Environments: If S and R both go HIGH and then LOW simultaneously (race condition), the final state of the flip flop is unpredictable.

The JK flip flop was designed specifically to overcome these drawbacks.


JK Flip Flop

Introduction

The JK flip flop is an improved and universal flip flop that eliminates the forbidden state of the RS flip flop. The inputs are renamed J (analogous to S, Set) and K (analogous to R, Reset). The key improvement is that when J=1 and K=1, the output toggles (complements itself) instead of going to an invalid state.


Circuit Diagram

The JK flip flop is typically constructed using a clocked RS flip flop (NAND gate based) with feedback connections from the outputs back to the input gates.

        +-------+
J ------|       |
        | NAND  |----S-----+-------+
CLK ----|       |          |  SR   |----Q
        +-------+          | F/F   |
                           |       |----Q'
        +-------+          +-------+
K ------|       |
        | NAND  |----R
Q' -----|       |
        +-------+
  (Q feeds back to K-gate, Q' feeds back to J-gate)

Key Feature: Q is fed back to the K-input NAND gate, and Q' is fed back to the J-input NAND gate. This feedback resolves the ambiguity when J=K=1.

A more standard representation:

         ___________
        |           |
  J ----|  J     Q  |---- Q
        |           |
CLK ----|> CLK      |
        |           |
  K ----|  K     Q' |---- Q'
        |___________|

Operation of JK Flip Flop

The operation is governed by the clock pulse (CP). The flip flop responds to inputs only at the active clock edge.

JKOperationNext State (Q*)
00No Change (Hold)Q (unchanged)
01Reset0
10Set1
11Toggle (Complement)Q'

Explanation of each case:

  • J=0, K=0: Both NAND gates are disabled. Output remains unchanged. Memory state is retained.
  • J=0, K=1: The flip flop is reset. Output Q goes to 0 regardless of current state.
  • J=1, K=0: The flip flop is set. Output Q goes to 1 regardless of current state.
  • J=1, K=1: The feedback connections ensure the flip flop toggles. If Q=0, it becomes 1; if Q=1, it becomes 0. This is the key improvement over RS flip flop.

Characteristic Table

The characteristic table shows the next state Q(t+1) as a function of current inputs J, K and current state Q(t):

Q(t)JKQ(t+1)Operation
0000No Change
1001No Change
0010Reset
1010Reset
0101Set
1101Set
0111Toggle
1110Toggle

Characteristic Equation

The characteristic equation (next state equation) is derived from the characteristic table using a Karnaugh Map:

K-Map for Q(t+1):

Variables: Q(t), J, K

         JK
Q(t) | 00 | 01 | 11 | 10
-----|----|----|----|----|
  0  |  0 |  0 |  1 |  1 |
  1  |  1 |  0 |  0 |  1 |

Grouping:

  • Group 1: J=1, Q(t)=0 and J=1, Q(t)=1 (when K=0) --> J . Q' ... (cells with J=1, K=0)
  • Group 2: Q(t)=1, K=0
Open this answer on its own page →

2081.2 · 5 marks

Explain JK flip flop with necessary diagram and truth table. [5]

A JK flip flop is an improved version of the SR flip flop that eliminates the invalid/indeterminate state. It has two inputs: J (Set) and K (Reset), along with a Clock input and outputs Q and Q'. --- Internal Gate Implementation: --- CLK J K Q(next) Operation ------------------------------- 0 X X...

Open this answer on its own page →

Master-slave JK flip-flop

2080 · 5 marks

Describe the clocked master-slave J-K flip-flop with its operation table. [5]

A Master-Slave J-K flip-flop is a cascaded combination of two clocked SR flip-flops (or J-K stages) connected in series, designed to eliminate the race-around condition (indeterminate state) that occurs in a simple clocked J-K flip-flop when J = K = 1. --- The master-slave J-K flip-flop consists ...

Open this answer on its own page →

0 · 10 marks

What is JK master slave flip-flop? Design its logic circuit, truth table and explain the working principle.[10]

Note: No specific reference notes were found for this topic. The following answer is based on standard digital electronics curriculum as taught in TU BSc CSIT. --- A JK Master-Slave Flip-Flop is a level-triggered, edge-sensitive bistable device that eliminates the race-around condition (indetermi...

Open this answer on its own page →

SR latch and clocked RS flip-flop

2080 · 5 marks

What is forbidden state in SR flip flop? Convert SR to JK flip flop. [5]

In an SR (Set-Reset) flip-flop, the inputs S and R must not be applied simultaneously as logic 1. When S = 1 and R = 1 at the same time, the output becomes indeterminate (unpredictable): both Q and Q' try to become 1 simultaneously, which is a logical contradiction. This condition S = 1, R = 1 is...

Open this answer on its own page →

2078 · 5 marks

What is clocked RS flip-flop? Explain with logic diagram and characteristic table. [5]

Show solved answer

Clocked RS Flip-Flop

Definition

A clocked RS flip-flop (also called a synchronous RS flip-flop or gated SR latch) is a sequential logic circuit that has an additional clock (CLK) input which controls when the flip-flop responds to its S (Set) and R (Reset) inputs. The output changes state only when the clock signal is active (HIGH); otherwise, the flip-flop retains its previous state regardless of S and R inputs.


Logic Diagram

The clocked RS flip-flop is constructed using two AND gates added to the basic SR NOR/NAND latch:

        S ----\
               AND Gate 1 -----> S' ----> [Basic SR Latch] ----> Q
CLK ---/
        R ----\
               AND Gate 2 -----> R' ----> [Basic SR Latch] ----> Q'
CLK ---/

Detailed Logic Diagram:

         S ---|  \
              | & |------- S_in ------+----[NOR]----+---- Q
    CLK ---|  /                       |             |
                                      |             |
         R ---|  \                    |             |
              | & |------- R_in ------+----[NOR]----+---- Q'
    CLK ---|  /

More precisely:

    S ---[AND]---+
    CLK--|       |---> to NOR latch (S input) ---> Q
                 |
    R ---[AND]---+
    CLK--|       |---> to NOR latch (R input) ---> Q'
  • When CLK = 0: Both AND gate outputs are 0, latch is disabled, Q retains its state.
  • When CLK = 1: S and R inputs are passed through to the latch.

Characteristic Table

CLKSRQ (next)Q' (next)Remarks
0XXQ (no change)Q'Clock disabled, state retained
100Q (no change)Q'No change
10101Reset (Q = 0)
11010Set (Q = 1)
111??Forbidden / Invalid state

X = Don't care (any value)


Explanation of States

ConditionBehavior
CLK = 0Flip-flop is disabled; output Q holds its previous value
S=0, R=0, CLK=1No change; Q remains as it was
S=1, R=0, CLK=1Set condition; Q becomes 1
S=0, R=1, CLK=1Reset condition; Q becomes 0
S=1, R=1, CLK=1Forbidden state; both Q and Q' try to become 1, which is undefined and must be avoided

Key Points

  • The clock input provides synchronization in digital systems.
  • The condition S = R = 1 is not allowed (forbidden/invalid).
  • The characteristic equation is:

$$Q_{next} = S + \overline{R} \cdot Q \quad \text{with constraint } S \cdot R = 0$$

  • This flip-flop forms the basis for more advanced flip-flops like JK and D flip-flops.
Open this answer on its own page →

2077 · 5 marks

Define SR latch with logic diagram and truth table. [5]

An SR Latch (Set-Reset Latch) is a basic bistable multivibrator circuit that can store one bit of information. It has two inputs: - S (Set) - used to set the output Q to 1 - R (Reset) - used to reset the output Q to 0 It has two complementary outputs: Q and Q' (Q-bar). The SR latch is the most fu...

Open this answer on its own page →

D flip-flop design and characteristics

2079 · 5 marks

Design and explain the operational characteristics of D-flip flop. [5]

A D flip-flop (Data or Delay flip-flop) is a clocked sequential logic device that captures the value of the input D at a specific edge of the clock signal and holds (stores) that value until the next active clock edge. --- The D flip-flop eliminates the invalid state (S=1, R=1) of the SR flip-flo...

Open this answer on its own page →

Race condition and triggering methods

2078 · 10 marks

What do you mean by race condition in JK Flip Flop?Mention the methods to overcome race condition in JK Flip Flop. Explain Master Slave Flip-flop using JK flip flop with logic circuit, truth table and timing diagram.[3+7]

Note: No curriculum notes were found for this topic. The following answer is based on standard digital electronics content as taught in BSc CSIT curriculum. --- A race condition (also called racing or critical race) in a JK flip-flop occurs when both inputs J = 1 and K = 1 are applied simultaneou...

Open this answer on its own page →