Unit 4 - Notes
Unit 4: Introduction to Sequential Logic Circuits
1. Overview of Sequential Logic
Unlike combinational logic circuits, where the output depends solely on the current inputs, sequential logic circuits depend on both the current inputs and the past history of inputs (current state).
Key Characteristics
- Memory: They possess a memory element to store the previous state.
- Feedback: The output is fed back to the input.
- Clock: Most sequential circuits are controlled by a timing signal called a clock.
Comparison: Combinational vs. Sequential
| Feature | Combinational Logic | Sequential Logic |
|---|---|---|
| Output | Depends only on current inputs. | Depends on current inputs and current state (past outputs). |
| Memory | No memory elements. | Contains memory elements (Flip-Flops/Latches). |
| Feedback | No feedback path. | Feedback path exists. |
| Clock | Not required. | Usually required (for synchronous circuits). |
| Examples | Adders, Encoders, Mux. | Counters, Registers, Flip-Flops. |
2. Latches vs. Flip-Flops
Both are bistable elements (two stable states: 0 and 1), but they differ in how they change state.
- Latch: Asynchronous, Level-Triggered. The output changes as soon as the input changes, provided the enable signal is active (high or low level).
- Flip-Flop: Synchronous, Edge-Triggered. The output changes only at specific transitions of the clock signal (rising or falling edge).
3. Basic Sequential Circuits (Latches)
3.1 The SR Latch (Set-Reset)
The most basic storage element. It can be constructed using NOR gates or NAND gates.
SR Latch using NOR Gates (Active High)
- S (Set): Sets output to 1.
- R (Reset): Resets output to 0.
- Logic: and are outputs.
| S | R | State | |
|---|---|---|---|
| 0 | 0 | No Change (Memory) | |
| 0 | 1 | 0 | Reset |
| 1 | 0 | 1 | Set |
| 1 | 1 | Invalid | Forbidden (Both outputs go to 0) |
SR Latch using NAND Gates (Active Low)
Inputs are often denoted as and . Ideally kept at logic 1.
- Logic 0 on sets the latch.
- Logic 0 on resets the latch.
- is the forbidden state.
3.2 The Gated SR Latch
Adds an Enable (E) or Clock (CLK) input to the basic SR latch. The inputs S and R allow state changes only when .
3.3 The D Latch (Data/Transparent Latch)
Designed to prevent the "Forbidden" state of the SR latch. It ensures and are never equal to 1 at the same time.
- Construction: Connect input directly to , and connect through an inverter (NOT gate) to .
- Behavior: When Enable = 1, follows (Transparent). When Enable = 0, holds the last value.
| En | D | |
|---|---|---|
| 0 | X | (No Change) |
| 1 | 0 | 0 (Reset) |
| 1 | 1 | 1 (Set) |
4. Triggering Methods
Level Triggering
- High Level: Circuit responds when Clock is Logic 1.
- Low Level: Circuit responds when Clock is Logic 0.
- Disadvantage: If the input changes multiple times while the clock is active, the output will change multiple times within one clock cycle (glitching).
Edge Triggering
- Positive Edge (Rising): Circuit responds only on the transition from 0 to 1 ().
- Negative Edge (Falling): Circuit responds only on the transition from 1 to 0 ().
- Advantage: Essential for synchronous systems; allows precise timing control.
5. Flip-Flops
5.1 SR Flip-Flop
An edge-triggered version of the Gated SR Latch.
- Symbol: Block with S, R, CLK inputs and outputs.
- Characteristic Equation: (Valid only if )
| CLK | S | R | State | |
|---|---|---|---|---|
| 0 | 0 | Hold | ||
| 0 | 1 | 0 | Reset | |
| 1 | 0 | 1 | Set | |
| 1 | 1 | ? | Invalid |
5.2 D Flip-Flop (Delay)
The most common flip-flop used in digital systems (registers, counters). It captures the value of input D at the clock edge.
- Characteristic Equation:
| CLK | D | Description | |
|---|---|---|---|
| 0 | 0 | Reset | |
| 1 | 1 | Set |
5.3 JK Flip-Flop
Designed to solve the "Forbidden State" () of the SR Flip-Flop.
-
J acts like Set.
-
K acts like Reset.
-
Feedback: Output is fed back to , and is fed back to .
-
Characteristic Equation:
Truth Table:
| CLK | J | K | State | |
|---|---|---|---|---|
| 0 | 0 | No Change | ||
| 0 | 1 | 0 | Reset | |
| 1 | 0 | 1 | Set | |
| 1 | 1 | Toggle |
Race Around Condition
In a level-triggered JK flip-flop (or if the clock pulse width is too wide), if , the output toggles continuously () within a single clock pulse. This leads to an indeterminate state.
- Solution: Use Edge Triggering or a Master-Slave configuration.
5.4 T Flip-Flop (Toggle)
A modification of the JK Flip-Flop where inputs J and K are connected together (). Used extensively in counters.
- Characteristic Equation: (T XOR Q)
| CLK | T | State | |
|---|---|---|---|
| 0 | No Change | ||
| 1 | Toggle |
6. Master-Slave Flip-Flop
The Master-Slave (M-S) JK Flip-Flop is a cascade of two latches designed to eliminate the Race Around Condition.
Structure
- Master: A gated latch controlled by .
- Slave: A gated latch controlled by inverted clock ().
Operation
- CLK = 1 (High):
- The Master is active and accepts inputs J and K.
- The Slave is inactive (isolated).
- CLK = 0 (Low):
- The Master becomes inactive (holds data).
- The Slave becomes active and reads the output of the Master.
Result: The output changes only once per clock cycle (at the falling edge), making it a true edge-triggered device logically, preventing uncontrolled toggling.
7. Conversion of Basic Flip-Flops
To convert a given Flip-Flop (Available) into a target Flip-Flop (Required), combinational logic is added to the inputs.
General Design Procedure
- Identify the Target FF (what you want) and the Available FF (what you have).
- Draw the Characteristic Table of the Target FF.
- Add a column for the Excitation Table of the Available FF.
- Determine the logic expressions for the Available FF inputs using K-Maps.
- Draw the circuit.
Excitation Tables (Reference for Conversion)
These tables tell you: "If I am at state and want to go to , what inputs do I need?"
| S R | J K | D | T | ||
|---|---|---|---|---|---|
| 0 | 0 | 0 X | 0 X | 0 | 0 |
| 0 | 1 | 1 0 | 1 X | 1 | 1 |
| 1 | 0 | 0 1 | X 1 | 0 | 1 |
| 1 | 1 | X 0 | X 0 | 1 | 0 |
(Note: X = Don't Care)
Example: SR to JK Flip-Flop
- Target: JK (Inputs J, K)
- Available: SR (Inputs S, R)
- Table Setup:
| J | K | (Target) | Required S | Required 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 |
-
K-Map for S:
- Inputs: J, K, Q. Highs at (1,0,0) and (1,1,0).
- Equation:
-
K-Map for R:
- Inputs: J, K, Q. Highs at (0,1,1) and (1,1,1).
- Equation:
-
Circuit: Connect External ANDed with to the input. Connect External ANDed with to the input.