Sequential Logic, Latches, Flip-Flops, and Counter Applications Study Guide
Combinational Logic and Sequential Logic Circuits
Combinational Logic Circuits: * Defined as logic gate circuits where the output is determined solely by the current particular input state. * Characteristic: These circuits can only have one output state for a specific input state. * Constraint: If the input conditions are removed, the output changes immediately; they possess no memory.
Sequential Logic Circuits: * Defined as circuits possessing a bistable state, allowing for different outputs for the same input depending on history. * Memory State: This is the state where the device’s output retains the previous value even after inputs change. * Core Components: Sequential circuits utilize logic gate devices known as Latches and Flip-Flops.
Practical Example: Burglar Alarm: * Scenario: In a burglar alarm, if a thief enters through a window, the alarm should remain active (latched) even if the window is closed afterward. * Comparison: In a standard combinational logic circuit, the alarm would shut off the moment the window closed because the circuit lacks memory.
Latches
General Definition: The simplest sequential device used for temporary storage with two stable states (bistable). It serves as a basic form of memory.
S-R (Set-Reset) Latch: * NOR Gate Construction: Constructed from cross-coupled NOR gates. This configuration responds to active-HIGH inputs. * NAND Gate Construction: Constructed from cross-coupled NAND gates. This configuration responds to active-LOW inputs (often denoted with a bar over the S and R).
Active-HIGH S-R Latch Operation (NOR-based): * Latch/Stable Condition: Occurs when both inputs are LOW (). * Initial State: Assume the latch is RESET () and inputs are inactive (). * SET Operation: A momentary HIGH signal applied to the S input while R remains LOW results in . * RESET Operation: A momentary HIGH signal applied to the R input while S remains LOW results in .
Active-LOW S-R Latch Operation (NAND-based): * Latch/Stable Condition: Occurs when both inputs are HIGH (). * SET Operation: A momentary LOW () signal applied to the S input while R remains HIGH results in . * RESET Operation: A momentary LOW () signal applied to the R input while S remains HIGH results in . * Invalid State: Active signals (LOW) must never be applied to both Set and Reset at the same time.
The 74LS279A IC: * An integrated circuit featuring four internal active-LOW S-R latches. * Two of these internal latches feature two S inputs. * Pulsing the S line LOW sets the latch.
Switch Debounce Application: * S-R latches are frequently used in switch debounce circuits. * When a switch transitions and is not touching either contact point, the latch remains in the memory state (, ), preventing signal noise from "bouncing."
Gated Latch: * Variation of the basic latch that includes an Enable (EN) input. * Operation: The latch only responds to S and R inputs when the EN input is HIGH. If EN is LOW, the inputs are ignored and the latch maintains its state.
D Latch: * A variation of the S-R latch that combines the S and R inputs into a single D (Data) input. * Simple Rule: follows when the Enable (EN) is active. * Truth Table: * If and , then (RESET). * If and , then (SET). * If , there is no change (), and the output is latched regardless of .
Flip-Flops
Contrast with Latches: While latches are level-sensitive, flip-flops are clocked devices. A new bit is only entered at the active clock edge.
Triggering Mechanisms: * Positive edge-triggered: Sensitive to the rising edge of the clock signal. * Negative edge-triggered: Sensitive to the falling edge of the clock signal (indicated by a bubble and a triangle dynamic input indicator).
D Flip-Flop: * The output takes the state of the input only at the specific active clock edge (represented by an up or down arrow in truth tables).
J-K Flip-Flop: * More versatile than the D flip-flop. * Truth Table (Rising Edge): * : No change. * : RESET (). * : SET (). * : Toggle (The output changes to the opposite of its current state).
Toggle Mode Hardwiring (D Flip-Flop): * A D flip-flop can be forced into toggle mode by connecting the output back to the input. This causes the output to change once for every clock pulse.
Synchronous vs. Asynchronous Inputs: * Synchronous: Inputs (like D or J-K) that transition the output only on the clock edge. * Asynchronous: Inputs that affect the output immediately, independent of the clock. Common examples are Preset (PRE) and Clear (CLR), typically active-LOW.
Flip-Flop Characteristics and Timing
Propagation Delay Time: * Measured between the level of the clock triggering edge and the level of the output transition. * : Delay for HIGH-to-LOW transition. * : Delay for LOW-to-HIGH transition. * Typical delay for 74AHC family (CMOS): . * Async delays (unrelated to clock) for PRE and CLR are typically under .
Setup Time (): The minimum time the data must be present at the input before the clock transition to be reliably clocked.
Hold Time (): The minimum time the data must remain at the input after the clock transition.
Power Dissipation: The product of the supply voltage and the average current required ().
Speed-Power Product: * A metric for comparing logic families using energy units. * Formula: Average Propagation Delay Average Power Dissipation. * Example 74AHC74A: Average delay , Power dissipated . Speed-power product = .
Multivibrators and Timers
One-Shot (Monostable) Multivibrator: * Has only one stable state. * When triggered, it enters an unstable state for a length of time () determined by an external RC circuit (, ).
Types of One-Shots: * Non-retriggerable: Does not respond to triggers occurring while in the unstable state. * Retriggerable: Responds to triggers during the unstable state, extending the pulse duration. * Application: Power failure detection. AC power triggers keep the one-shot in the unstable state; if a trigger is missing (power out), the one-shot returns to stable state and initiates an alarm.
555 Timer (One-Shot Configuration): * Pulse width formula: . * Trigger: Negative-going pulse. * Example Calculation: If and , then .
555 Timer (Astable Multivibrator): * Continuous oscillation. * charges through and discharges through only. * Output Frequency: .
Counters
Basic Concepts: * Binary counting follows a sequence where the LSB (Least Significant Bit) changes on every count, the next bit on every second count, the third on every fourth, and so on.
Asynchronous Counters (Ripple Counters): * The clock is applied only to the first stage. Subsequent stages are clocked by the output of the previous stage. * Disadvantage: Propagation delays accumulate. For a 3-bit counter, is delayed by 1 unit, by 2 units, and by 3 units. This limits high-speed operations. * 74LS93A IC: Contains one independent toggle J-K flip-flop (CLK A) and three forming an asynchronous counter (CLK B). Can be combined into a 4-bit counter by connecting to CLK B.
Synchronous Counters: * All flip-flops are clocked simultaneously by a common clock pulse. * Overcomes the ripple delay disadvantage but requires more complex control circuitry (logic gates) to determine input states.
Decoding Counters: * Full Decoding: Uses logic gates (like AND gates) to detect a specific binary number. * Partial Decoding: Detecting a state by looking at only some bits (e.g., detecting in a decade counter by looking only at LSB and MSB).
Decade Counters: * Counters that recycle to zero after state 9 (). * Example: 74LS90 (asynchronous) or 74LS163 (synchronous 4-bit with terminal count RCO).
Up/Down Counters: Capable of counting in both directions based on a control input (e.g., 74HC190, 74HC191).
Cascading Counters: Connecting counters to achieve higher-modulus. * Example: Two DIV 16 counters cascaded result in a modulus of . * Frequency Example: If and modulus is , then .
Shift Registers
Operation Types: * Serial In / Shift Right or Left / Serial Out: Moves data bit by bit; can be used for time delay or as a frequency divider. * Parallel In / Serial Out (PISO): Converts parallel computer data into serial form (e.g., for Network, SATA, USB). * Serial In / Parallel Out (SIPO): Converts serial data (USB, Keyboard) into parallel form for CPU processing. * Parallel In / Parallel Out (PIPO): Temporary data storage (I/O port buffers, CPU registers). * Rotate: Cyclic movement of bits (continuously rotating display).
Specific ICs: * 74HCT164A: CMOS 8-bit SIPO shift register. Active-LOW async clear. Leading-edge clock trigger. * 74HCT165: CMOS 8-bit PISO shift register. Asynchronous load when SH/LD is LOW. * 74HCT194: 4-bit bidirectional universal shift register (supports both serial and parallel).
Application - Digital Signal Delay: * Calculation: An 8-bit SISO register with a clock. * Delay per clock: . * Total delay: .
UART (Universal Asynchronous Receiver Transmitter): * A combination serial-to-parallel and parallel-to-serial converter. * Uses a serial format consisting of a Start Bit () and Stop Bits ().
Questions & Discussion
Q: Why use a latch for a burglar alarm? * A: Because standard logic gates have no memory. If a door is opened and then closed by an intruder, a combinational circuit would turn off the alarm. A latch stays active even after the initial trigger (door opening) is removed.
Q: Determine the pulse width for a 555 timer where and . * A: Using , the result is .
Q: How is frequency division achieved using flip-flops? * A: Using a flip-flop in toggle mode divides the input frequency () by 2. Chaining multiple flip-flops divides the frequency further (e.g., two divide by 4). The output also results in an exact duty cycle.
Q: What is the modulus of two cascaded DIV 16 counters? * A: The modulus is .