π Lecture 23 β Application of S-R Latch
π Overview: This lecture explores the practical application of S-R latches in digital systems, particularly for switch debouncing and alarm circuits. It then progresses to gated latches and edge-triggered flip-flops, which are fundamental building blocks for synchronous digital systems. Understanding these components is crucial for designing reliable sequential logic circuits that operate in synchronization with a clock signal.
ποΈ Topics Covered
The lecture begins with the application of S-R latches for switch debouncing and alarm circuits, followed by the introduction of gated S-R and D latches with enable inputs. It then covers edge-triggered S-R, D, and J-K flip-flops, their operation and timing diagrams, and asynchronous preset/clear inputs. Finally, it discusses master-slave flip-flops and important flip-flop operating characteristics including propagation delays, setup and hold times, and power dissipation.
π Lecture Summary
Application of S-R Latch
Digital systems use switches for input, but when a switch closes, its contacts physically 'bounce' before making solid contact. This switch bounce causes the output voltage to vary between logic low and high briefly before settling. An S-R latch connected between the switch and the digital circuit prevents this varying output from causing erratic circuit behavior. When the switch is moved, the S input may vary due to bounce, but the latch doesn't change its output state when S=1 and R=1.
A burglar alarm circuit uses an S-R latch where an alarm switch connects the S input to logic high. The alarm is activated by setting the reset switch to ground. When an intruder opens a door, the alarm switch grounds the set input, setting Q to logic 1 and activating the alarm. Even if the door is closed, the alarm continues to sound as S=1 and R=1 maintain the output. The alarm can only be disabled by reconnecting the reset switch to ground.
The S-R NAND gate based latch is available as the 74LS279 IC, which contains four independent S-R latches.
The Gated S-R Latch
The gated S-R latch has an enable input that must be activated to operate the latch. In this circuit, the S and R inputs are applied to NAND gates 1 and 2 only when the enable input is active-high. When the enable input is logic low, the outputs of NAND gates 3 and 4 remain logic 1 regardless of S and R, keeping Q and QΜ in their previous state.
π Definition β Gated S-R Latch: A sequential logic circuit where the S and R inputs only affect the output when an enable signal is active. π Truth Table: When EN=0, output remains Qβ regardless of inputs. When EN=1 and S=0, R=0, output remains Qβ. When S=0, R=1, output is 0. When S=1, R=0, output is 1. When S=1, R=1, the state is invalid. π‘ Why this matters: The enable input provides control over when the latch can change state, which is essential for synchronizing operations in digital systems.
The Gated D Latch
The gated D-latch is created by connecting the S and R inputs of a gated S-R latch together using a NOT gate, resulting in a single input D. This reduces the four input combinations of the S-R latch to only two: D=0 or D=1. The Q output of the D latch follows the D input when enabled.
π Definition β Gated D Latch: A gated latch with a single data input D that simplifies the input requirements of an S-R latch. π Truth Table: When EN=0, output remains Qβ. When EN=1 and D=0, output is 0. When EN=1 and D=1, output is 1.
Application of Gated D Latch
The D latch is available as the 74LS75 IC, which contains four independent D latches. Gated D latches can store binary information. A circuit using gated D-latches connected at the input of a 1-of-8 multiplexer can store a byte value (parallel data). The multiplexer then accesses each bit value stored in the D-latch and routes it to the output, converting 8-bit parallel data into serial data.
Edge-Triggered Flip-Flop
Flip-flops are synchronous bi-stable devices (bi-stable multivibrators) that have a clock input instead of a simple enable input. The output can only change when appropriate inputs are applied at S and R and a clock signal is applied. In synchronous systems, all digital circuit outputs change when a clock signal is applied, either at the low-to-high (positive edge) or high-to-low (negative edge) transition of the clock. Three types of edge-triggered flip-flops are commonly used: S-R, D, and J-K flip-flops.
π Definition β Edge Detection Circuit: A simple combinational circuit that allows a flip-flop to change state on either the positive or negative transition of the clock signal.
Edge-Triggered S-R Flip-flop
The edge-triggered S-R flip-flop changes state only at the clock edge. A positive edge-triggered flip-flop changes on low-to-high transition, while a negative edge-triggered one changes on high-to-low transition.
π Definition β Positive/Negative Edge-Triggered S-R Flip-flop: A flip-flop that samples S and R inputs only at the rising or falling edge of the clock signal. π Truth Table (Positive Edge): When CLK=0 or 1 (no edge), output remains Qβ. On rising edge (β), if S=0, R=0, output is Qβ; if S=0, R=1, output is 0; if S=1, R=0, output is 1; if S=1, R=1, output is invalid.
Edge-Triggered D Flip-flop
The edge-triggered D flip-flop has a single data input D. The output of the D flip-flop follows the D input at the clock edge.
π Definition β Edge-Triggered D Flip-flop: A flip-flop that captures the value of the D input only at the active clock edge. π Truth Table (Positive Edge): On rising edge (β), if D=0, output is 0; if D=1, output is 1. Output remains Qβ when no clock edge occurs.
Edge-Triggered J-K Flip-flop
The J-K flip-flop is widely used in digital circuits. Its operation is similar to the S-R flip-flop except it has no invalid state; instead, it toggles its state when both inputs are 1. When J=0 and K=0, the previous state is maintained. When J=0 and K=1, the flip-flop is reset (Q=0, QΜ =1). When J=1 and K=0, the flip-flop is set (Q=1, QΜ =0). When J=1 and K=1, the output toggles from the previous state.
π Definition β J-K Flip-flop: An edge-triggered flip-flop that can set, reset, hold, or toggle its output based on the J and K inputs. π Truth Table (Positive Edge): On rising edge (β), if J=0, K=0, output is Qβ; if J=0, K=1, output is 0; if J=1, K=0, output is 1; if J=1, K=1, output is QΜ β (toggles).
Asynchronous Preset and Clear Inputs
Preset (PRE) and Clear (CLR) are asynchronous inputs that set or reset the flip-flop to a known logic level independently of the clock signal. They override the synchronous inputs. To preset the flip-flop (Q=1, QΜ =0), PRE is set to 0. To clear the flip-flop (Q=0, QΜ =1), CLR is set to 0. Setting both PRE and CLR to 0 is not allowed. To use the flip-flop in synchronous mode, both PRE and CLR are set to logic 1.
The 74HC74 is a dual positive-edge triggered D flip-flop with asynchronous inputs. The 74HC112 is a dual positive-edge triggered J-K flip-flop with asynchronous inputs.
Master-Slave Flip-Flops
Master-Slave flip-flops have become obsolete and are being replaced by edge-triggered flip-flops. They consist of two stages: the Master and the Slave, both gated S-R flip-flops. The master-slave flip-flop is a pulse triggered flip-flop as it operates on both positive and negative clock cycles. Inputs are applied during the first half of the clock signal (Master enabled), and outputs change during the second half (Slave enabled).
Flip-Flop Operating Characteristics
Several operating characteristics specify flip-flop performance:
- Propagation Delay: The interval between input application and output change. Four types are measured: tPLH from clock to low-to-high output, tPHL from clock to high-to-low output, tPLH from preset to low-to-high output, and tPHL from clear to high-to-low output. All are measured at 50% transition marks.
- Set-up Time: The minimum time input logic levels must remain stable before the clock transition.
- Hold Time: The minimum time the input signal must be maintained after the clock transition.
- Maximum Clock Frequency (fmax): The highest rate at which the flip-flop operates reliably.
- Pulse Width: The minimum specified duration for clock, preset, and clear signals for correct operation. The clock signal has specified minimum high and low times.
- Power Dissipation: Defined as P = Vcc Γ Icc. For example, a flip-flop connected to +5V drawing 5mA dissipates 25mW.
π‘ Why this matters: These operating characteristics are critical for designing reliable digital circuits, ensuring proper timing relationships between signals, and selecting appropriate power supplies.
β Key Takeaways
S-R latches are essential for eliminating switch bounce in digital input circuits and for creating alarm systems with persistent state. Gated latches introduce an enable input that controls when the latch can change state, while edge-triggered flip-flops use a clock signal for precise synchronization in digital systems. The J-K flip-flop is the most versatile as it can hold, set, reset, or toggle its output without an invalid state. Asynchronous preset and clear inputs override clocked operation to initialize flip-flops to known states, and understanding flip-flop operating characteristics like propagation delay, setup time, and hold time is essential for reliable circuit design.
π§ Quick Revision Questions
- How does an S-R latch eliminate the effect of switch bounce in a digital input circuit?
- What is the difference between a gated S-R latch and an edge-triggered S-R flip-flop?
- Why does the J-K flip-flop have no invalid state, and what happens when both J and K inputs are logic 1?
- What is the purpose of asynchronous Preset and Clear inputs, and why can't they both be set to 0?
- What are the four types of propagation delays measured in flip-flops, and at what percentage of signal transition are they measured?
π Lecture 24 β APPLICATIONS OF EDGE-TRIGGERED D FLIP-FLOP
π Overview: This lecture explores real-world applications of edge-triggered D flip-flops, including data storage, synchronizing asynchronous signals, and parallel data transfer. It then introduces the edge-triggered J-K flip-flop, detailing its operation, truth tables, and key applications such as sequence detection, frequency division, shift registers, and counters. Understanding these applications is crucial for designing stable and synchronized digital systems.
ποΈ Topics Covered
The lecture begins with applications of the edge-triggered D flip-flop, specifically its use in parallel data storage for multiplexer-based converters and in synchronizing asynchronous inputs to prevent partial clock pulses. It covers parallel data transfer using multi-bit registers. The latter half introduces the edge-triggered J-K flip-flop, explaining its four input combinations and operation. The lecture concludes with J-K flip-flop applications as a sequence detector, frequency divider, shift register, and counter.
π Lecture Summary
1. Data Storage using D-flip-flop
A Multiplexer based Parallel-to-Serial converter requires stable parallel data at its inputs during conversion. D-latches can be used, but they have a transparent mode when enabled, where data changes at the input directly appear at the output. This can be problematic if input data changes during the enable window. A better solution uses edge-triggered D flip-flops, which store data precisely at the clock transition (e.g., rising edge). Once stored, any subsequent changes to the input data have no effect on the output until the next clock edge.
π Definition β Transparent Mode: A state of a D-latch where changes in the input data are directly reflected at the output as long as the enable signal is active. π Definition β Latched Mode: A state of a D-latch where changes in the input data are not reflected at the output; the output holds its last stored value. π‘ Why this matters: Edge-triggered D flip-flops provide precise and stable data storage, essential for reliable parallel-to-serial conversion and other memory applications.
π Example: A timing diagram in the lecture (Fig. 24.2) shows a scenario with 4 D inputs (D0, D1, D2, D3) that are constantly changing. At interval t1, a clear input resets all four D flip-flops' outputs (Q0, Q1, Q2, Q3) to 0. At interval t2, on the rising edge of the clock, the current data at D0-D3 is latched. The outputs then remain stable despite further changes at the inputs.
2. Synchronizing Asynchronous inputs using D flip-flop
In synchronized digital systems, all circuits change state with a common clock. External inputs from switches or keypads are asynchronous and can occur at any time. If an asynchronous input is directly fed into a circuit like an AND gate along with a clock signal, it can cause incomplete or partial pulses at the output, leading to system errors. A D flip-flop is used to synchronize this input. The asynchronous signal is connected to the D input, and the clock is applied to the flip-flop's clock input. The flip-flop's Q output, which only changes on the clock edge, now provides a clean, synchronized version of the input, ensuring complete clock pulses at the AND gate's output.
π Definition β Asynchronous Input: An input signal that is not synchronized with the system's master clock and can change at any arbitrary time. π Definition β Synchronization: The process of aligning an asynchronous signal with a system's clock using a flip-flop so that it changes state only at clock edges.
π Example: In Fig 24.3 and 24.4, a switch provides an asynchronous input to a 2-input AND gate, with the other input being the clock. The resulting output (Fig 24.4) shows partial or "glitchy" pulses. By placing a D flip-flop between the switch and the AND gate (Fig 24.5), the D flip-flop's Q output now provides a clean, synchronized signal that aligns with the clock, producing complete, full-width clock pulses at the AND gate's output (Fig 24.6).
3. Parallel Data Transfer using D flip-flop
Microprocessors use registers, which are groups of multi-bit flip-flops, to store information, such as data from an ALU. A register is a set of edge-triggered D flip-flops connected in parallel. The clock inputs of all flip-flops in the register are connected together, allowing for the simultaneous latching of a multi-bit data word (e.g., an 8-bit byte) on a single clock edge.
π Definition β Register: A digital circuit composed of multiple flip-flops (typically D flip-flops) connected in parallel to store a multi-bit binary word.
Edge-Triggered J-K Flip-flop
The J-K flip-flop is a versatile and widely used flip-flop. It is similar to the S-R flip-flop but has no invalid state. Instead, the J=1, K=1 condition causes the output to toggle (change to the opposite state). Its circuit has feedback where the Q and Q' outputs are connected back to the input NAND gates. Its operation for the four input combinations is:
- J=0, K=0: The previous state is maintained; no change.
- J=0, K=1: The flip-flop is reset, setting Q=0 and Q'=1.
- J=1, K=0: The flip-flop is set, setting Q=1 and Q'=0.
- J=1, K=1: The output toggles. If Q=1, Q'=0, it becomes Q=0, Q'=1, and vice versa.
π Definition β Toggle: A state change in a flip-flop where the output transitions from its current state (0 or 1) to the opposite state (1 or 0).
π Formula: For a positive edge-triggered J-K flip-flop, the next state (Qt+1) is:
- Qt+1 = Qt (if J=0, K=0)
- Qt+1 = 0 (if J=0, K=1)
- Qt+1 = 1 (if J=1, K=0)
- Qt+1 = Qt' (if J=1, K=1)
Table 24.1 (from lecture) provides the full truth tables for positive and negative edge-triggered J-K flip-flops.
Applications of Edge-Triggered J-K Flip-flop
-
J-K flip-flop used as sequence detector: By connecting inputs J and K to specific signals, a J-K flip-flop can be configured to recognize a particular sequence of inputs and change its state or activate an output only when that sequence occurs.
-
J-K flip-flop used as frequency divider: A single J-K flip-flop with its J and K inputs tied to logic 1 (high) will toggle its output on every clock edge. This produces an output signal with a frequency exactly half of the clock input frequency. π Example: A 4MHz clock signal is applied to the first flip-flop (F0). Its output (Q0) is a 2MHz signal. This 2MHz signal is then used as the clock for a second flip-flop (F1). The output of the second flip-flop (Q1) is a 1MHz signal. This is a divide-by-4 frequency divider.
-
J-K flip-flop used as a shift register: J-K flip-flops can be connected in series to form a shift register, where the output of one flip-flop is connected to the input (J, K) of the next. On each clock pulse, the data bits shift one position to the right or left (Fig 24.14). This hardware efficiently performs multiplication or division by powers of 2.
-
J-K flip-flop used as a counter: J-K flip-flops are the fundamental building blocks of counters. By connecting the Q output of one flip-flop to the clock input of the next (ripple counter) and configuring their J and K inputs, a circuit can count up or down through a sequence of binary numbers with each clock pulse. π Example: A 2-bit up-counter (Fig 24.15) uses two J-K flip-flops. The first F0 toggles on every clock pulse. The second F1 toggles only when F0's output is 1. The outputs (F1, F0) produce the binary sequence 00, 01, 10, 11 for four clock cycles.
β Key Takeaways
The most critical concepts are the distinction between the transparent mode of a latch and the edge-triggered storage of a D flip-flop, and the latter's crucial role in synchronizing asynchronous inputs for reliable digital circuit operation. You must master the complete truth table and operation of the J-K flip-flop, especially its toggle mode with J=K=1. The ability to explain how a J-K flip-flop functions as a frequency divider (by connecting J and K to 1) and as a building block for counters and shift registers is essential for exam problems and system design.
π§ Quick Revision Questions
- What is the fundamental difference between a gated D-latch and an edge-triggered D flip-flop in terms of when they sample their input?
- Explain why an asynchronous input from a switch can cause a problem when combined with a clock signal in an AND gate, and how a D flip-flop solves this problem.
- What is the state of the Q output of a positive edge-triggered J-K flip-flop if the clock transitions from 0 to 1, J=1, and K=0? What if J=1 and K=1?
- If a 16 MHz clock signal is applied to a divide-by-2 frequency divider, what is the frequency of the output signal? If that output is then connected to another identical frequency divider, what is the resulting frequency?
- Describe the difference between a register (parallel data transfer) and a shift register. How is a shift register typically used to perform a multiplication by 2?
π Lecture 25 β ASYNCHRONOUS PRESET AND CLEAR INPUTS
π Overview: This lecture covers asynchronous Preset and Clear inputs in flip-flops, which override synchronous inputs to force the flip-flop into a known initial state independently of the clock. It also explores Master-Slave flip-flops, key flip-flop operating characteristics, and one-shot monostable multivibrators, explaining their circuit behavior, timing, and practical applications in digital design.
ποΈ Topics Covered
The lecture begins by explaining asynchronous Preset and Clear inputs for J-K and D flip-flops, including circuit diagrams, truth tables, and timing diagrams. It then discusses Master-Slave flip-flop architecture and operation with a pulse-triggered clock. Next, it details six key flip-flop operating characteristics: propagation delay, set-up time, hold time, maximum clock frequency, pulse width, and power dissipation. Finally, it introduces one-shot monostable multivibrators, covering their circuit behavior, timing, and the difference between non-retriggerable and retriggerable types.
π Lecture Summary
Asynchronous Preset and Clear Inputs
Synchronous inputs (S-R, J-K, D) only affect the output when a clock transition occurs. Asynchronous inputs (Preset and Clear) change the output to a known logic level independently of the clock. The PRE (Preset) input sets Q=1 and QΜ =0 when set to 0; the CLR (Clear) input sets Q=0 and QΜ =1 when set to 0. These inputs override the synchronous inputs. To use the flip-flop in synchronous mode, PRE and CLR must both be set to logic 1. Setting both PRE and CLR to 0 is invalid. π‘ Why this matters: Asynchronous inputs are essential for initializing flip-flops to a known state before a circuit begins operation.
π Definition β Asynchronous Inputs: Inputs that change the output of a flip-flop to a known logic level independently of the clock signal.
π Truth Table (J-K flip-flop with Async Inputs):
- PRE=0, CLR=0 β Invalid
- PRE=0, CLR=1 β Q(t+1)=1
- PRE=1, CLR=0 β Q(t+1)=0
- PRE=1, CLR=1 β Clocked operation (synchronous inputs J-K determine output)
π Example: To preset a J-K flip-flop to Q=1, set PRE=0 and CLR=1. PRE=0 sets Q to 1; CLR=1 allows QΜ to be set to 0 via the NAND gate network. Inputs J and K have no effect.
The 74HC74 Dual Positive-Edge triggered D flip-flop
This is an Integrated Circuit containing two positive-edge triggered D flip-flops. Each flip-flop has independent clock inputs, synchronous inputs, and asynchronous Preset and Clear inputs.
The 74HC112 Dual Positive-Edge triggered J-K flip-flop
This is an Integrated Circuit containing two positive-edge triggered J-K flip-flops. Each flip-flop has independent clock inputs, synchronous inputs, and asynchronous Preset and Clear inputs.
Master-Slave Flip-Flops
Master-Slave flip-flops are now obsolete, replaced by edge-triggered flip-flops. They consist of two stages: a Master and a Slave, both are Gated S-R flip-flops. The Master is enabled during the positive half of the clock cycle; the Slave is enabled during the negative half. It is a pulse-triggered flip-flop. During the positive half, the Master accepts inputs; its outputs remain fixed during the negative half. During the negative half, the Slave copies the Master's outputs, and the Master is disabled. This setup synchronizes the operation with a common clock signal.
π Definition β Master-Slave Flip-Flop: A flip-flop composed of two gated S-R flip-flops (Master and Slave) where the Master is enabled during the positive clock half and the Slave during the negative half, creating a pulse-triggered operation.
π Truth Table (Master-Slave J-K flip-flop):
- CLK= Pulse, J=0, K=0 β Q(t+1)=Q(t)
- CLK= Pulse, J=0, K=1 β Q(t+1)=0
- CLK= Pulse, J=1, K=0 β Q(t+1)=1
- CLK= Pulse, J=1, K=1 β Q(t+1)=QΜ (t)
Flip-Flop Operating Characteristics
The performance of a flip-flop is specified by several operating characteristics found in manufacturer data sheets. These include: Propagation Delay, Set-up Time, Hold Time, Maximum Clock Frequency, Pulse Width, and Power Dissipation.
π Definition β Propagation Delay: The interval of time between when an input is applied and when the output changes. There are four types: clock to low-to-high (t_PLH), clock to high-to-low (t_PHL), preset to low-to-high (t_PLH), and clear to high-to-low (t_PHL). Measurements are taken at the 50% transition marks of both the triggering edge and the resulting output change.
π Definition β Set-up Time (t_s): The minimum time required for the input logic levels to remain stable before the clock transition occurs for the flip-flop to reliably change its output state.
π Definition β Hold Time (t_h): The minimum time for which the input signal must be maintained after the clock transition for the flip-flop to reliably clock in the input signal.
π Definition β Maximum Clock Frequency (f_max): The highest rate at which the flip-flop operates reliably. Exceeding this frequency causes the flip-flop to malfunction.
π Definition β Pulse Width (t_w): The minimum specified duration for the clock, preset, and clear signals to ensure correct flip-flop operation. The clock signal has separate minimum high and low time specifications.
π Definition β Power Dissipation (P): The power consumed by a flip-flop during operation, calculated as P = V_cc Γ I_cc. Example: A flip-flop connected to +5V drawing 5mA dissipates 25 mW. This is critical for selecting an appropriate DC power source for a digital circuit.
One-Shot (Monostable Multivibrator)
A monostable multivibrator has one stable state and one unstable state. When triggered, it temporarily enters the unstable state for a predetermined time determined by an external R-C time constant (RC), then automatically returns to the stable state. The output is a pulse of duration determined by R and C. Two types exist: Nonretriggerable and Retriggerable.
π Definition β One-Shot: A monostable device that produces a single output pulse of a fixed duration when triggered.
π Example: In a basic One-Shot circuit, a triggering pulse at time t1 sets the NOR gate output to low, inverting to high via NOT gate. This high output feeds back to maintain the low NOR output. Capacitor C charges through resistor R. When fully charged at time t2, the NOT gate input goes high, setting its output low and returning the One-Shop to its stable state. The unstable time interval is from t1 to t2, determined by the RC time constant.
1. Nonretriggerable One-Shot
A nonretriggerable One-Shot, once triggered into its unstable state, remains there for a fixed period regardless of any new trigger inputs. It must return to its stable state before it can be triggered again. The duration of input trigger pulses has no effect on the output pulse duration.
2. Retriggerable One-Shot
A retriggerable One-Shot is similar to a nonretriggerable One-Shot, except it can be retriggered even while in its unstable state. If a new trigger is applied, the output pulse is extended from the time of the new trigger.
β Key Takeaways
Asynchronous Preset and Clear inputs are critical for initializing flip-flops to known states (Q=1 or Q=0) independently of the clock, overriding synchronous inputs. Master-Slave flip-flops use a two-stage pulse-triggered architecture with Master enabled on the positive half cycle and Slave on the negative half. Six key flip-flop operating characteristics define performance: propagation delays (clock, preset, clear to output transitions), set-up time, hold time, maximum clock frequency, minimum pulse widths, and power dissipation. A one-shot monostable multivibrator produces a single output pulse of a fixed duration determined by an external R-C time constant, with non-retriggerable types ignoring new triggers while unstable and retriggerable types extending the pulse with each new trigger.
π§ Quick Revision Questions
- What is the difference between synchronous and asynchronous inputs in a flip-flop, and how do Preset and Clear inputs function?
- Explain the operation and timing of a Master-Slave J-K flip-flop, including which stage is enabled during the positive and negative half cycles.
- Define propagation delay, set-up time, and hold time for a flip-flop, and explain why each is important for reliable operation.
- What is the purpose and formula for calculating power dissipation in a flip-flop, and why is it important in digital circuit design?
- Describe the difference between a nonretriggerable and a retriggerable one-shot, including how each responds to trigger inputs while in the unstable state.
π Lecture 26 β THE 555 TIMER
π Overview: This lecture covers timing problems in synchronous digital circuits, including clock skew and race conditions. It then introduces counters, focusing on asynchronous (ripple) counters, their operation, propagation delay issues, and how to design Mod-n counters using flip-flops and integrated circuits like the 74LS93A.
ποΈ Topics Covered
The lecture begins with the timing problem in flip-flop circuits using J-K flip-flops and a common clock. It then explains clock skew and its intermittent effects, followed by race conditions and glitches. The main focus shifts to counters, starting with their classification into asynchronous and synchronous types. Asynchronous counters (ripple counters) are detailed with 3-bit up-counter circuits, timing diagrams including propagation delay, and the limitations at high frequencies. The concept of Mod-n counters is introduced, with examples of a Mod-6 counter and a Mod-10 decade counter. Finally, the 74LS93A integrated circuit asynchronous counter is presented, showing how to configure it as Mod-16, decade, and cascaded frequency dividers.
π Lecture Summary
Timing Problem in flip-flop circuits
In synchronous digital circuits, the output of one flip-flop is connected to the input of a second, with both triggered by a common clock. This can cause a timing problem. For example, when a high-to-low clock transition occurs, the first flip-flop's output begins to change after a propagation delay (tPHL). The input to the second flip-flop must be held stable for its hold time (tH). If the propagation delay of the first flip-flop is less than the hold time requirement of the second, the second flip-flop's output cannot be guaranteed. However, most practical flip-flops have hold times of 5 nsec or less, often 0, so such circuits generally work reliably.
Clock Skew
Clock Skew is a common problem where the same clock signal arrives at different clock inputs at different times due to propagation delays through gates. This can cause different flip-flops to change states asynchronously, leading to unpredictable outputs. For example, if a NAND and NOT gate delay the clock to one flip-flop, the clock skew is the time difference between the two clock signals. If a flip-flop's propagation delay (tPLH) is less than the skew, the next flip-flop will see the changed input at its delayed clock edge, leading to an incorrect state change. If the propagation delay is longer than the skew, the next flip-flop remains unchanged. Timing issues from clock skew are intermittent and difficult to detect, as skew varies with temperature, voltage, and loading. Problems can be eliminated by equalizing clock delays.
Race Conditions
Race conditions occur when multiple internal variables change due to a change in one input variable. Depending on the sequence of these changes, the circuit output operates erratically. In a timing diagram, if the Q and QΜ outputs' transitions are slightly delayed, they can coincide with clock transitions, generating short-duration pulses called glitches. These glitches are difficult to detect. Glitches due to race conditions can be avoided by using a negative-edge triggered flip-flop instead of a positive-edge-triggered one.
Counters
Counter circuits based on flip-flops are widely used in digital systems for counting, frequency division, and as shift registers. Counters are classified into two types. Asynchronous counters do not have all flip-flops triggered simultaneously; only the first receives the clock, and subsequent flip-flops are triggered by the outputs of previous ones. Synchronous counters have all flip-flop clock inputs connected to a common clock, so they receive the clock signal simultaneously. Both types are further classified as up counters or down counters based on their counting sequence.
Asynchronous Counters (Ripple Counters)
Asynchronous counters, also known as Ripple Counters, are implemented by connecting multiple flip-flops where the clock signal is applied only to the first. The Q or QΜ output of each flip-flop provides the clock for the next. As the clock "ripples" through the chain, outputs change one after another. In a 3-bit Asynchronous Up-Counter, all J-K inputs are tied high for toggling. The first flip-flop (F0) toggles on every high-to-low clock transition. The second (F1) toggles on every high-to-low transition of F0. The third (F2) toggles on every high-to-low transition of F1. The outputs cycle through 8 unique states (0 to 7), acting as a Mod-8 counter.
π Definition β Asynchronous Counter: A counter where the flip-flops are not clocked simultaneously; the clock input of each flip-flop is driven by the output of the preceding flip-flop.
π Formula for number of states: 2^m β The maximum number of unique states for a counter with m flip-flops is 2 raised to the power of m. π Example: A 3-bit counter has 2^3 = 8 unique states (000 to 111).
Propagation Delay
The timing diagram of a 3-bit asynchronous counter must account for propagation delay. When the clock transitions, F0 toggles after a delay (tPHL). This transition then causes F1 to toggle after its own delay, and so on. The total delay for the last flip-flop (F2) is the sum of the propagation delays of all three flip-flops. If the counter is extended with more flip-flops, the total delay might exceed the clock period, causing timing problems. Asynchronous counters cannot operate at very high clock frequencies and can cause issues with decoding circuits.
π Formula: Total Delay for last FF = Sum of all individual FF propagation delays β The time for the final output to stabilize is the cumulative sum of delays in the chain. π Example: With high frequency, at interval t4, a clock transition toggles F0 after tPHL. This delayed transition toggles F1 after its tPHL, and that transition toggles F2 after its tPLH. The result is that at interval t5, the output is 010 instead of the intended 100, showing an incorrect count.
π Definition β Propagation Delay: The time it takes for a change at the input of a flip-flop to appear at its output, denoted as tPHL (high to low) and tPLH (low to high).
Mod-n Counters
The Modulus (Mod) of a counter is the total number of unique states in its counting sequence. While a standard m-bit counter has 2^m states, counters can be designed to have a truncated sequence with fewer states. This is done by resetting the counter to 0 when it reaches the intended last state. The reset is achieved by connecting the active-low Clear (CLR) inputs of all flip-flops to the output of a combinational circuit (e.g., a NAND gate). This circuit activates (goes low) when it detects the specific count value that should trigger the reset.
π Definition β Modulus (Mod): The number of unique states through which a counter sequences before it repeats. π Example: A Mod-6 Counter uses three flip-flops but only counts from 000 to 101 (6 states). When it reaches state 110, the NAND gate outputs a low signal, resetting all flip-flops to 000. The output frequency at F2 is 1/6th of the input clock frequency.
π Formula: Output Frequency = Input Clock Frequency / Modulus β The counter divides the input clock frequency by its Mod number. π Example: A Mod-6 counter divides the clock frequency by 6.
Mod-10 Counter (Decade Counter)
A Decade Counter is a Mod-10 counter that uses four flip-flops to count through 10 unique states (0000 to 1001). It is reset when it would normally count to the next state, 1010. The outputs F1 and F3 are connected to a NAND gate, which resets all flip-flops to 0000 when both are logic 1 (detecting 1010). The output frequency is 1/10th of the input clock frequency.
π Example: The decade counter counts 0, 1, 2, ..., 9. Upon the 10th input pulse, it resets to 0. The output signal at the most significant bit has a frequency equal to the input frequency divided by 10.
Integrated Circuit Asynchronous Counters
The 74LS93A is a 4-bit asynchronous counter IC. It has two clock inputs (CLKA and CLKB) and two reset inputs (RO1 and RO2) that are inputs to an internal NAND gate, which is connected to the clear inputs of all four flip-flops. By connecting the IC pins in different ways, various counter configurations can be made:
- MOD-16 Counter: Connect CLKB to Q0 output. This makes the four flip-flops a single 4-bit binary counter.
- Decade Counter: Connect CLKB to Q0. Connect Q1 and Q3 to RO1 and RO2. This creates a MOD-10 counter.
- Cascading for Frequency Division: Two 74LS93A ICs can be cascaded to create larger counters. For example, a divide-by-50 counter is made by configuring the first IC as a MOD-10 counter and the second as a MOD-5 counter, then connecting the Q3 output of the first to the CLKB input of the second.
π Example: A divide-by-50 counter uses two 74LS93A ICs. The first divides the input clock by 10, and its output drives the second IC which divides by 5, resulting in an output that is 1/50th of the original input frequency.
β Key Takeaways
The most critical concepts from this lecture are the timing problems in synchronous circuits, specifically clock skew and race conditions, which can cause intermittent and glitchy behavior. The core learning is the operation of asynchronous counters, where the clock "ripples" through flip-flops, leading to a cumulative propagation delay that limits their maximum speed. You must understand the concept of the Modulus (Mod) of a counter and how to design truncated sequences (like a Mod-6 or Decade counter) by using feedback to reset the counter at a desired state. Finally, you should be able to explain how a standard IC like the 74LS93A can be configured for different Mod numbers and how multiple ICs can be cascaded to create larger frequency dividers.
π§ Quick Revision Questions
- What is clock skew, and why does it cause intermittent timing problems in synchronous circuits?
- Explain why asynchronous counters are also called "ripple counters" and describe the main disadvantage of this architecture regarding propagation delay.
- How many flip-flops are needed for a Mod-12 counter, and what is the formula to determine this number?
- Describe the process of creating a truncated sequence counter (e.g., a Mod-6 counter) using the asynchronous clear (CLR) inputs of flip-flops.
- Explain how you would configure a single 74LS93A IC to function as a decade (Mod-10) counter. Which pins must be externally connected?
π Lecture 27 β DOWN COUNTERS
π Overview: This lecture introduces down counters, which count downward from a maximum value to zero, and explains how they are implemented using J-K flip-flops with Q outputs connected to subsequent flip-flops. It also covers synchronous counters, which use a common clock signal to eliminate propagation delay issues, enabling reliable high-frequency operation for multi-bit counting applications.
ποΈ Topics Covered
The lecture covers 3-bit asynchronous down-counters and their timing diagrams, down-counters configured to count truncated sequences by presetting to maximum rather than clearing, synchronous counters with common clock input for simultaneous flip-flop triggering, 3-bit and 4-bit synchronous binary counters with AND gates for proper sequencing, and a synchronous decade counter using logic gates to reset after reaching state 1001.
π Lecture Summary
3-bit Asynchronous Down-Counter
A down counter counts in a sequence starting with some maximum count value and counts down to binary zero, then resets to the maximum value and repeats. It is implemented by connecting the Q output instead of the Q output of all flip-flops to the clock inputs of the next flip-flops. In Figure 27.1, the 3-bit asynchronous down-counter uses negative edge-triggered J-K flip-flops with Fβ's Q output driving Fβ's clock input, and Fβ's Q output driving Fβ's clock input. The timing diagram shows the counter progressing from 111 down to 000 and then repeating, with each flip-flop toggling on the negative transition of its clock input.
π Definition β Down Counter: A counter that counts downward from a maximum value (e.g., 111) to binary zero, then resets to the maximum and repeats the sequence.
π Example: In Figure 27.1b, at tβ, Fβ toggles from 0 to 1 (Q=1); at tβ, Fβ toggles to 0 (Q=0) which causes Fβ to toggle from 0 to 1; at tβ, Fβ toggles to 1; at tβ, Fβ toggles to 0 causing Fβ to toggle to 0 and Fβ to toggle to 1 (since Fβ's Q output transitions from 1 to 0). The sequence continues: tβ =011, tβ=010, tβ=001, tβ=000, then repeats at tβ=111.
π‘ Why this matters: Down counters are essential for applications requiring countdown timers, such as real-time clocks, industrial controllers, and digital stopwatches.
Down Counter with Truncated Sequence
A down counter with truncated sequence counts down from the maximum count value to some predefined last count value. On reaching the last count value, the down-counter is preset to the maximum count value (instead of being cleared to zero as in up-counters). Figure 27.2a shows a 3-bit down-counter configured to count down from 111 to 011. When the counter reaches 011 and decrements to 010, the NAND gate outputs logic 0, which presets all three flip-flops to 111. The counter then continues from 111 down to 110 and 101.
π Definition β Truncated Sequence Down Counter: A counter that counts down from maximum to a predefined lower value, then presets back to maximum rather than clearing to zero.
π Example: In Figure 27.2b, the counter counts: tβ=111, tβ=110, tβ=101, tβ=100, tβ =011. At tβ, it would go to 010 but instead Fβ, Fβ, and Fβ are set to 111 via presetting. The sequence continues: tβ=110, tβ=101 (the counter repeats every 5 clock pulses instead of 8).
Synchronous Counters
Synchronous counters use a common clock signal connected to the clock inputs of all counter flip-flops, so on a clock transition all flip-flops change their output state simultaneously. This eliminates timing problems caused by excessive propagation delays in asynchronous counters, especially for 8, 16, and 32-bit applications operating at high clock frequencies. Figure 27.3a shows a 2-bit synchronous counter where both J-K flip-flops share the same clock input. The J-K inputs of the second flip-flop are connected to the Q output of the first flip-flop.
π Definition β Synchronous Counter: A counter where all flip-flops are simultaneously triggered by a common clock signal, eliminating rippling delays.
π‘ Why this matters: Synchronous counters are essential for high-speed digital systems like microprocessors, where precise timing is critical and propagation delays cannot be tolerated.
π Example: In Figure 27.3b, at tβ, Fβ toggles to 1 (since J=K=1) while Fβ remains 0 (since its J-K inputs were 0 at the clock transition). At tβ, Fβ toggles to 0 and Fβ toggles to 1 (since Fβ's previous high output made J-K of Fβ=1). At tβ, Fβ toggles to 1 but Fβ stays 1 (since Fβ's output changed after the clock edge). At tβ, both toggle: Fβ to 0 and Fβ to 0.
3-bit & 4-bit Synchronous Counters
Multi-bit synchronous counters larger than 2 bits require an AND gate. Figure 27.4a shows a 3-bit synchronous counter where the outputs Fβ and Fβ are connected to a 2-input AND gate, whose output connects to the J-K inputs of the third flip-flop. This ensures the third flip-flop toggles only when both Fβ and Fβ are logic 1, which occurs at intervals tβ (011β100) and tβ (111β000). Without the AND gate, if Fβ directly drove the third flip-flop, Fβ would toggle at tβ when only Fβ is high, disturbing the count sequence.
A 4-bit synchronous binary counter uses four flip-flops. The fourth flip-flop's J-K inputs connect through a 3-input AND gate with inputs Fβ, Fβ, and Fβ. The fourth flip-flop changes state only when outputs of the first three flip-flops are all logic 1, occurring when counting from 0111 to 1000 and from 1111 to 0000.
π Formula: J-Kβ = Fβ Β· Fβ (for 3-bit counter) β The third flip-flop toggles only when Fβ AND Fβ are both 1 J-Kβ = Fβ Β· Fβ Β· Fβ (for 4-bit counter) β The fourth flip-flop toggles only when Fβ AND Fβ AND Fβ are all 1
π Example: In Figure 27.4b, at tβ: Fβ=1, Fβ=0, Fβ=0. At tβ: Fβ=0, Fβ=1, Fβ=0. At tβ: Fβ=1, Fβ=1, Fβ=0 (AND gate output=0 because Fβ just became 1). At tβ: Fβ=0, Fβ=0, Fβ=1 (both Fβ and Fβ were 1 just before, so AND gate output=1 enabled Fβ to toggle).
4-bit Synchronous Decade Counter
A synchronous decade counter counts from 0000 to 1001 (0 to 9) and then resets to 0000. Instead of using clear asynchronous inputs, logic gates reset the counter after reaching state 1001. The J-K inputs are determined by Boolean expressions derived from the function table (Table 27.1):
- Fβ: J-K connected to logic high (toggles every clock)
- Fβ: J-K = Fβ Β· Fβ' (toggles when Fβ=1 AND Fβ=0)
- Fβ: J-K = Fβ Β· Fβ (toggles when both Fβ and Fβ are 1)
- Fβ: J-K = Fβ Β· Fβ Β· Fβ + Fβ Β· Fβ (toggles when all three lower bits are 1 OR when Fβ and Fβ are both 1)
π Definition β Synchronous Decade Counter: A synchronous counter that counts from 0000 to 1001 (ten states) using logic gates for the J-K inputs instead of asynchronous clear inputs.
π Example: At clock pulse 9, the state is 1001 (Fβ=1, Fβ=0, Fβ=0, Fβ=1). At clock pulse 10, the counter should go to 0000. The expression FβΒ·Fβ becomes 1Β·1=1 for Fβ, which would normally cause Fβ to toggle, but since Fβ=0 and the expression also depends on Fβ, the overall logic resets Fβ to 0 and Fβ remains 0, achieving the decade transition.
β Key Takeaways
Down counters are implemented using Q outputs rather than Q outputs to achieve downward counting. Truncated sequence down counters use presetting to maximum instead of clearing to zero when reaching the last count. Synchronous counters eliminate propagation delay issues by using a common clock for all flip-flops, enabling high-frequency operation. For synchronous counters larger than 2 bits, AND gates are essential to ensure proper timing of higher-order flip-flop toggling. The synchronous decade counter achieves 0-9 counting using carefully designed Boolean expressions for each flip-flop's J-K inputs, resetting after state 1001 without relying on asynchronous clear inputs.
π§ Quick Revision Questions
- What is the key difference in flip-flop output connections between an up-counter and a down-counter?
- In a truncated sequence down counter, what happens when the counter reaches its last count value?
- Why do synchronous counters require AND gates for 3-bit and larger implementations?
- What Boolean expression controls the J-K inputs of the fourth flip-flop in a synchronous decade counter?
- Why are synchronous counters preferred over asynchronous counters for high-frequency applications with multiple bits?