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.
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 answerHide 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]
| Feature | Combinational Circuit | Sequential Circuit |
|---|---|---|
| Definition | Output depends only on the present inputs | Output depends on present inputs AND past outputs (states) |
| Memory | No memory element is used | Has memory elements (flip flops, latches) |
| Feedback | No feedback path | Feedback path is present |
| Clock | Does not require a clock signal | Generally requires a clock signal |
| Speed | Faster (no clock dependency) | Relatively slower |
| Examples | Adder, Subtractor, Multiplexer, Decoder, Encoder | Flip Flops, Registers, Counters, Shift Registers |
| Design | Designed using logic gates only | Designed 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.
JK flip-flop design and operation
2081 · 5 marks
Realize JK flip-flop from RS flip-flop. [5]
Show solved answerHide answer
Realizing JK Flip-Flop from RS Flip-Flop
Review of Both Flip-Flops
RS Flip-Flop Truth Table
| S | R | Q(next) | Remarks |
|---|---|---|---|
| 0 | 0 | Q | No change |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | X | Forbidden |
JK Flip-Flop Truth Table
| J | K | Q(next) | Remarks |
|---|---|---|---|
| 0 | 0 | Q | No change |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Q' | 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:
| J | K | Q | Q(next) | S | R |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | X |
| 0 | 0 | 1 | 1 | X | 0 |
| 0 | 1 | 0 | 0 | 0 | X |
| 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 | X | 0 |
| 1 | 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
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 \ Q | 0 | 1 |
|---|---|---|
| 00 | 0 | X |
| 01 | 0 | 0 |
| 11 | 1 | 0 |
| 10 | 1 | X |
Grouping 1s and X (don't cares):
$$\boxed{S = J \cdot Q'}$$
K-Map Simplification for R
Variables: J, K, Q
| JK \ Q | 0 | 1 |
|---|---|---|
| 00 | X | 0 |
| 01 | X | 1 |
| 11 | 0 | 1 |
| 10 | 0 | 0 |
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
| Condition | S = JQ' | R = KQ | RS Behavior |
|---|---|---|---|
| J=0, K=0 | 0 | 0 | No change |
| J=0, K=1 | 0 | Q | Reset when Q=1 |
| J=1, K=0 | Q' | 0 | Set when Q=0 |
| J=1, K=1 | Q' | Q | Either 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.
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 answerHide 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:
-
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.
-
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.
-
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.
-
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.
-
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.
| J | K | Operation | Next State (Q*) |
|---|---|---|---|
| 0 | 0 | No Change (Hold) | Q (unchanged) |
| 0 | 1 | Reset | 0 |
| 1 | 0 | Set | 1 |
| 1 | 1 | Toggle (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) | J | K | Q(t+1) | Operation |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | No Change |
| 1 | 0 | 0 | 1 | No Change |
| 0 | 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | 0 | Reset |
| 0 | 1 | 0 | 1 | Set |
| 1 | 1 | 0 | 1 | Set |
| 0 | 1 | 1 | 1 | Toggle |
| 1 | 1 | 1 | 0 | Toggle |
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
2081.2 · 5 marks
Explain JK flip flop with necessary diagram and truth table. [5]
Master-slave JK flip-flop
2080 · 5 marks
Describe the clocked master-slave J-K flip-flop with its operation table. [5]
0 · 10 marks
What is JK master slave flip-flop? Design its logic circuit, truth table and explain the working principle.[10]
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]
2078 · 5 marks
What is clocked RS flip-flop? Explain with logic diagram and characteristic table. [5]
Show solved answerHide 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
| CLK | S | R | Q (next) | Q' (next) | Remarks |
|---|---|---|---|---|---|
| 0 | X | X | Q (no change) | Q' | Clock disabled, state retained |
| 1 | 0 | 0 | Q (no change) | Q' | No change |
| 1 | 0 | 1 | 0 | 1 | Reset (Q = 0) |
| 1 | 1 | 0 | 1 | 0 | Set (Q = 1) |
| 1 | 1 | 1 | ? | ? | Forbidden / Invalid state |
X = Don't care (any value)
Explanation of States
| Condition | Behavior |
|---|---|
| CLK = 0 | Flip-flop is disabled; output Q holds its previous value |
| S=0, R=0, CLK=1 | No change; Q remains as it was |
| S=1, R=0, CLK=1 | Set condition; Q becomes 1 |
| S=0, R=1, CLK=1 | Reset condition; Q becomes 0 |
| S=1, R=1, CLK=1 | Forbidden 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.
2077 · 5 marks
Define SR latch with logic diagram and truth table. [5]
D flip-flop design and characteristics
2079 · 5 marks
Design and explain the operational characteristics of D-flip flop. [5]
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]
Make Unit 8 stick
Practice BIT103 with flashcards & quizzes