Comprehensive Study Guide on Flip-Flops and Sequential Logic
Introduction to Logic Circuits
- In digital systems, logic circuits are categorized into two primary groups:
- Combinational logic circuit: The output signal value at any given time is determined strictly by the values of the input signals at that time. These circuits are constructed using AND, OR, and NOT gates.
- Sequential logic circuit: The output signal value at any time is determined by the values of the current input signals and the previous sequence of inputs to the circuit. These circuits involve timing and memory devices and deal with concepts such as next state, present state, and present input state.
- General Block Diagram for a Sequential Circuit:
- It consists of a combinational circuit and memory elements.
- Memory Element: A device capable of storing binary information, required in most digital systems. A flip-flop is a primary example.
- The diagram flow is: Input → Combinational circuit → Output; with a feedback loop where the combinational circuit feeds into the memory element, and the memory element feeds back into the combinational circuit.
Flip-Flops Overview
- Definition: A flip-flop is a type of bistable memory element, meaning it has two stable states. It is considered a basic form of memory.
- Outputs: A flip-flop typically has two outputs labeled as Q (normal) and Q′ (complementary). Under normal conditions, these two outputs are the inverse of each other.
- Latch: One use of a flip-flop is to hold or "latch" data. When used for this purpose, it is specifically called a latch. A latch can hold one bit of information.
- Applications of Flip-Flops:
- Counters
- Shift registers
- Delay units
- Frequency dividers
- Primary Types of Flip-Flops (FF):
- The S-R Flip-Flop
- The Clocked R-S Flip-Flop
- The D Flip-Flop
- The J-K Flip-Flop
The S-R Flip-Flop (Set-Reset)
- The S-R Flip-Flop (or R-S Latch) can be formed using cross-coupled gates in two ways:
- Active HIGH FF: Created using cross-coupled NOR gates.
- Active LOW FF: Created using cross-coupled NAND gates.
- Inputs: S (Set) and R (Reset).
- NAND Gate S-R Flip-Flop (Active LOW) Operation:
- Prohibited State: When S=0 and R=0, both outputs go to logical 1. This state is prohibited and should not be used.
- Set Condition: When S=0 and R=1, the output Q is set to logical 1.
- Reset Condition: When S=1 and R=0, the output Q is reset (cleared) to 0.
- Hold Condition: When S=1 and R=1, this is the idle/at-rest condition. Both outputs (Q and Q′) remain in their previous state.
- NAND Gate Truth Table Summary:
- Prohibited: S=0,R=0→Q=1,Q′=1
- Set: S=0,R=1→Q=1,Q′=0
- Reset: S=1,R=0→Q=0,Q′=1
- Hold: S=1,R=1→Q=Previous,Q′=Previous
- NOR Gate S-R Flip-Flop (Active HIGH) Operation:
- Hold Condition: When S=0 and R=0, outputs follow the previous condition.
- Reset Condition: When S=0 and R=1, output Q is set to logical 0.
- Set Condition: When S=1 and R=0, output Q is set to logical 1.
- Prohibited State: When S=1 and R=1, both outputs go to 0. This is prohibited and not used.
- NOR Gate Truth Table Summary:
- Hold: S=0,R=0→Q=Previous,Q′=Previous
- Reset: S=0,R=1→Q=0,Q′=1
- Set: S=1,R=0→Q=1,Q′=0
- Prohibited: S=1,R=1→Q=0,Q′=0
The Clocked R-S Flip-Flop
- Features: This flip-flop includes an extra input labeled CLK (clock).
- Synchronous Operation: The outputs change only on a clock pulse. This means it operates in step with the clock, which is essential for calculators and computers where exact ordering of steps is required.
- Memory Characteristic: Once it is SET or RESET, it remains in that state even if inputs change, provided it is in hold mode.
- Logic Symbol: Contains inputs S,R,, and CLK, with outputs Q and Q′. In the symbol, Active HIGH inputs do not have bubbles.
- Operation Details:
- Clock pulse 1: Inputs S=0,R=0. FF is in hold/idle mode; no effect on Q.
- Rising edge of Clock pulse 2: Input S moved to 1; Q goes to 1.
- Clock pulse 3: FF remains in set mode.
- Clock pulse 4: FF in hold mode.
- Rising edge of Clock pulse 5: Input R is pre-set to 1; Q is reset to 0. FF is in reset mode during pulses 5 and 6.
- Clock pulse 7: Hold mode; Q remains at 0.
- Truth Table:
- Hold: CLK=Pulse,S=0,R=0→No change
- Reset: CLK=Pulse,S=0,R=1→Q=0,Q′=1
- Set: CLK=Pulse,S=1,R=0→Q=1,Q′=0
- Prohibited: CLK=Pulse,S=1,R=1→Q=1,Q′=1
- Construction: Can be wired using four NAND gates (two added to the standard R-S flip-flop to implement the clock feature).
The D Flip-Flop
- Terminology: Known as the "delay" flip-flop, "data" flip-flop, or D-type latch.
- Inputs/Outputs: One data input (D) and one clock input (CLK). Outputs are Q and Q′.
- Function: The word "delay" describes the behavior where data at input D is delayed by one clock pulse before reaching output Q. Qn+1 (the next state) follows input D.
- Truth Table:
- Input D=0→Output Qn+1=0
- Input D=1→Output Qn+1=1
- Applications: Wired together to form shift registers and storage registers used in digital systems.
- Internal Construction: Can be formed from a clocked R-S flip-flop by adding an inverter between the S and R inputs.
The Commercial 7474 TTL D Flip-Flop
- Additional Inputs:
- Asynchronous Preset (PS/PR): Sets output Q to 1 when enabled by a logical 0.
- Asynchronous Clear (CLR): Clears output Q to 0 when enabled by a logical 0.
- Asynchronous vs. Synchronous:
- The PS and CLR inputs are asynchronous; they override the synchronous D and CLK inputs.
- "X" in the truth table represents an "Irrelevant" input.
- "↑" represents a LOW-to-HIGH transition (rising edge) of the clock pulse.
- 7474 Truth Table:
- Asynchronous Set: PS=0,CLR=1,CLK=X,D=X→Q=1,Q′=0
- Asynchronous Reset: PS=1,CLR=0,CLK=X,D=X→Q=0,Q′=1
- Prohibited: PS=0,CLR=0,CLK=X,D=X→Q=1,Q′=1
- Synchronous Set: PS=1,CLR=1,CLK=↑,D=1→Q=1,Q′=0
- Synchronous Reset: PS=1,CLR=1,CLK=↑,D=0→Q=0,Q′=1
The J-K Flip-Flop
- Overview: The "universal" flip-flop because it possesses features of all other types.
- Unique Feature: Toggle Operation. When both J and K are at 1, repeated clock pulses cause the output to switch back and forth (off-on-off-on), similar to a toggle switch. This is useful for designing counters.
- T Flip-Flop: A J-K flip-flop wired to function only in toggle mode.
- Truth Table:
- Hold: J=0,K=0→No change
- Reset: J=0,K=1→Q=0,Q′=1
- Set: J=1,K=0→Q=1,Q′=0
- Toggle: J=1,K=1→Changes to opposite state
The Commercial 7476 TTL J-K Flip-Flop
- Inputs: Includes synchronous inputs (J,K,CLK) and asynchronous inputs (PR/PS - Preset, CLR - Clear).
- Clock Transition: Specifically uses the HIGH-to-LOW transition ("↓") of the clock pulse to transfer data.
- 7476 Truth Table:
- Asynchronous Set: PS=0,CLR=1,CLK=X,J=X,K=X→Q=1,Q′=0
- Asynchronous Reset: PS=1,CLR=0,CLK=X,J=X,K=X→Q=0,Q′=1
- Prohibited: PS=0,CLR=0,CLK=X,J=X,K=X→Q=1,Q′=1
- Hold (Synchronous): PS=1,CLR=1,CLK=↓,J=0,K=0→No change
- Reset (Synchronous): PS=1,CLR=1,CLK=↓,J=0,K=1→Q=0,Q′=1
- Set (Synchronous): PS=1,CLR=1,CLK=↓,J=1,K=0→Q=1,Q′=0
- Toggle (Synchronous): PS=1,CLR=1,CLK=↓,J=1,K=1→No change (Note: refers to state change toggle)
IC Latches
- Definition: A digital storage device used as a temporary buffer memory to hold data, such as a BCD code for a decimal number on a display.
- Examples of IC Latches:
- CMOS: 4042,4099,74HC75,74HC373.
- Combined ICs: 4511 and 4543 (BCD-to-seven segment latch/decoder/driver chips).
- The Commercial 7475 4-bit Transparent Latch:
- Contains four D flip-flops in one package.
- Enable Input (E): Similar to a clock. E0−1 controls flip-flops 0 and 1; E2−3 controls flip-flops 2 and 3.
- Transparency: When the Enable input is HIGH (1), the output follows the data at the D input immediately without a separate clock pulse.
- Latching: When the Enable input drops to LOW (0), the IC enters data-latched mode. The state at Q remains the same even if the D input changes.
- 7475 Truth Table:
- Data Enabled: E=1,D=1→Q=1,Q′=0
- Data Enabled: E=1,D=0→Q=0,Q′=1
- Data Latched: E=0,D=X→Q=q0,Q′=q0′ (Previous state)