By the end of this chapter you'll be able to…

  • 1Explain why n flip-flops give at most 2 to the n states
  • 2Describe the forbidden state of an SR latch and its race condition
  • 3Explain why latch transparency is a problem in a clocked system
  • 4Distinguish edge triggering from level sensitivity
  • 5Describe how a master-slave pair achieves edge behaviour
  • 6State the characteristic equation of each flip-flop type
  • 7Explain why the JK flip-flop has no forbidden state
  • 8Build a T and a D flip-flop from a JK
  • 9Use an excitation table to derive flip-flop inputs for a transition
  • 10State the full synchronous design procedure
  • 11Define setup and hold time and describe metastability
  • 12Compute the maximum clock frequency from the setup inequality
  • 13Explain why a hold violation cannot be fixed by slowing the clock
  • 14Explain how clock skew affects the two constraints differently
  • 15Distinguish SISO, SIPO, PISO and PIPO registers
  • 16State the state counts of ring and Johnson counters
  • 17Explain why a ripple counter shows transient wrong values
  • 18Compare ripple and synchronous counters by delay and logic cost
  • 19Compute the flip-flop count for a modulo-N counter
  • 20Explain what self-correction means and why it matters
  • 21Distinguish Mealy from Moore machines by output dependence
  • 22Compare the two styles on state count, timing and glitch risk
  • 23Explain why converting Mealy to Moore usually adds states
  • 24Apply the partitioning method for state minimisation
  • 25State the termination condition for state minimisation
  • 26Explain when reducing states actually saves hardware
💡
Why this chapter matters in GATE
A sequential circuit's output depends on the history of its inputs, and that history is not stored in some diffuse way: it lives entirely in a fixed number of state bits, so a circuit with n flip-flops has at most 2 to the n states and its complete behaviour is a table of next states and outputs. Writing that table is the whole of the analysis, and almost every examinable question is one step of it. The second organising fact is that a synchronous circuit is a race against the clock period, since combinational logic between two flip-flops must settle before the next edge arrives. That single inequality determines the maximum clock frequency, explains setup and hold violations, and justifies pipelining. The third is that latches and flip-flops differ in when they listen rather than in what they store: a latch is transparent while enabled, a flip-flop captures only at an edge, and nearly every timing question turns on that distinction.

Before you start — revise these

🔗
Combinational Circuits
The next-state logic of any sequential circuit is combinational, and hazards in that logic are what asynchronous inputs and latch enables are vulnerable to.
🔗
Boolean Algebra & K-maps
Minimising flip-flop input equations is a K-map exercise, and the don't cares in excitation tables are why JK designs minimise so well.

Sequential Circuits

A sequential circuit's output depends on the history of its inputs, not only on their present values. That history is not stored in some diffuse way — it lives entirely in a fixed number of state bits, and everything the circuit can remember must be encodable in those bits.

The consequence is that a sequential circuit with flip-flops has at most states, and its complete behaviour is a table listing, for every state and every input, the next state and the output. Writing that table is the whole of the analysis, and almost every examinable question is a step of it.

The second organising fact is that a synchronous circuit is a race against the clock period. Combinational logic between two flip-flops must settle before the next edge arrives, and that single inequality determines the maximum clock frequency, explains setup and hold violations, and justifies pipelining.

The third is that latches and flip-flops differ in when they listen, not in what they store. A latch is transparent while its enable is asserted; a flip-flop captures only at an edge. Nearly every timing question turns on that distinction.

1. Latches

An SR latch is built from two cross-coupled NOR gates, or equivalently two cross-coupled NAND gates. Setting stores a 1 and setting stores a 0, while both low holds the previous value.

Asserting and together is forbidden in the NOR version, because it drives both outputs to 0, breaking the invariant that and are complements. Worse, when both inputs are released simultaneously, the final state depends on which gate is faster — a race condition with an unpredictable outcome.

The gated SR latch adds an enable, so the inputs take effect only while the enable is asserted. The D latch fixes the forbidden state entirely by deriving from , so the two can never be asserted together.

A D latch is transparent while the enable is high: the output follows the input continuously. That transparency is precisely the problem in a clocked system, because a signal can pass through several latches in one clock phase.

2. Flip-Flops

A flip-flop samples its input at a clock edge rather than during a level, which stops the transparency problem.

Edge triggering is achieved either by a master-slave pair of latches driven by opposite clock phases, or by an edge-detecting circuit. In the master-slave arrangement, the master is transparent while the clock is high and the slave while it is low, so data advances by exactly one stage per clock cycle.

The four types differ in how their inputs map to the next state.

TypeCharacteristic equationNotes
SR required
DNo forbidden state
JK toggles
TToggles on

The JK flip-flop removes the forbidden state by redefining it as a toggle, which is why it is the most general of the four and why any other type can be built from it.

A T flip-flop is a JK with both inputs tied together, and a D flip-flop is a JK with tied to . Conversions in the other direction need a small amount of combinational logic derived from the excitation table.

3. Excitation Tables

A characteristic equation answers "given the inputs, what is the next state". An excitation table answers the reverse: "given the required transition, what inputs are needed".

Transition SRJKDT
0 to 00X0X00
0 to 1101X11
1 to 001X101
1 to 1X0X010

The X entries are don't cares and they are the reason JK designs minimise so well. Every JK transition has one don't care, which supplies free flexibility on the K-map.

The design procedure for any synchronous sequential circuit follows a fixed sequence: draw the state diagram, build the state table, assign binary codes to states, use the excitation table to find the flip-flop inputs for each transition, minimise those input functions with K-maps, and draw the circuit.

Only the excitation-table step depends on which flip-flop type is used, which is why converting a design between types is mechanical.

4. Timing

Two constraints bound every flip-flop.

Setup time is the interval before the clock edge during which the data input must already be stable. Hold time is the interval after the edge during which it must remain stable. Violating either can drive the flip-flop into a metastable state, where the output hovers between levels for an unbounded time.

For two flip-flops separated by combinational logic, the clock period must accommodate the whole path:

where is the clock-to-output delay of the first flip-flop and is the worst-case combinational delay between them.

The maximum clock frequency is the reciprocal of that minimum period, and it is set by the slowest path in the design, not the average one. This is exactly why pipelining raises clock frequency: inserting registers shortens the longest combinational path.

The hold constraint is different in kind, because it does not involve the clock period at all:

A hold violation cannot be fixed by slowing the clock, since the inequality has no clock term. It is fixed by adding delay to the fast path, which is why a design can fail hold timing at any frequency.

Clock skew — the difference in clock arrival time between two flip-flops — relaxes one constraint and tightens the other, which is why clock distribution is designed so carefully.

5. Registers and Shift Registers

A register is a group of flip-flops sharing a clock, storing a word. A shift register additionally connects each output to the next input, so data moves one position per clock.

Four configurations are named by how data enters and leaves.

TypeInputOutput
SISOSerialSerial
SIPOSerialParallel
PISOParallelSerial
PIPOParallelParallel

A SIPO register is a serial-to-parallel converter and a PISO is the reverse, which is what makes them the core of any serial communication interface.

Two feedback arrangements produce counters from shift registers. A ring counter feeds the last output back to the first input and cycles through states for flip-flops, using a one-hot encoding.

A Johnson or twisted-ring counter feeds back the complement and cycles through states, doubling the count at the cost of a decoding that is slightly less trivial. Neither uses the full states available, which is the trade for having no decoding logic at all in the ring case.

6. Counters

An asynchronous or ripple counter clocks each flip-flop from the output of the previous one. The delays accumulate, so the last stage settles only after flip-flop delays, and during that interval the counter shows transient values that are simply wrong.

Those transients are why ripple counters cannot drive decoders directly without glitches, and why they are unsuitable for high frequencies.

A synchronous counter clocks every flip-flop from the same edge, so all stages change together and the only delay is one flip-flop delay plus the combinational logic feeding the inputs. The cost is that combinational logic, which grows with the number of stages.

A modulo- counter needs flip-flops. A mod-10 counter therefore needs 4, and the six unused states must be handled — either by forcing a reset when the count reaches 10, or by treating them as don't cares in the design.

A counter that can enter an unused state and never return is said to lack self-correction. A self-correcting design guarantees that every unused state eventually leads back into the main cycle, which matters because power-up state is arbitrary.

7. Finite State Machines

A finite state machine is the general form of a sequential circuit, and the two styles differ only in where the output is computed.

In a Moore machine the output depends only on the current state. In a Mealy machine it depends on the current state and the current input.

The consequences are precise and are examined directly.

PropertyMooreMealy
Output depends onState onlyState and input
Number of statesUsually moreUsually fewer or equal
Output timingChanges only at clock edgesCan change between edges
Glitch riskLowHigher
Response to inputOne cycle laterSame cycle

A Mealy machine reacts a cycle earlier because the input feeds the output directly, which is an advantage when latency matters and a liability when the output must be glitch-free.

Any Mealy machine can be converted to a Moore machine and vice versa. Converting Mealy to Moore generally increases the state count, because a state that produces different outputs for different inputs must be split into several states, each carrying one output value.

8. State Minimisation

Two states are equivalent if, for every possible input sequence, they produce the same output sequence. Merging equivalent states reduces the flip-flop count when it crosses a power-of-two boundary.

The partitioning method finds equivalences systematically. Begin by partitioning states into groups producing the same output. Then repeatedly split any group whose members transition, under some input, into different groups. When no further split occurs, each remaining group is a set of equivalent states.

The termination condition is worth stating exactly: stop when a full pass produces no new split. Stopping early leaves distinguishable states merged, and the resulting machine is simply wrong.

Reducing the state count does not always reduce hardware. Going from 5 states to 4 saves a flip-flop, since 4 states need 2 bits while 5 need 3, but going from 8 to 7 saves nothing, because both still need 3 bits and the next-state logic may even grow.

9. Worked Examples

Example 1. A JK flip-flop has and applied continuously with a 100 MHz clock. What is the frequency at the output?

With , the characteristic equation becomes , so the flip-flop toggles on every clock edge.

Two clock edges are therefore required for the output to complete one full cycle: one to go from 0 to 1 and one to return.

The output frequency is half the clock frequency: 50 MHz.

This is exactly why a chain of toggling flip-flops forms a ripple counter, with each stage halving the frequency again. A 4-stage chain divides by 16.

Example 2. A synchronous circuit has flip-flops with clock-to-output delay 2 ns, setup time 1 ns and hold time 0.5 ns, separated by combinational logic with worst-case delay 6 ns and best-case delay 0.4 ns. Find the maximum clock frequency and check the hold constraint.

Apply the setup inequality.

The maximum frequency is ns, which is approximately 111 MHz.

Now check hold, using the minimum combinational delay because the danger is data arriving too early.

ns, which must be at least the hold time of 0.5 ns. Since 2.4 exceeds 0.5, the hold constraint is satisfied.

The point worth extracting is that the two constraints use opposite extremes of the combinational delay: setup uses the worst case and hold uses the best case. And had hold failed, slowing the clock would not have helped, because the clock period appears nowhere in the hold inequality.

Example 3. How many flip-flops are needed for a mod-12 counter, and how many states are unused?

The number of flip-flops is .

Three flip-flops give 8 states, which is insufficient. Four give 16, which suffices.

So 4 flip-flops are needed, counting 0 through 11.

The unused states are 12, 13, 14 and 15, that is 4 unused states.

Those four must be handled deliberately. The usual approach is to detect the count reaching 12 and force an asynchronous clear, which returns the counter to 0. The alternative is to treat the four as don't cares during minimisation, which produces simpler logic but risks a design that can lock up if it powers on in an unused state.

A self-correcting design is one where every unused state leads back into the main cycle within a few clocks, and checking this requires computing the next state for each unused code rather than assuming the don't cares behaved conveniently.

Example 4. Convert a D flip-flop into a T flip-flop.

The required behaviour is , and the available flip-flop obeys .

Equating the two: .

So the conversion needs a single XOR gate, with and the flip-flop's own output as its inputs, feeding the input.

Verify against the excitation table. When the flip-flop must hold, and , which reloads the current value. When it must toggle, and , which does exactly that.

The general procedure for any conversion is the same: write the characteristic equation of the target, write the characteristic equation of the available device, and solve for the available device's inputs in terms of the target's inputs and .

Example 5. A Mealy machine detects the sequence 101 on a serial input, with overlapping allowed. How many states does it need, and how many would a Moore machine need?

The Mealy machine needs three states, tracking how much of the pattern has been seen.

State : nothing matched yet. State : a 1 has been seen. State : 10 has been seen.

From , an input of 1 completes the pattern, so the output is asserted on that transition. Because overlapping is allowed, the machine then moves to rather than , since the final 1 can begin the next match.

Three states suffice for the Mealy version, because the output is attached to a transition rather than to a state.

A Moore machine needs a fourth state. Since its output depends only on the state, there must be a distinct state that means "pattern just completed" and carries output 1. From that state, the machine behaves like on subsequent inputs.

So the Moore version needs four states, and its output appears one clock cycle later than the Mealy version's — the standard trade of a cleaner, registered output against an extra cycle of latency.

Example 6. Reduce the machine with states A, B, C, D where the outputs are A: 0, B: 0, C: 1, D: 0, and the next states on input 0 are A to B, B to A, C to D, D to B, and on input 1 are A to C, B to C, C to A, D to C.

Begin with an output partition. States with output 0 are and with output 1 is .

Now split any group whose members go to different groups under some input. Call the first group and the second .

Under input 0: A goes to B, which is in . B goes to A, in . D goes to B, in . All three agree.

Under input 1: A goes to C, in . B goes to C, in . D goes to C, in . All three agree again.

No split occurs on this pass, so the partition is final: and .

All three of A, B and D are equivalent and merge into a single state, so the machine reduces from 4 states to 2.

That reduction crosses a power-of-two boundary — 2 states need 1 flip-flop where 4 needed 2 — so it saves genuine hardware. Note that the termination condition was a complete pass with no split, and stopping after examining only input 0 would have reached the same partition here but does so only by luck.

Summary

All of a sequential circuit's history lives in its state bits, so flip-flops give at most states and the state table is the complete description.

A latch is transparent while enabled; a flip-flop captures only at an edge, which is what stops data racing through several stages in one clock phase.

The SR latch has a forbidden input combination; the JK removes it by redefining that case as a toggle, which is why any other type can be built from a JK.

Excitation tables invert the characteristic equations and are the only design step that depends on the flip-flop type.

The clock period must exceed , using the worst-case combinational delay. The hold constraint uses the best-case delay and contains no clock term, so a hold violation cannot be fixed by slowing the clock.

A ring counter gives states and a Johnson counter , neither using the full .

Ripple counters accumulate delay and show transient wrong values; synchronous counters change together at the cost of extra logic.

A mod- counter needs flip-flops, and the unused states must be handled or the design may not self-correct.

Moore outputs depend on state alone and change only at clock edges; Mealy outputs depend on state and input, respond a cycle earlier, and can glitch. Mealy machines usually need fewer states.

State minimisation partitions by output, then splits repeatedly until a full pass produces no split — and it saves hardware only when the count crosses a power-of-two boundary.

Key formulas & results

Everything to memorise for the exam hall, in one card. Screenshot this for revision.

The organising tool
ALL OF A CIRCUIT'S HISTORY LIVES IN ITS STATE BITS. n FLIP-FLOPS GIVE AT MOST 2^n STATES, AND THE STATE TABLE IS THE COMPLETE DESCRIPTION.
WRITING THAT TABLE IS THE WHOLE OF THE ANALYSIS, AND ALMOST EVERY EXAMINABLE QUESTION IS ONE STEP OF IT.
Latch versus flip-flop
A LATCH IS TRANSPARENT WHILE ITS ENABLE IS ASSERTED; A FLIP-FLOP CAPTURES ONLY AT A CLOCK EDGE.
TRANSPARENCY IS THE PROBLEM IN A CLOCKED SYSTEM, BECAUSE A SIGNAL CAN RACE THROUGH SEVERAL LATCHES IN ONE CLOCK PHASE.
The SR forbidden state
ASSERTING S AND R TOGETHER DRIVES BOTH OUTPUTS TO 0, BREAKING THE INVARIANT THAT Q AND NOT-Q ARE COMPLEMENTS.
RELEASING BOTH SIMULTANEOUSLY LEAVES THE FINAL STATE DEPENDENT ON WHICH GATE IS FASTER, WHICH IS A RACE WITH AN UNPREDICTABLE OUTCOME.
Characteristic equations
SR: Q+ = S + NOT-R TIMES Q, REQUIRING SR = 0. D: Q+ = D. JK: Q+ = J NOT-Q + NOT-K Q. T: Q+ = T XOR Q.
THE JK REMOVES THE FORBIDDEN STATE BY REDEFINING J = K = 1 AS A TOGGLE, WHICH IS WHY ANY OTHER TYPE CAN BE BUILT FROM A JK.
Flip-flop conversion
A T FLIP-FLOP IS A JK WITH BOTH INPUTS TIED TOGETHER. A D FLIP-FLOP IS A JK WITH K TIED TO NOT-J. A D BECOMES A T BY FEEDING IT T XOR Q.
THE GENERAL PROCEDURE IS TO EQUATE THE TARGET'S CHARACTERISTIC EQUATION WITH THE AVAILABLE DEVICE'S AND SOLVE FOR THE AVAILABLE DEVICE'S INPUTS.
Excitation tables
AN EXCITATION TABLE ANSWERS WHAT INPUTS PRODUCE A REQUIRED TRANSITION, WHICH IS THE REVERSE OF A CHARACTERISTIC EQUATION.
EVERY JK TRANSITION HAS ONE DON'T CARE, WHICH SUPPLIES FREE FLEXIBILITY ON THE K-MAP AND IS WHY JK DESIGNS MINIMISE SO WELL.
The design procedure
STATE DIAGRAM, STATE TABLE, STATE ASSIGNMENT, EXCITATION TABLE, K-MAP MINIMISATION OF THE INPUT EQUATIONS, THEN THE CIRCUIT.
ONLY THE EXCITATION-TABLE STEP DEPENDS ON WHICH FLIP-FLOP TYPE IS USED, WHICH IS WHY CONVERTING A DESIGN BETWEEN TYPES IS MECHANICAL.
Setup and hold
SETUP TIME IS THE INTERVAL BEFORE THE CLOCK EDGE DURING WHICH DATA MUST BE STABLE. HOLD TIME IS THE INTERVAL AFTER IT DURING WHICH DATA MUST REMAIN STABLE.
VIOLATING EITHER CAN DRIVE THE FLIP-FLOP INTO METASTABILITY, WHERE THE OUTPUT HOVERS BETWEEN LEVELS FOR AN UNBOUNDED TIME.
The setup inequality
T_clk MUST BE AT LEAST T_cq PLUS T_comb PLUS T_setup, USING THE WORST-CASE COMBINATIONAL DELAY.
THE MAXIMUM CLOCK FREQUENCY IS THE RECIPROCAL, SET BY THE SLOWEST PATH RATHER THAN THE AVERAGE ONE. THIS IS EXACTLY WHY PIPELINING RAISES FREQUENCY.
The hold inequality
T_cq PLUS THE MINIMUM COMBINATIONAL DELAY MUST BE AT LEAST T_hold.
IT CONTAINS NO CLOCK TERM, SO A HOLD VIOLATION CANNOT BE FIXED BY SLOWING THE CLOCK. IT IS FIXED BY ADDING DELAY TO THE FAST PATH.
Clock skew
SKEW IS THE DIFFERENCE IN CLOCK ARRIVAL TIME BETWEEN TWO FLIP-FLOPS, AND IT RELAXES ONE CONSTRAINT WHILE TIGHTENING THE OTHER.
THIS IS WHY CLOCK DISTRIBUTION NETWORKS ARE DESIGNED SO CAREFULLY, AND WHY A DESIGN CAN PASS SETUP AND FAIL HOLD ON THE SAME PATH.
Register configurations
SISO, SIPO, PISO AND PIPO, NAMED BY WHETHER DATA ENTERS AND LEAVES SERIALLY OR IN PARALLEL.
A SIPO IS A SERIAL-TO-PARALLEL CONVERTER AND A PISO IS THE REVERSE, WHICH IS WHAT MAKES THEM THE CORE OF ANY SERIAL COMMUNICATION INTERFACE.
Ring and Johnson counters
A RING COUNTER FEEDS THE LAST OUTPUT BACK TO THE FIRST INPUT AND GIVES n STATES. A JOHNSON COUNTER FEEDS BACK THE COMPLEMENT AND GIVES 2n STATES.
NEITHER USES THE FULL 2^n STATES AVAILABLE. THE RING COUNTER'S ONE-HOT ENCODING NEEDS NO DECODING LOGIC AT ALL, WHICH IS THE TRADE.
Ripple versus synchronous counters
A RIPPLE COUNTER CLOCKS EACH STAGE FROM THE PREVIOUS OUTPUT, SO DELAYS ACCUMULATE AND THE LAST STAGE SETTLES AFTER n FLIP-FLOP DELAYS.
DURING THAT INTERVAL THE COUNTER SHOWS TRANSIENT WRONG VALUES, WHICH IS WHY IT CANNOT DRIVE DECODERS DIRECTLY. A SYNCHRONOUS COUNTER CLOCKS ALL STAGES TOGETHER.
Counter sizing
A MODULO-N COUNTER NEEDS THE CEILING OF LOG BASE 2 OF N FLIP-FLOPS.
A MOD-10 COUNTER NEEDS 4, LEAVING 6 UNUSED STATES THAT MUST BE HANDLED, EITHER BY FORCING A RESET OR BY TREATING THEM AS DON'T CARES.
Self-correction
A SELF-CORRECTING DESIGN GUARANTEES THAT EVERY UNUSED STATE EVENTUALLY LEADS BACK INTO THE MAIN CYCLE.
IT MATTERS BECAUSE POWER-UP STATE IS ARBITRARY. CHECKING IT REQUIRES COMPUTING THE NEXT STATE FOR EACH UNUSED CODE RATHER THAN ASSUMING THE DON'T CARES BEHAVED CONVENIENTLY.
Mealy versus Moore
A MOORE OUTPUT DEPENDS ONLY ON THE CURRENT STATE. A MEALY OUTPUT DEPENDS ON THE CURRENT STATE AND THE CURRENT INPUT.
MEALY USUALLY NEEDS FEWER STATES AND RESPONDS A CYCLE EARLIER; MOORE CHANGES ONLY AT CLOCK EDGES AND IS THEREFORE LESS PRONE TO GLITCHES.
Converting between machine styles
CONVERTING MEALY TO MOORE GENERALLY INCREASES THE STATE COUNT, BECAUSE A STATE PRODUCING DIFFERENT OUTPUTS FOR DIFFERENT INPUTS MUST BE SPLIT.
EACH RESULTING STATE CARRIES ONE OUTPUT VALUE. THE CONVERSION IS ALWAYS POSSIBLE IN BOTH DIRECTIONS.
State minimisation
PARTITION STATES BY OUTPUT, THEN REPEATEDLY SPLIT ANY GROUP WHOSE MEMBERS TRANSITION UNDER SOME INPUT INTO DIFFERENT GROUPS.
STOP WHEN A FULL PASS PRODUCES NO NEW SPLIT. STOPPING EARLY LEAVES DISTINGUISHABLE STATES MERGED AND THE RESULTING MACHINE IS WRONG.
When minimisation saves hardware
REDUCING THE STATE COUNT SAVES A FLIP-FLOP ONLY WHEN IT CROSSES A POWER-OF-TWO BOUNDARY.
GOING FROM 5 STATES TO 4 SAVES A FLIP-FLOP; GOING FROM 8 TO 7 SAVES NOTHING, AND THE NEXT-STATE LOGIC MAY EVEN GROW.
⚠️

Traps GATE sets — and how to dodge them

These are the exact option-traps and misreads that cost marks under negative marking.

WATCH OUT
Treating a latch and a flip-flop as interchangeable
A latch is transparent while its enable is asserted, so data can pass through several latches in one clock phase. A flip-flop captures only at an edge, which is what makes pipeline stages advance by exactly one per cycle.
WATCH OUT
Writing the JK characteristic equation with the wrong complements
It is Q-next equals J times not-Q plus not-K times Q. Check it against the four input cases: 00 holds, 01 resets, 10 sets, 11 toggles, and any expression failing one of those is wrong.
WATCH OUT
Using the characteristic equation where an excitation table is needed
The characteristic equation goes from inputs to next state; design goes the other way. To find what inputs produce a required transition, the excitation table is the correct tool, and its don't cares are what make minimisation work.
WATCH OUT
Using the worst-case combinational delay in the hold check
Setup uses the worst case because slow data must still arrive in time; hold uses the best case because fast data must not arrive too early. The two constraints deliberately use opposite extremes.
WATCH OUT
Trying to fix a hold violation by lowering the clock frequency
The hold inequality contains no clock term, so the frequency is irrelevant. The fix is to add delay to the fast combinational path, which is why hold failures can appear at any speed.
WATCH OUT
Computing maximum frequency from the average path delay
The clock period must accommodate the slowest path in the design. Averaging hides the critical path, and it is the critical path alone that sets the frequency, which is exactly what pipelining shortens.
WATCH OUT
Using a ripple counter to drive a decoder
The stages settle at different times, so the counter passes through transient values that are simply wrong, and a decoder will briefly assert incorrect outputs. A synchronous counter avoids this by clocking every stage together.
WATCH OUT
Sizing a modulo-N counter with N flip-flops
It needs the ceiling of log base 2 of N. A mod-12 counter needs 4 flip-flops, not 12, and the 4 unused states must then be handled deliberately.
WATCH OUT
Assuming unused counter states are harmless
Power-up state is arbitrary, so the counter may start in an unused code. If the design has no path from that code back into the main cycle, it can lock up permanently, which is what self-correction guarantees against.
WATCH OUT
Expecting a ring counter to use all 2 to the n states
A ring counter cycles through only n states and a Johnson counter through 2n. The unused states are the price of the simple one-hot encoding that needs no decoding logic.
WATCH OUT
Assuming a Mealy and Moore machine for the same task need the same states
A Moore output belongs to a state, so a state producing different outputs under different inputs must be split. Sequence detectors typically need one extra state in the Moore version.
WATCH OUT
Expecting a Mealy output to be glitch-free
It depends on the current input as well as the state, so it can change between clock edges and can glitch when the input does. A Moore output changes only just after a clock edge and is therefore cleaner.
WATCH OUT
Stopping state minimisation after the first pass
The termination condition is a complete pass with no new split. Groups that looked equivalent under one input can separate under another, and stopping early merges distinguishable states.
WATCH OUT
Assuming any state reduction saves hardware
Flip-flop count depends on the ceiling of log base 2 of the state count. Reducing 8 states to 7 still needs 3 flip-flops and may make the next-state logic more complex rather than less.

Exam-pattern practice

PYQ-style questions with full solutions. Work through them as a readiness check — mark yourself honestly and get your gap report at the end.

Readiness check

Are you exam-ready for Sequential Circuits?

9 problems from this chapter. Try each one, reveal the worked solution, mark yourself honestly — get your gap report at the end.

9 questions~6 min

5-minute revision

The whole chapter, distilled. Read this the night before the exam.

  • n flip-flops give at most 2 to the n states.
  • The state table is the complete description.
  • A latch is transparent while enabled.
  • A flip-flop captures only at an edge.
  • SR with both inputs asserted is forbidden.
  • Releasing both SR inputs together is a race.
  • A D latch cannot reach the forbidden state.
  • Master-slave gives edge behaviour from two latches.
  • D: Q-next equals D.
  • JK: Q-next equals J not-Q plus not-K Q.
  • T: Q-next equals T XOR Q.
  • J = K = 1 toggles.
  • A T flip-flop is a JK with inputs tied.
  • A D becomes a T by feeding it T XOR Q.
  • Excitation tables invert the characteristic equations.
  • Every JK transition has one don't care.
  • Only the excitation step depends on flip-flop type.
  • Setup time precedes the edge; hold time follows it.
  • Violations can cause metastability.
  • T_clk is at least T_cq plus T_comb plus T_setup.
  • Setup uses the worst-case combinational delay.
  • Hold uses the best-case combinational delay.
  • The hold inequality has no clock term.
  • Slowing the clock never fixes a hold violation.
  • Skew relaxes one constraint and tightens the other.
  • SIPO converts serial to parallel; PISO the reverse.
  • A ring counter gives n states.
  • A Johnson counter gives 2n states.
  • Ripple counters accumulate delay across stages.
  • Ripple counters show transient wrong values.
  • Synchronous counters clock every stage together.
  • A mod-N counter needs ceiling of log base 2 of N flip-flops.
  • Unused states must be handled deliberately.
  • Self-correction returns unused states to the cycle.
  • Moore outputs depend on state only.
  • Mealy outputs depend on state and input.
  • Mealy responds one cycle earlier.
  • Moore outputs change only at clock edges.
  • Mealy to Moore conversion usually adds states.
  • Minimisation partitions by output then splits.
  • Stop only after a full pass with no split.
  • Reduction saves a flip-flop only across a power-of-two boundary.

GATE question blueprint

How this topic is asked, tier by tier — so you can prep to the pattern.

Typical weightage: Digital Logic contributes roughly 6-8 of the 72 core-CS marks; sequential circuits supply 2-3 of those across 1-2 questions

Question styleMarks eachTypical countWhat it tests
Flip-flops1~1Characteristic equations, toggling behaviour and frequency division
Flip-flop conversion2~1Deriving input logic from excitation tables
Timing2~1Maximum clock frequency, hold constraints and clock skew
Counters2~1Ripple delay accumulation, synchronous design and ring versus Johnson
Counter sizing1~1Flip-flop count for a modulo-N counter and handling unused states
Mealy and Moore2~1Output dependence, state counts and conversion between styles
State minimisation2~1The partitioning method, its termination condition and when it saves hardware

Exam-hall strategy

Battle-tested tips from mentors and toppers for this topic under the sectional clock.

  1. Write the state table before attempting any circuit reasoning.
  2. For frequency questions, apply the setup inequality with the worst-case combinational delay.
  3. For hold questions, use the minimum delay and remember the clock period is irrelevant.
  4. Size counters with the ceiling of the base-two logarithm, then count unused states.
  5. For flip-flop conversion, equate characteristic equations and use the excitation don't cares.
  6. For state minimisation, complete a full pass over every input before concluding.
  7. Counter sizing and maximum frequency are commonly set as NAT, which carries no negative marking, so never leave one blank.
  8. For 1-mark and 2-mark MCQs, negative marking is -1/3 and -2/3, so guess only after eliminating an option.
  9. GATE gives a single freely-navigable 180-minute window, so flag a long state-machine design and return to it.

Beyond the exam

Where this skill shows up in the job you're competing for — and in life.

Setting a processor's clock frequency

The setup inequality applied to the slowest path in the design is literally what determines the maximum rated frequency of a chip.

Building a serial interface

SIPO and PISO shift registers are the core of any UART or SPI peripheral, converting between a serial wire and a parallel bus.

Debouncing and synchronising an external input

Flip-flop chains guard against metastability when an asynchronous signal crosses into a clocked domain, which is the practical face of setup and hold.

Writing a protocol controller

Choosing Mealy for a fast handshake response and Moore for a clean enable signal is the everyday version of this chapter's machine-style trade-off.

Where else this topic is tested

Prepare once, score in every exam that asks it.

GATE EC and EEVery high overlap — flip-flops, counters and timing analysis are examined identically across engineering GATE papers
UGC NET Computer ScienceHigh overlap — flip-flop characteristic equations, counter sizing and Mealy versus Moore are examined as direct recall
ISRO / BARC / DRDO computer science papersVery high overlap — maximum clock frequency, ripple counter delay and state minimisation are recurring MCQ topics

Questions aspirants ask

Pulled from the Q&A community and mentor sessions.

Because while a latch is enabled, its output follows its input continuously, so a signal can propagate through more than one storage element within a single clock phase. Imagine a chain of D latches all enabled by the same clock level. When the clock goes high, data entering the first latch appears at its output, feeds the second latch which is also transparent, appears at that output, and so on. Instead of advancing one stage per clock, the data races through as many stages as the clock-high interval allows, and exactly how many depends on gate delays rather than on the design. That is a race condition, and its outcome varies with temperature, voltage and manufacturing spread. Edge triggering fixes this by making the storage element sensitive only at the instant of a transition. A master-slave arrangement achieves it structurally: the master latch is transparent while the clock is high and the slave while it is low, so at no moment is a path open all the way through. Data captured by the master on the high phase moves to the slave on the low phase, and each clock cycle advances the data by exactly one stage. This guarantee is what makes pipelining possible and what makes the timing analysis in this chapter meaningful, since the setup and hold inequalities assume exactly one capture per cycle.

Because the clock period does not appear anywhere in the hold inequality. Setup and hold guard against opposite failures. Setup asks whether slow data arrives in time for the next edge, so its inequality is that the clock period must exceed the clock-to-output delay plus the worst-case combinational delay plus the setup time. Lengthening the period gives that path more time, so a setup failure is always repairable by slowing down. Hold asks a completely different question: whether new data arrives so early that it corrupts the value the receiving flip-flop is still trying to capture from the same edge. Its inequality is that the clock-to-output delay plus the minimum combinational delay must be at least the hold time. Every term describes a delay within one edge's neighbourhood, and none of them changes when the period changes. Slowing the clock simply moves the next edge further away, which the hold path does not care about. The repairs are therefore structural. Add buffer delay on the fast data path so that new data arrives later. Reduce clock skew, since a capturing edge that arrives late effectively enlarges the hold requirement. Or rebalance the logic so that no path is trivially short. This is also why a chip can pass at every tested frequency and still fail intermittently: a hold violation is a race, not a speed limit.

Choose Mealy when latency matters and the output feeds something that tolerates asynchronous change; choose Moore when the output must be clean and predictable. The structural difference is that a Mealy output is computed from the state and the current input, so it can respond in the same cycle as the input that triggered it and it can change at any moment the input changes. A Moore output is computed from the state alone, so it changes only just after a clock edge and holds steady for the whole cycle, but it necessarily lags by one cycle because the machine must first enter the state that carries the output. The state count usually differs too. Because a Mealy output is attached to a transition, one state can produce different outputs under different inputs. A Moore machine must split such a state, giving each resulting state a single output value, which is why a sequence detector for a four-bit pattern typically needs four Mealy states and five Moore states. In practice, control signals that drive combinational datapath logic are often Mealy for speed, while signals that drive clock enables, resets or anything level-sensitive are made Moore precisely because a Mealy glitch on such a signal would be captured. The conversion between the two is always possible in either direction, so the choice is an engineering trade rather than a constraint.

Because the counter's state at power-up is arbitrary, so it may start in one of them. A mod-12 counter built from four flip-flops has sixteen possible codes, of which twelve form the intended cycle and four do not. On power-up the flip-flops settle into whatever state their manufacturing and supply conditions produce, and nothing prevents that from being one of the four unused codes. What happens next depends entirely on how the design treated them. If the unused codes were used as don't cares during K-map minimisation, the next-state logic assigns them whatever value made the equations simplest, and that assignment might form a closed loop among the unused states. The counter would then cycle forever among invalid codes and never enter the main sequence, which looks in the lab like a dead circuit that sometimes works after a power cycle. A self-correcting design guarantees that every unused code leads, within a bounded number of clocks, back into the main cycle. Verifying it is mechanical: compute the next state for each unused code using the minimised equations, and confirm the resulting chain reaches a valid state. The alternative approach avoids the issue by detecting the terminal count and forcing a synchronous or asynchronous clear, which pulls any state back to zero, at the cost of extra logic and, for the asynchronous version, a brief glitch on the count outputs.

Check whether the reduction crosses a power-of-two boundary in the state count, because that is the only thing that changes the flip-flop count. The number of flip-flops needed is the ceiling of the base-two logarithm of the number of states, so going from five states to four saves a flip-flop, since four states need two bits while five need three. Going from eight to seven saves nothing, since both need three bits, and the next-state logic for seven states may actually be more complex than for eight because the unused code destroys the regularity that made the eight-state equations simple. There is a second consideration beyond flip-flop count. Merging states reduces the number of rows in the state table, which sometimes simplifies the next-state and output equations even when the bit count is unchanged, and sometimes does the reverse. In a hand design the honest answer is to minimise, assign codes, derive the equations, and compare gate counts against the unminimised version. The procedure itself is worth doing carefully regardless, because it is directly examinable. Partition the states by output, then repeatedly split any group whose members transition into different groups under some input, and stop only when a complete pass over every input produces no new split. Stopping after the first input that happens to agree is the standard error, and it leaves genuinely distinguishable states merged, producing a machine that is not merely suboptimal but wrong.
Header Logo