Skip to content
GATEiit

GATE CSE · Digital Logic

Design of combinational and sequential circuits

Combinational blocks (adders, multiplexers, decoders, encoders) and sequential circuits (latches, flip-flops, registers, counters, state machines), with the MUX counts, counter states and clock-rate numericals GATE asks.

Before you start

  • Boolean algebra and K-maps →

    Every block is described by a Boolean function, and designing a counter ends with minimising its next-state equations.

  • Binary numbers →

    Adders and counters work on binary and Gray-coded values.

  • Logarithms base 2

    The number of select lines, flip-flops and address bits is a ceiling of log⁡2.

This topic comes before: Design of arithmetic and logic unit (ALU), Design of control unit: hardwired and microprogrammed, Memory interfacing and hierarchy: performance and cache memory mapping

Concept notes

1. Adders and the combinational building blocks

A combinational circuit has outputs that depend only on the present inputs; it has no memory.

  • Half adder: S=A⊕B, C=AB.
  • Full adder: S=A⊕B⊕Cin, Cout=AB+Cin(A⊕B). Two half adders and an OR gate make one full adder.
  • Ripple-carry adder: n full adders in a chain. The carry must pass through every stage, so the worst-case delay grows as n times the carry delay of one stage.
  • Carry-lookahead adder: uses generate Gi=AiBi and propagate Pi=Ai⊕Bi with Ci+1=Gi+PiCi. Expanding this gives every carry in two gate levels, at the cost of wide gates.
  • Comparator: two bits are equal when A⊕B‾=1 (XNOR); an n-bit equality check ANDs the n XNOR outputs.

A subtractor is an adder that adds the 2's complement: invert B and set Cin=1.

2. Multiplexers, decoders and encoders

Block Inputs → outputs What it does
2n:1 multiplexer 2n data + n select → 1 Routes the selected input to the output
n-to-2n decoder n → 2n Exactly one output is 1: the minterm of the input
2n-to-n encoder 2n → n Gives the index of the one active input
Priority encoder 2n → n (+ valid bit) Gives the index of the highest-priority active input
Demultiplexer 1 + n select → 2n Sends the input to the selected output

Implementing functions. A 2n:1 MUX implements any function of n variables: put the function's truth-table values on the data inputs. A 2n−1:1 MUX also works: use n−1 variables as selects and feed each data input with 0, 1, x or x‾, where x is the leftover variable.

A decoder with an OR gate implements any function: OR together the decoder outputs for its minterms.

Building bigger blocks. A tree of 2:1 MUXes for a 2n:1 MUX needs 2n−1 of them. Decoders with an enable input expand in the same way: one decoder on the high bits enables one of several decoders on the low bits.

I0 = CI1 = C'I2 = C'I3 = C0123FABMUX
4:1 MUX with selects A, B implementing F = Σm(1, 2, 4, 7), the odd-parity function

3. Latches and flip-flops

A sequential circuit has memory: its outputs depend on the inputs and the stored state. A latch is level-sensitive (transparent while enabled); a flip-flop is edge-triggered (samples only at a clock edge).

Flip-flop Characteristic equation Behaviour
SR Q+=S+R‾Q, with SR=0 S=R=1 is not allowed
D Q+=D Copies D at the edge
JK Q+=JQ‾+K‾Q J=K=1 toggles
T Q+=T⊕Q T=1 toggles, T=0 holds

The excitation table is the reverse view: for a wanted change Q→Q+, what inputs are needed. For JK: 0→0 needs J=0,K=X; 0→1 needs J=1,K=X; 1→0 needs J=X,K=1; 1→1 needs J=X,K=0. The don't-cares make JK designs small.

Race-around: a level-triggered JK with J=K=1 toggles again and again while the clock stays high. Edge triggering or a master-slave design fixes it.

A NOR-based SR latch has S=R=1 as the forbidden input (both outputs go to 0); a NAND-based latch with active-low inputs has S‾=R‾=0 as the forbidden input.

4. Registers and counters

A register is a row of flip-flops sharing a clock. A shift register passes each bit to its neighbour on every clock (SISO, SIPO, PISO, PIPO by input and output style).

Counters. With n flip-flops there are at most 2n states, so a mod-N counter needs ⌈log⁡2N⌉ flip-flops.

  • Asynchronous (ripple) counter: each flip-flop is clocked by the previous one's output. Simple, but the delays add: the last bit settles after n⋅tpd, so the clock period must be at least n⋅tpd.
  • Synchronous counter: all flip-flops share one clock; the next state comes from combinational logic. The period needs only one flip-flop delay plus the logic delay.
  • Ring counter: n-bit shift register with Qlast fed back to the first input; n states (one hot).
  • Johnson (twisted-ring) counter: feed back Q‾last; 2n states. A 4-bit Johnson counter cycles 0000, 1000, 1100, 1110, 1111, 0111, 0011, 0001.

States outside the main cycle are unused states. A good design makes sure every unused state leads back into the cycle (self-starting).

5. Designing sequential circuits and timing

Design steps: (1) draw the state diagram; (2) write the state table; (3) assign binary codes to states; (4) use the flip-flop excitation table to get each input as a function of present state and inputs; (5) minimise with K-maps.

Mealy vs Moore. In a Moore machine the output depends only on the state; in a Mealy machine it depends on the state and the input. A Mealy machine usually needs fewer states and responds in the same clock cycle; a Moore output is delayed by one clock but is glitch-free.

For an overlapping sequence detector of a pattern of length k, the minimal Mealy machine has k states ("matched 0, 1, …, k−1 symbols") and the Moore machine has k+1 (an extra state that outputs 1). Overlap only changes where transitions go, not the count.

Timing. For a synchronous circuit, a signal leaves one flip-flop, passes through logic and must reach the next flip-flop a setup time before the next edge:

Tmin=tclk-q+tcomb+tsetup,fmax=1Tmin

The hold time rule is separate: the data must not change for thold after the edge.

Formulas to remember

Full adder sum
S=A⊕B⊕Cin
Full adder carry
Cout=AB+Cin(A⊕B)
Carry lookahead
Ci+1=Gi+PiCi,Gi=AiBi, Pi=Ai⊕Bi
JK flip-flop
Q+=JQ‾+K‾Q
T flip-flop
Q+=T⊕Q
Flip-flops for a mod-N counter
n=⌈log⁡2N⌉
2:1 MUXes in a 2^n:1 MUXA full binary tree of 2:1 MUXes
2n−1
Ring and Johnson counter statesn flip-flops
ring: n,Johnson: 2n
Maximum clock frequency
fmax=1tclk-q+tcomb+tsetup

Common mistakes

  • Counting 2n instead of 2n−1 two-input MUXes for a 2n:1 MUX tree.
  • Mixing up the characteristic table (inputs → next state) with the excitation table (wanted change → inputs).
  • Giving a ring counter 2n states or a Johnson counter n states; it is the other way round.
  • Forgetting that a ripple counter's settling time grows with the number of bits while a synchronous counter's does not.
  • Adding one extra state to a Mealy sequence detector; only the Moore machine needs the output state.
  • Leaving out the setup time (or the clock-to-Q delay) when finding the minimum clock period.

Worked examples

Try each step yourself, then reveal the working.

Example 1: A 3-variable function on a 4:1 MUX

numerical

Implement F(A,B,C)=Σm(1,2,4,7) using one 4:1 multiplexer with A and B on the select lines (A is the higher bit). What goes on each data input?

  1. Step 1: Group the minterms by the select value AB.

    Try it on paper first.

Example 2: Analysing a synchronous counter

numerical

Two D flip-flops share a clock with D1=Q0 and D0=Q1‾. Starting from Q1Q0=00, list the states. How many distinct states does it cycle through, and what code is it?

  1. Step 1: Apply the equations to 00.

    Try it on paper first.

Example 3: Maximum clock frequency: synchronous vs ripple

numerical

Flip-flops have a clock-to-Q delay of 10 ns and a setup time of 5 ns. (a) A synchronous circuit has 25 ns of logic between flip-flops. (b) A 4-bit ripple counter uses the same flip-flops, and all four outputs must settle before the next clock edge. Find the maximum clock frequency in each case.

  1. Step 1: Write the minimum period for the synchronous circuit.

    Try it on paper first.

Example 4: States in a sequence detector

conceptual

A circuit reads one bit per clock and outputs 1 whenever the last four bits are 1011 (overlapping allowed). How many states do the minimal Mealy and Moore machines need?

  1. Step 1: List what the machine must remember.

    Try it on paper first.

Previous year questions

21 official GATE CSE questions on this topic, newest first.

Practise these 21 PYQs →

Topic test

10 questions: up to 4 official PYQs and original practice questions, with GATE marking (MCQ wrong answers lose marks). Score 60% or more to pass. A new set is drawn each time.

Mark as mastered

Loading your progress…

My revision notes

Notes written by the GATEiit team against the official GATE CSE syllabus; being checked by a reviewer. Updated 2026-11-21. Spotted a mistake? Use Report an issue on any question, or contact us.