π Lecture 28 β Timing Diagram of a Synchronous Decade Counter
π Overview: This lecture explores the timing behavior and implementation of synchronous decade counters and Mod-n counters using integrated circuits. It covers cascading counters for larger count sequences, configuring IC counters with truncated sequences, and the operation of up-down counters, which are essential for building practical digital counting systems.
ποΈ Topics Covered
The lecture covers Mod-n synchronous counter design, the 74HC163 4-bit synchronous counter IC and its timing diagram, the 74HC160 decade counter, cascading counters using enable inputs and RCO outputs, configuring IC counters as Mod-n counters with truncated sequences using load and clear methods, cascaded counters with truncated sequences, and the implementation of up-down counters.
π Lecture Summary
Timing Diagram of a Synchronous Decade Counter
A synchronous decade counter uses J-K flip-flops with simultaneous clock triggering to count a truncated sequence of ten unique states (0000 to 1001). The timing diagram shows how the counter outputs (F0, F1, F2, F3) change at each clock transition from t1 to t10, completing one full decade cycle. The Modulus number represents the unique number of states, and the number of flip-flops required is determined by the relation n = 2^m, where m is the number of flip-flops.
Mod-n Synchronous Counter
A Mod-n Synchronous Counter can be implemented using an appropriate number of J-K flip-flops connected together with their clocks triggered simultaneously. A synchronous counter which counts a truncated sequence of n unique states can be similarly implemented.
π Definition β Modulus number: The unique number of states which the counter counts in a sequence.
π Formula: n = 2^m β The Modulus number (n) equals 2 raised to the power of m, where m is the number of flip-flops.
Integrated Circuit Synchronous Counters
Instead of connecting a large number of flip-flops together to form large synchronous counters, counter circuits available in Integrated Circuit form can be quickly connected. The 74HC163 is a 4-bit Synchronous Counter with the following pins:
- Parallel data inputs D0, D1, D2 and D3
- Data outputs Q0, Q1, Q2 and Q3
- Positive edge-triggered CLOCK signal
- Active-low CLR input which resets the Counter output to 0000
- Active-low LOAD input which loads the 4-bit data applied at the counter inputs
- Active-high ENT and ENP enable inputs β for the counter to operate both must be high
- The RCO (Ripple Clock Output) goes high when the Counter reaches the terminal count 1111. The RCO output along with ENT and ENP enable input pins are used to cascade multiple counter ICs.
Referring to the timing diagram, the CLR signal is activated between interval t0 and t1. The counter output is reset synchronously at interval t1 as the CLR signal is active at interval t1. The LOAD signal is activated between interval t1 and t2. At the clock transition at t2, the counter is loaded with the 4-bit data. The ENP and ENT enable signals are activated before interval t3 and the counter increments at clock transitions at t3 and t4. When the counter reaches count 15 at interval t4, the RCO is set to high. At intervals t5, t6, t7 and t8 the counter counts to 0, 1, 2 and 3. The enable signal ENP is deactivated after interval t8, inhibiting further counting.
The 74HC160 is a 4-bit Synchronous Decade counter with the same pins as the 74HC163. The RCO output of the decade counter is activated when the counter reaches its terminal count 1001.
π‘ Why this matters: These IC counters simplify building large counting systems by providing ready-made, cascadable modules with clear, load, and enable functions.
Cascading Counters
It is very convenient to cascade Integrated Circuit counters together to form larger counters. The enable inputs and RCO outputs allow cascading of multiple counters. Two 74HC160 decade counters can be connected together to divide the input frequency by 10 and 100.
In the timing diagram, at interval t9 the first decade counter reaches terminal count 1001. The RCO output of the first counter is set to logic 1. The RCO of the first counter is connected to the ENP and ENT enable pins of the second counter, so the second counter is enabled. At interval t10 on a positive clock transition, the first counter increments to 0000. Since the second counter is also enabled, it increments to 0001. As soon as the first counter goes to 0000, the RCO signal is deactivated, inhibiting the second counter. The first counter counts from 0001 to 1000 in intervals t11 to t19. At interval t19, the first counter again reaches terminal count 1001, the RCO becomes active, activating the second counter. At interval t20, the first and second counters increment to 0000 and 0010 respectively. The RCO is again deactivated. This sequence continues.
Integrated Circuit Counters with Truncated Sequences
A decade counter can be implemented by truncating the counting sequence of a MOD-16 counter. The 74HC163 can be configured as a Mod-7 counter. The counter is preset with the count value 1001 by setting the LOAD/NORMAL input to logic 1 at the NOR gate input. At the positive clock transition t1, the count value is loaded. The counter increments and at interval t7 it reaches the terminal count. The RCO output is set to logic 1 which sets the LOAD input to logic 0. At the positive clock transition at interval t8, the preset value 1001 is reloaded.
Another method to configure an IC counter is to reset the counter when it reaches the maximum count value of its truncated sequence. This requires extra logic gates that determine the terminating state and reset the counter. The 74HC161 has an Asynchronous Clear input, whereas the 74HC163 has a synchronous Clear input. At time interval t9, the counter increments to 1001 which sets the AND gate output to logic 1. The NOR gate output goes low, activating the clear input and resetting the counter to 0000. The 74HC163 with synchronous clear would reset at interval t10 when there is a clock transition.
π Example: To implement a Mod-9 counter, the 74HC161 (with asynchronous clear) must be used instead of the 74HC163 (with synchronous clear) because the clear must occur immediately when count 1001 is reached, not at the next clock edge.
Cascaded Counters with Truncated Sequences
Three cascaded 74HC163 counters can be configured to count in a truncated sequence. The 12-bit cascaded counter is loaded with initial count value 1000 0000 0000. When the counter counts to 1111 1111 1111, the RCO output set to logic 1 by the third counter reloads the initial count values 0000, 0000 and 1000 in all three counters. The 12-bit counter can be configured for maximum count sequence as Modulus 4096 counter. The counter has been configured to count from 1000 0000 0000 to 1111 1111 1111, which is 2048 states or Modulus 2048 counter.
Up-Down Counter
An up-down counter can increment its output count value at each clock transition or decrement its count value at each clock transition, depending upon the count mode. The counter can be reconfigured during its count sequence.
π Definition β Up-Down Counter: A counter that can either increment (up-count) or decrement (down-count) its output at each clock transition.
For the up-counting sequence of a 3-bit synchronous counter, from Clock Pulse 0 to 7, the outputs Q2, Q1, Q0 count from 000 to 111. For the down-counting sequence, from Clock Pulse 0 to 7, the outputs count from 111 to 000.
For the down-counting sequence, the output Q0 of the first flip-flop toggles between 0 and 1, therefore the J-K inputs are connected to logic 1. The output Q1 of the second flip-flop toggles when Q0 output is logic 0 or Q0 is logic 1. The output Q2 of the third flip-flop toggles when Q0 and Q1 outputs are both logic 0 or both logic 1.
π Observation for down-counter: Q0 toggles always (J=K=1); Q1 toggles when Q0=0; Q2 toggles when Q0 and Q1 are both 0. This is the complement condition compared to the up-counter.
β Key Takeaways
The 74HC163 is a 4-bit synchronous counter with synchronous clear, while the 74HC161 has asynchronous clear β this difference is critical when designing truncated counters where immediate reset at a specific count is required. Cascading counters using RCO and enable pins allows building larger counters efficiently, and truncated sequences can be achieved either by loading a preset value when the terminal count is reached or by clearing the counter asynchronously at the desired maximum count. Up-down counters combine both counting directions using J-K inputs that toggle based on different conditions for up and down modes. The modulus of a counter determines the number of flip-flops needed via the relation 2^m β₯ n.
π§ Quick Revision Questions
- What is the difference between synchronous and asynchronous clear inputs, and why does this matter when designing a Mod-9 counter using IC counters?
- How does the RCO output function when cascading two 74HC160 decade counters, and what happens at the moment the first counter reaches terminal count?
- In a 3-bit up-down counter, what condition must be true for Q1 to toggle in down-counting mode versus up-counting mode?
- How is a 74HC163 configured as a Mod-7 counter using the LOAD input and RCO output?
- What is the relationship between the number of flip-flops (m) and the maximum modulus (n) of a counter, and how is a truncated sequence implemented?
π Lecture 29 β UP/DOWN COUNTER
π Overview: This lecture covers the design and implementation of synchronous up/down counters, including the 74HC190 integrated circuit counter. It explains counter decoding techniques, the problem of glitches and their elimination through strobing, and presents practical applications such as digital clocks and frequency counters. The lecture concludes with a systematic design procedure for sequential circuits (state machines) using state diagrams, next-state tables, Karnaugh maps, and logic implementation.
ποΈ Topics Covered
The lecture covers synchronous down-counters and their similarity to up-counters, the implementation of a combined up/down counter with additional logic, and the 74HC190 4-bit synchronous up/down counter IC. It discusses counter decoding using AND/NAND gates, the problem of decoder glitches due to propagation delays, and the strobing method to eliminate glitches. Practical counter applications include a digital clock circuit using divide-by-60 counters and a frequency counter circuit. The lecture also details the systematic design procedure for sequential circuits, including state diagrams, next-state tables, flip-flop transition tables, Karnaugh maps, and logic implementation, specifically for a 3-bit up/down counter.
π Lecture Summary
DOWN COUNTER
The down-counter is implemented by connecting the AND gate to the complementary outputs (QΜ ) of the first and second flip-flops instead of the Q outputs used in an up-counter. The circuit is very similar to the up-counter, with the only change being the connection of the AND gate to the QΜ 0 and QΜ 1 outputs. When Q0 is logic 0, QΜ 0 is logic 1, enabling the next flip-flop to toggle. Similarly, when both Q0 and Q1 are logic 0, QΜ 0 and QΜ 1 are logic 1, enabling flip-flop 3 to toggle.
UP/DOWN COUNTER
The up-counter and down-counter can be implemented as a single counter circuit by adding extra logic. In this circuit, the UP/DOWN input is set to logic 1 to count up or logic 0 to count down. When the UP/DOWN input is logic 1, the upper AND gates are enabled, allowing flip-flops to toggle based on the Q outputs (up-counting). When the UP/DOWN input is logic 0, the lower AND gates are enabled, allowing flip-flops to toggle based on the QΜ outputs (down-counting). The UP/DOWN input can be changed at any time during the counting sequence to reverse the direction.
74HC190 INTEGRATED CIRCUIT UP/DOWN DECADE COUNTER
The 74HC190 is a 4-bit synchronous up/down counter available as an integrated circuit. It features parallel data inputs (DββDβ), data outputs (QββQβ), a positive edge-triggered clock, an active-low LOAD input, an active-low CTEN (counter enable) input, a D/U (down/up) input to select counting direction, a MAX/MIN output that goes high when the terminal count (1001 for up, 0000 for down) is reached, and a RCO (ripple clock output) that goes low at the terminal count during the negative half of the clock cycle. The RCO and MAX/MIN outputs, along with the CTEN input, are used to cascade multiple counter ICs for larger counters.
π Definition β CTEN: Counter enable input; when active-low, it enables the counter to count. π Definition β RCO: Ripple clock output; goes low when the counter reaches the terminal count (1001 counting up or 0000 counting down), remaining low during the negative half of the clock cycle. Used for cascading counters.
COUNTER DECODING
Counter decoding uses decoders or logic gates to determine when a counter is in a specific state. For example, a decoder can be implemented using AND or NAND gates to detect outputs like 0100 (4), 1000 (8), and 1100 (12) from a 4-bit counter. The propagation delay due to the ripple effect in asynchronous counters and slight variations in propagation delays in synchronous counters can cause glitches β short, spurious pulses at decoder outputs.
π‘ Why this matters: Glitches can cause erratic behavior in digital circuits that rely on decoded counter outputs for sequencing.
Glitches can be eliminated by using the strobing method, where a clock signal is used to enable the decoder gates after the glitches have settled. The decoder gates are enabled only during the second, positive half of the clock signal, while they are disabled during the first negative half when glitches occur. This allows the decoder outputs to be activated only after a delay, ensuring stable outputs.
COUNTER APPLICATIONS
1. Digital Clock: A digital clock is implemented using the AC 50 Hz frequency as the clock signal. The circuit includes a divide-by-50 counter to generate a 1 Hz signal, divide-by-60 counters for seconds and minutes (counting 0 to 59), and a decade counter with a flip-flop for hours (counting 1 to 12). The divide-by-60 counter is implemented by cascading two 74HC160A decade counters β a units counter (0000 to 1001) and a tens counter configured as a Mod-6 counter (000 to 101). A NAND gate detects the count 110 to reset the tens counter to 000. The hours counter uses a single decade counter and a J-K flip-flop, counting 12 unique states.
2. Frequency Counter: A frequency counter measures the frequency of an input signal by counting clock pulses in a predetermined time interval. The frequency (Hz) equals the number of clock pulses counted divided by the sampling interval (seconds). The circuit uses an AND gate to pass the input signal to the counter during a sampling interval. The accuracy of the frequency counter depends on the accuracy of the sampling interval, which is implemented using cascaded counters connected to a crystal-controlled oscillator. A J-K flip-flop divides the timing signal by 2 to control the sampling interval.
π‘ Why this matters: The longer the sampling interval, the more accurate the frequency measurement, as fewer pulses are missed or counted incorrectly due to the start and stop of the sampling window.
DESIGN OF SYNCHRONOUS COUNTERS
A general sequential circuit (state machine) consists of a combinational circuit and a memory circuit (flip-flop). The present state of the memory is represented by state variables, and on a clock transition, the memory changes to the next state, determined by excitation inputs. The design procedure follows six steps.
Design Procedure Steps:
- State Diagram: Shows the sequence of states through which the sequential circuit progresses when clocked.
- Next-State Table: Lists each present state and the corresponding next state.
- Flip-flop Transition Table: Lists all possible flip-flop input combinations that allow the present state to change to the next state on a clock transition.
- Karnaugh Maps: For each state variable, J-K inputs are mapped from the next-state table and transition table.
- Logic expressions for Flip-flop Inputs: Simplified Boolean expressions are obtained from the Karnaugh maps.
- Sequential Circuit Implementation: The Boolean expressions are implemented using logic gates and flip-flops.
IMPLEMENTING A 3-BIT UP/DOWN COUNTER
Step 1 - State Diagram: A state diagram for a 3-bit up/down counter shows that when input X=0, the counter counts up (000 β 001 β 010 β ... β 111 β 000), and when X=1, it counts down (000 β 111 β 110 β ... β 001 β 000).
Step 2 - Next-State Table: The next state table lists present states and next states for both X=0 and X=1. For example, present state 000 has next state 001 for X=0 and 111 for X=1.
Step 3 - Flip-flop Transition Table: Using the J-K flip-flop transition table, the J and K inputs required for each state transition are determined for both X=0 and X=1.
Step 4 - Karnaugh Maps: The J and K inputs for each flip-flop are mapped to 4-variable Karnaugh maps (with variables Qβ, Qβ, Qβ, and X).
Step 5 - Logic expressions for Flip-flop Inputs: From the Karnaugh maps, the simplified Boolean expressions are:
- Jβ = QβQβXΜ + QΜ βQΜ βX
- Kβ = QβQβXΜ + QΜ βQΜ βX
- Jβ = QβXΜ + QΜ βX
- Kβ = QβXΜ + QΜ βX
- Jβ = 1
- Kβ = 1
Step 6 - Sequential Circuit Implementation: The Boolean expressions are implemented using logic gates and three J-K flip-flops. The X input (up/down control) is connected to the gates along with the Q outputs to create the correct counting sequence.
π Definition β State variables: Variables (Q outputs of flip-flops) that represent the present state of the memory in a sequential circuit. π Definition β Excitation inputs: The inputs (J and K for J-K flip-flops) applied to the memory elements that determine the next state on a clock transition. π Formula: For a 3-bit up counter:
- Jβ = QβQβ
- Kβ = QβQβ
- Jβ = Qβ
- Kβ = Qβ
- Jβ = 1
- Kβ = 1
π Example: For the 3-bit up/down counter, when present state is 000 and X=0 (up), the next state is 001. The J-K inputs are Jβ=0, Kβ=x, Jβ=0, Kβ=x, Jβ=1, Kβ=x, causing Qβ to toggle from 0 to 1 on the clock transition.
β Key Takeaways
A student must remember that synchronous up/down counters use additional logic to control counting direction, with the 74HC190 IC providing a compact 4-bit implementation. Counter decoding uses logic gates to detect specific states, but glitches caused by propagation delays must be eliminated using the strobing method where decoder outputs are enabled only after glitches have settled. Practical applications like digital clocks and frequency counters rely on cascaded counters with accurate timing signals. The systematic design procedure for sequential circuits β state diagram, next-state table, flip-flop transition table, Karnaugh maps, logic expressions, and circuit implementation β is essential for designing counters with arbitrary counting sequences, as demonstrated with the 3-bit up/down counter.
π§ Quick Revision Questions
- What is the only difference between a synchronous up-counter and a synchronous down-counter circuit?
- How does the UP/DOWN input control the counting direction in an up/down counter?
- What are glitches in counter decoding, and how does the strobing method eliminate them?
- Explain how a divide-by-60 counter is implemented using two 74HC160A decade counters.
- List the six steps in the sequential circuit design procedure and the simplified Boolean expressions for Jβ, Kβ, Jβ, Kβ, Jβ, and Kβ for a 3-bit up/down counter.
π Lecture 30 β DIGITAL CLOCK
π Overview: This lecture examines the complete design of a digital clock using cascaded counter circuits, including the divide-by-60 seconds/minutes counter and the 12-hour operation of the hours counter. It then introduces the design of a frequency counter for measuring unknown signal frequencies and transitions into the formal design methodology for Clocked Synchronous State Machines, including Mealy and Moore machine definitions.
ποΈ Topics Covered
The lecture covers the timing analysis of a divide-by-60 minutes/seconds counter including the operation of units and tens counters with RCO signals and clear logic. It describes the hours counter circuit configured as a decade counter with a J-K flip-flop and NAND gate logic to implement the 12-hour reset. It then presents a complete frequency counter circuit design, explaining how sampling intervals and crystal-controlled oscillators ensure accurate frequency measurement. Finally, it introduces the formal design procedure for Synchronous Counters and Clocked Synchronous State Machines, distinguishing between Mealy and Moore machines.
π Lecture Summary
Digital Clock
The timing diagram figure 30.1a shows the time interval tβ to tββ and tββ to tββ. At time interval tβ the units counter counts to 1001 (9) which is the terminal count of the 74x160 decade counter. The RCO signal is set to logic 1 to indicate the terminal count. The RCO signal is connected to the ENP and ENT enable signals of the tens counter. At interval tββ the tens counter is incremented by 1, the units counter recycles to 0000 (0) and the RCO signal is deactivated inhibiting the tens counter from incrementing. At interval tββ the units counter once again reaches its terminal count activating the RCO signal and enabling the tens counter to increment its initial count 0001 to 0010. The counting sequence continues until the tens counter increments to 0101 (5) and the units counter recycles to 0000 and continues with the counting sequence on each positive clock transition.
The timing diagram fig 30.1b shows the timing sequence from interval tβ β to tββ. The unit counter reaches its terminal count at interval tβ β. The output of the 3-input AND gate is set to logic high. The output of the AND gate is connected to the ENP and ENT enable inputs of the next counter, thus enabling the next counter. At interval tββ, on a positive clock transition the units counter recycles to 0000, the tens counter increments to 0110 (6) setting the output of the NAND gate to logic 0 and the next counter increments its count. The NAND gate output is connected to the asynchronous active low clear input of the tens counter which is asynchronously cleared to 0000.
π Definition β Terminal Count: The maximum count value of a counter (e.g., 1001 for a decade counter), at which the RCO (Ripple Carry Output) signal is set to logic 1.
π Definition β RCO (Ripple Carry Output): A signal that indicates when a counter has reached its terminal count, used to enable the next counter in a cascaded configuration.
π Formula: Divide-by-60 counter operation β Two cascaded decade counters (units and tens) where the tens counter counts from 0000 to 0101 (0-5), enabling a 3-input AND gate at the terminal count of both units and tens, while a NAND gate at count 0110 (6) asynchronously clears the tens counter.
Hours Counter
The hours unit counter circuit is configured as a decade counter, counting from 0000 to 1001 when it is enabled by the Minutes counter circuit. The NOT gate connected to the clock input of the J-K flip-flop allows the negative-edge triggered J-K flip-flop to trigger when the units counter is triggered to count from 0000 to 1001. The terminal count 1001 is detected by the NAND gate (1) at interval tβ which sets the J input of the flip-flop to logic 1. The K input of the flip-flop is at Logic 0, therefore on a clock transition at interval tββ the JβK flip-flop output Q is set to logic 1, the units counter recycles to 0000 resetting J input to logic 0.
The unit counter counts to 0001 and 0010 to represent hours 11 and 12 in interval tββ and tββ respectively. At interval tββ as the unit counters count changes from 1011 (11) to 1100 (12), Qβ output is set to logic 1, which sets the output of the NAND gate to logic 0 as the other input of the NAND is already at logic 1 (Q). The NAND gate sets the K input to logic 1 and setting the active-low LOAD signal to logic 0. At interval tββ, at the positive clock transition the unit counter is reloaded with the count 0001, the J-K flip-flop output toggles to logic 0 from logic 1. As the units counter is reloaded with count 0001, the K input is set to logic 0. At intervals tββ, tββ and tββ the hours unit counter increments the hours count by 1.
π Definition β Hours Counter: A decade counter configured with a J-K flip-flop and NAND gates to implement the 12-hour clock cycle, reloading to 0001 (1) after reaching count 1100 (12).
π‘ Why this matters: The hours counter design demonstrates how standard decade counters can be modified using feedback logic (NAND gates and J-K flip-flops) to implement non-standard counting sequences like the 12-hour format.
Frequency Counter
A frequency counter is used to measure the frequency of an input signal. The basis for the operation of a frequency counter is counting of the clock pulses in a predetermined time interval. The frequency of periodic signal is the number of cycles in a time period of one second. The frequency of the unknown signal can be calculated by counting the number of clock pulses of the unknown signal and dividing the count number by the time interval in which the clock pulses are counted, Figure 30.3.
In the circuit shown, the input signal with unknown frequency is applied at the AND gate input. The second input of the AND gate is connected to a signal which determines the sampling interval. The signal is set to logic high at interval tβ to enable the AND gate allowing the input signal to be connected to the clock input of the counter circuit. The sampling interval signal is set to logic low at the end of the sampling interval tβ to disable the AND gate and inhibit the counter from counting. Before the counter counts the clock pulses of the input signal it is reset by activating the Asynchronous input to clear the counter. At the end of the sampling interval the counter output is displayed on 7-segment displays.
The accuracy of the frequency counter depends on the duration of the timing sampling interval, which must be very accurate. Consider that during a sampling interval of 1 second 4573 clock pulses of the input signal are measured. Thus, the frequency of the unknown signal is 4573 Hz. If the same input signal is sampled using a 0.1 second sampling interval then 457.3 pulses are counted, which means that either 457 or 458 will be counted depending on the start of the sampling interval at tβ. Thus the frequency is determined to be either 4570 or 4580. Similarly, if the sampling interval is reduced to 0.01 seconds, the numbers of clock pulses measured are 45.73, which means that either 45 or 46 will be read indicating a frequency of 4500 or 4600.
Very accurate sampling intervals are implemented using cascaded counters which are connected to a very accurate timing signal generated by a crystal controlled oscillator (Astable multi-vibrator). The output timing signal of each cascade section is available at a switch which is used to select the appropriate timing signal for controlling the sampling interval. The output of the switch is connected to the clock input of a negative triggered J-K flip-flop, which divides the input signal by 2. Thus, when the 1 Hz sampling interval is selected, the signal at the output of the J-K flip-flop has a time period of 2 seconds. Figure 30.4.
The detailed circuit diagram and the timing diagram of the frequency counter are shown in figure 30.5. In the timing diagram the Sampling Interval pulse is obtained from the output of the J-K flip-flop shown in figure 30.4. The duration of the Sampling interval pulse can be selected through the switch. The sampling interval signal is connected to the input of the 3-input AND gate and the clock input of the second J-K flip-flop which toggles its output at each negative transition of the clock. When the output of the second flip-flop changes to logic 1 (interval tβ) it triggers the One-Shot which generates a short output pulse which clears the Counter circuit. At interval tβ during the positive half of the sampling interval when the output of the second J-K flip-flop is high the 3-input AND gate is enabled and the input signal with unknown frequency is applied at the input of the counter, which counts the input signal pulses. At interval tβ there is negative transition of the sampling signal, which triggers the second flip-flop changing its output to logic 0. Logic 0 output of the flip-flop disables the 3-input AND gate inhibiting the counter from counting. The pulses counted by the counter during interval tβ to tβ are directly displayed.
π Definition β Frequency Counter: A circuit that measures the frequency of an unknown signal by counting clock pulses within a precise sampling interval, with frequency = (number of pulses counted) / (sampling interval duration).
π Formula: Frequency measurement accuracy β f = N/T, where N is the number of clock pulses counted and T is the sampling interval duration. Shorter sampling intervals reduce accuracy due to fractional pulse counting errors.
π Example: With a 1-second sampling interval, 4573 pulses are counted β frequency = 4573 Hz. With a 0.1-second interval, 457 or 458 pulses β frequency = 4570 or 4580 Hz (less accurate).
Design of Synchronous Counters
The counters that have been discussed are binary counters that count in a sequence either upwards or downwards. The count start and end sequence of a counter can also be set arbitrarily and the counter can then count up or down within the terminal count limits. Counters can also be designed that do not count in a sequence, instead they sequence through a set of predefined arbitrary values. Counters can also be implemented using D flip-flops instead of J-K flip-flops. No formal method of designing Counters has been discussed; however during the study of synchronous counters a general procedure was discussed which helps in the implementation of the counters. The procedure requires listing of the binary counting sequence and then determining the input condition for each flip-flop which promotes a change in their output state. The input conditions are dependent on the previous start outputs of the flip-flops and are implemented by using logic gates. The method does help in implementing counters but it is not a comprehensive method for the design and implementation of different types of counters.
π Definition β Synchronous Counters: Binary counters that count in a predefined sequence (up or down) where all flip-flops share a common clock signal.
Clocked Synchronous State Machines
The Synchronous Counters are the simplest forms of Clocked Synchronous State Machines. State Machine is a generic name given to Sequential circuits. The Sequential circuits use a clock signal to change from one state to the other and all the flip-flops are connected to a single clock signal, therefore it is a Clocked Synchronous State Machine.
A general Sequential circuit consists of a combinational circuit and a memory element. The memory element is made of a set of n flip-flops all connected to a common clock. The n flip-flops store 2βΏ states. The flip-flops change their current state to the next state on each clock transition. The next state is determined by the current state and the external input. The output of the State Machine is determined by the current state and external input. The inputs to the memory which allow the memory to change its state on a clock transition are known as excitation inputs or excitation variables. The present state of the memory is represented by state variables. The state variables and the inputs to the sequential circuit determine the sequential circuit output.
The Sequential circuit whose output depends on the current state and the input is known as Mealy Machine. Figure 30.6a. Sequential circuits whose output is determined by the current state only is known as Moore Machine. Figure 30.6b.
π Definition β Clocked Synchronous State Machine: A sequential circuit where all flip-flops are connected to a single clock signal, and the next state is determined by the current state and external inputs.
π Definition β Mealy Machine: A sequential circuit whose output depends on both the current state and the external input.
π Definition β Moore Machine: A sequential circuit whose output depends only on the current state.
π Definition β Excitation Variables: The inputs to the memory elements (flip-flops) that allow the memory to change its state on a clock transition.
Design Procedure
The design and implementation of Synchronous Counters follows an established set of steps and rules which start from defining the state diagram and end at the implementation of the State machine.
State Diagram
A sequential circuit (state machine) is described by a state diagram, which shows the sequence of states through which the sequential circuit progresses when it is clocked. The state diagram of a 3-bit Synchronous Up-Counter (sequential circuit) is shown in the figure 30.7, Figure 30.7.
π Definition β State Diagram: A graphical representation showing the sequence of states a sequential circuit progresses through when clocked.
π Example: A 3-bit Up-Counter state diagram shows eight states (000 to 111) with transitions on each clock pulse, incrementing the binary count by 1.
β Key Takeaways
The design of a digital clock requires careful cascading of decade counters using RCO signals and enable inputs, where the divide-by-60 seconds/minutes counter uses both 3-input AND gates for enabling the next stage and NAND gates for asynchronous clearing. The hours counter is a specialized design that uses a J-K flip-flop and NAND gate logic to detect counts 1001 (9) and 1100 (12), reloading to 0001 (1) to implement the 12-hour cycle. Frequency counters operate by counting unknown signal pulses within a precisely controlled sampling interval, where accuracy directly depends on the duration of the sampling interval β longer intervals yield greater precision. The formal design of sequential circuits introduces Clocked Synchronous State Machines, categorized as Mealy machines (output depends on current state and input) and Moore machines (output depends only on current state), with state diagrams providing the graphical foundation for the design procedure.
π§ Quick Revision Questions
- How does the RCO signal enable the tens counter in the divide-by-60 minutes/seconds counter when the units counter reaches its terminal count of 1001?
- What logic circuit detects the hours count of 1100 (12) and how does it cause the units counter to reload to 0001?
- Why does reducing the sampling interval in a frequency counter from 1 second to 0.1 seconds decrease measurement accuracy?
- What is the fundamental difference between a Mealy Machine and a Moore Machine in terms of how the output is determined?
- How does the 3-input AND gate and the J-K flip-flop in the detailed frequency counter circuit ensure the counter is cleared before each new measurement cycle?
π Lecture 31 β Lesson No. 31
π Overview: This lecture covers the complete process of designing synchronous sequential circuits, specifically a 3-bit up-counter, starting from the state diagram to the final circuit implementation. It demonstrates how to derive next-state tables, use flip-flop transition tables, apply Karnaugh maps for simplification, and implement the counter using both J-K and S-R flip-flops.
ποΈ Topics Covered
The lecture progresses through the sequential design process: starting with the Next-State Table definition, then the Flip-flop Transition Table for J-K and S-R flip-flops, followed by Karnaugh Map simplification for flip-flop input expressions, and finally the Sequential Circuit Implementation showing the counter circuit and its timing diagram using both J-K and S-R flip-flops.
π Lecture Summary
2. NEXT-STATE TABLE
Once the state diagram of the sequential circuit is defined, a Next-State Table is derived which lists each present state and the corresponding next state. The next state is the state to which the sequential circuit switches when a clock transition occurs.
π Definition β Next-State Table: A table that lists all possible present states (QβQβQβ) and the corresponding next state (QββΊQββΊQββΊ) after a clock transition.
π Example: Table 31.1 shows the Next-State Table for a 3-bit up-counter. For present state 000, the next state is 001. For present state 111, the next state is 000 (it wraps around).
3. Flip-flop Transition Table
The Memory element of the Sequential circuit is implemented using flip-flops. The number of flip-flops used is determined by the total number of states. The Flip-flop transition table lists all possible flip-flop input combinations which allow the present state to change to the next state on a clock transition.
π Definition β J-K flip-flop Transition Table (Table 31.2):
- J=0, K=x (don't care) β Qβ=0 becomes Qβββ=0
- J=1, K=x β Qβ=0 becomes Qβββ=1
- J=x, K=1 β Qβ=1 becomes Qβββ=0
- J=x, K=0 β Qβ=1 becomes Qβββ=1
π‘ Why this matters: The J-K flip-flop has "don't care" conditions that simplify logic expressions, making it more flexible than S-R or D flip-flops.
4. Karnaugh Maps
For each state variable shown in the Next-State table, the change from present state to next state on a clock transition depends upon the J-K inputs. The table is completed using the information in the Next-State table and the J-K flip-flop transition table.
π Definition β Karnaugh Map: A graphical method for simplifying Boolean expressions, where adjacent cells differ by only one variable.
π Formulas (from Table 31.4):
- Jβ = QβQβ
- Kβ = QβQβ
- Jβ = Qβ
- Kβ = Qβ
- Jβ = 1
- Kβ = 1
π Example: For this 3-bit up-counter, Jβ and Kβ are always 1, meaning the least significant flip-flop toggles on every clock pulse. Jβ and Kβ are tied to Qβ, so the second flip-flop toggles only when Qβ=1.
5. Logic expressions for Flip-flop Inputs
Simplified expressions for Jβ-Kβ, Jβ-Kβ, and Jβ-Kβ are directly obtained from the Karnaugh maps. These expressions represent the minimal logic needed to drive each flip-flop.
6. Sequential Circuit Implementation
The Boolean expressions obtained are implemented using logic gates to create the sequential circuit.
π Example: Figure 31.1 shows the implementation of the 3-bit synchronous up-counter using J-K flip-flops. Each flip-flop has its J and K inputs connected according to the simplified expressions, and all share a common clock (CLK) signal.
S-R flip-flop based Implementation
To implement the counter using S-R flip-flops instead of J-K flip-flops, the S-R transition table is used. The S-R flip-flop does not allow S and R inputs to be set to logic 1 and 1 respectively (invalid state).
π Definition β S-R flip-flop Transition Table (Table 31.5):
- S=0, R=x β Qβ=0 becomes Qβββ=0
- S=1, R=0 β Qβ=0 becomes Qβββ=1
- S=0, R=1 β Qβ=1 becomes Qβββ=0
- S=x, R=0 β Qβ=1 becomes Qβββ=1
π Formulas (from Table 31.7):
- Sβ = QβQβQβ
- Rβ = Qβ'QβQβ
- Sβ = Qβ'Qβ
- Rβ = QβQβ
- Sβ = Qβ'
- Rβ = Qβ
π Example: In the S-R flip-flop implementation (Figure 31.2a), the first flip-flop's S and R inputs are cross-connected to its Q and Q' outputs (Sβ = Qβ', Rβ = Qβ). At interval tβ, Qβ=0, so R=0 and S=1, setting the flip-flop to logic 1 on the clock transition. At tβ, Qβ=1, so S=0 and R=1, resetting it to 0. The second flip-flop (FF2) toggles when Qβ=1, and the third (FF3) toggles when both Qβ and Qβ are 1.
β Key Takeaways
The sequential circuit design process follows six systematic steps: defining the state diagram, creating the next-state table, selecting flip-flop type and using its transition table, deriving Karnaugh maps for flip-flop inputs, simplifying to get Boolean expressions, and implementing the circuit with logic gates. For a 3-bit up-counter, J-K flip-flops yield simpler expressions (Jβ=Kβ=1, Jβ=Kβ=Qβ, Jβ=Kβ=QβQβ) compared to S-R flip-flops (Sβ=QβQβQβ, Rβ=Qβ'QβQβ, etc.), demonstrating the design trade-offs. The "don't care" conditions in J-K flip-flops allow for more compact circuits, making them preferred for counter implementations.
π§ Quick Revision Questions
- What is the purpose of a Next-State Table in sequential circuit design, and what information does it contain?
- Why does the J-K flip-flop often produce simpler logic expressions than the S-R flip-flop for the same sequential circuit?
- For the 3-bit up-counter using J-K flip-flops, what are the simplified expressions for Jβ and Kβ?
- What is the invalid input combination for an S-R flip-flop, and why is it invalid?
- In the S-R flip-flop implementation of the 3-bit counter, why does the second flip-flop only change state when Qβ=1?
π Lecture 32 β D FLIP-FLOP BASED IMPLEMENTATION
π Overview: This lecture focuses on implementing sequential circuits using D flip-flops instead of J-K flip-flops, using D transition tables and Karnaugh maps to derive simplified input expressions. It also covers the design of a 3-bit Up/Down Synchronous Counter using J-K flip-flops, and introduces the concept of state reduction to eliminate equivalent states for simpler circuit design. Understanding these methods is crucial for optimizing digital systems.
ποΈ Topics Covered
The lecture covers the D flip-flop transition table and its use in implementing a 3-bit synchronous counter, deriving simplified logic expressions from Karnaugh maps for D inputs, and analyzing the resulting timing diagram. It then transitions to implementing a 3-bit Up/Down counter using J-K flip-flops, including state diagrams, next-state tables, and Karnaugh maps for J-K inputs. Finally, it introduces state reduction by identifying and eliminating equivalent states to minimize the number of flip-flops and simplify the circuit.
π Lecture Summary
Flip-Flop Transition Table
To implement a counter using D flip-flops, the D transition table is used. The D flip-flop has a single input, and the output follows the input. The D flip-flop transition table shows that when the input D is 1, the next output (Q_{t+1}) is 1; when D is 0, the next output is 0.
π Definition β D Flip-Flop Transition Table: A table showing the relationship between the D input and the next state output. For (Q_t \rightarrow Q_{t+1}), D = (Q_{t+1}).
| Flip-flop Inputs | Output Transitions |
|---|---|
| D | (Q_{t+1}) |
| 1 | 1 |
| 0 | 0 |
Karnaugh Maps
The D input table is derived from the present state and next state of a 3-bit counter. The Karnaugh maps for the input expressions Dβ, Dβ, and Dβ are created from this table.
| Present State | Next State | D flip-flop inputs |
|---|---|---|
| Qβ Qβ Qβ | Qβ Qβ Qβ | Dβ Dβ Dβ |
| 0 0 0 | 0 0 1 | 0 0 1 |
| 0 0 1 | 0 1 0 | 0 1 0 |
| 0 1 0 | 0 1 1 | 0 1 1 |
| 0 1 1 | 1 0 0 | 1 0 0 |
| 1 0 0 | 1 0 1 | 1 0 1 |
| 1 0 1 | 1 1 0 | 1 1 0 |
| 1 1 0 | 1 1 1 | 1 1 1 |
| 1 1 1 | 0 0 0 | 0 0 0 |
Table 32.2 D flip-flop input table
Logic expressions for Flip-flop Inputs
Simplified expressions for Dβ, Dβ, and Dβ are obtained from the Karnaugh maps.
π Formula:
- (D_2 = Q_2 \oplus Q_1 Q_0)
- (D_1 = Q_0 \oplus Q_1)
- (D_0 = Q_0)
π‘ Why this matters: These simplified expressions are directly used to design the combinational logic for the counterβs next state, making the circuit simpler and more efficient.
Sequential Circuit Implementation
The D flip-flop implementation is described. The first D flip-flop toggles at each clock transition. The input to the second flip-flop is determined by (D_1 = Q_0 \oplus Q_1). The input to the third flip-flop is determined by (D_2 = Q_2 \oplus Q_1 Q_0).
π Example: For the second flip-flop, at intervals tβ, tβ, tβ , and tβ, the input Dβ is at logic 0, setting output Qβ to logic 0. At intervals tβ, tβ, tβ, and tβ, the input Dβ is at logic 1, setting output Qβ to logic 1. For the third flip-flop, at intervals tβ, tβ, tβ, and tβ, Dβ input is at logic 0, setting Qβ to 0. At intervals tβ, tβ , tβ, and tβ, Dβ input is at logic 1, setting Qβ to logic 1.
Implementing a 3-bit Up/Down Counter
A 3-bit Up/Down Synchronous Counter is implemented using J-K flip-flops. The counter counts up when input X = 0 and counts down when X = 1.
7. State Diagram
The state diagram of a 3-bit Up/Down Synchronous Counter is shown. X=0 and X=1 indicate the counting direction.
8. Next-State Table
The next-state table shows the next state for both X=0 (up counting) and X=1 (down counting).
| Present State | Next State X=0 | Next State X=1 |
|---|---|---|
| Qβ Qβ Qβ | Qβ Qβ Qβ | Qβ Qβ Qβ |
| 0 0 0 | 0 0 1 | 1 1 1 |
| 0 0 1 | 0 1 0 | 0 0 0 |
| 0 1 0 | 0 1 1 | 0 0 1 |
| 0 1 1 | 1 0 0 | 0 1 0 |
| 1 0 0 | 1 0 1 | 0 1 1 |
| 1 0 1 | 1 1 0 | 1 0 0 |
| 1 1 0 | 1 1 1 | 1 0 1 |
| 1 1 1 | 0 0 0 | 1 1 0 |
Table 32.4 Next-State Table for a 3-bit Up-Counter
9. Flip-flop Transition Table
The flip-flop transition table is based on the J-K flip-flop. It shows the required J and K inputs for all possible output transitions.
| Flip-flop Inputs | Output Transitions |
|---|---|
| J K | (Q_t \rightarrow Q_{t+1}) |
| 0 x | 0 0 |
| 1 x | 0 1 |
| x 1 | 1 0 |
| x 0 | 1 1 |
Table 32.5 J-K flip-flop Transition table
10. Karnaugh Maps
The J-K flip-flop inputs for both X=0 and X=1 are mapped to 4-Variable Karnaugh maps to derive simplified expressions.
11. Logic expressions for Flip-flop Inputs
Simplified expressions for Jβ-Kβ, Jβ-Kβ, and Jβ-Kβ are obtained from the Karnaugh maps.
π Formula:
- (J_0 = 1, K_0 = 1)
- (J_1 = Q_0 \overline{X} + \overline{Q_0} X, K_1 = \overline{Q_0}\overline{X} + Q_0 X)
- (J_2 = Q_1 Q_0 \overline{X} + \overline{Q_1} \overline{Q_0} X, K_2 = \overline{Q_1} Q_0 \overline{X} + Q_1 \overline{Q_0} X)
12. Sequential Circuit Implementation
The Boolean expressions are implemented using logic gates to create the full sequential circuit.
State Reduction
A state diagram shows the sequence of current and next states. Two states are considered equivalent if, for the same set of inputs, they change to the same next state (or equivalent next states) and give identical outputs. If equivalent states exist, one is removed, leading to fewer flip-flops and a simpler circuit. Reduction in the number of states is possible if only the input-output relationship is of interest.
π Definition β Equivalent States: Two states are equivalent if, for every possible input, they transition to the same next state (or equivalent next states) and produce the same output.
π Example: Consider the state sequence a, b, c, f, d, d, e, g, e, g, d, e, a, f, d, e, a. In the next-state table, state βfβ and state βgβ are equivalent as for each input set they transition to βdβ and βeβ and have identical outputs. State βgβ is eliminated and replaced by βfβ. Further, state βcβ and state βeβ are found to be equivalent and state βeβ is eliminated and replaced by βcβ. This reduces the number of unique states from seven to five.
| Present State | Next State | Output |
|---|---|---|
| X=0 X=1 | X=0 X=1 | |
| a | f b | 0 0 |
| b | b c | 1 1 |
| c | a f | 0 1 |
| d | c d | 1 0 |
| f | d c | 0 0 |
Table 32.9c Final simplified Next State table
π‘ Why this matters: Eliminating equivalent states reduces the number of required flip-flops. In this example, reducing from seven to five states did not change the number of flip-flops (still three), but if the number of states were reduced to four, only two flip-flops would be needed, resulting in a simpler and cheaper circuit.
β Key Takeaways
This lecture is critical for understanding how to implement counters using different flip-flop types and how to optimize sequential circuits. Key points include mastering the D flip-flop transition table and using Karnaugh maps to derive simplified input expressions for a 3-bit counter. For the up/down counter, you must be able to create next-state tables for both counting directions and derive J-K input expressions from 4-variable Karnaugh maps. Finally, the concept of state reduction is essential; you must be able to identify equivalent states in a state diagram, eliminate them, and understand how this process can minimize the number of flip-flops and simplify the overall circuit design.
π§ Quick Revision Questions
- According to the D flip-flop transition table, what should the D input be to change the output from 0 to 1?
- What are the simplified Boolean expressions for Dβ, Dβ, and Dβ for the 3-bit D flip-flop based synchronous counter?
- In the 3-bit Up/Down counter, what is the next state for the present state 101 when X=1 (counting down)?
- What is the formula for Jβ in the 3-bit Up/Down counter, and what does the variable X represent?
- In the state reduction example, which two pairs of states were identified as equivalent and subsequently reduced?