Menu Close

Sequential circuits: UPSC Electrical Engineering Optional PYQ Solutions (1995–2026)

All 27 questions UPSC has asked on sequential circuits in the Electrical Engineering Optional (Paper I, Digital Electronics) from 1995 to 2026, solved step by step – latest first.

Try them yourself first: the same questions, without solutions, are on our Digital Electronics topic-wise PYQs page. Circuit diagrams have been redrawn from the question papers.

How we check these solutions

These are our own solutions, prepared with AI help. UPSC does not publish official answers. Every solution is checked a second way before it goes up, and says how:

  • ✓ Checked by computer the numbers were worked out again independently in code (SymPy and NumPy: circuit equations, power balance, matrices, integrals).
  • ✓ Answer checked step by step for theory and descriptive questions, every point was checked against the standard theory.

Where a printed question is wrong, unclear or incomplete, we say so and solve the intended version.

Spotted a mistake or a neater method? Tell us in the comments below or through Report an error.

Jump to a question (year · question number):

2026 · 6a 2025 · 1d 2023 · 3a(i) 2022 · 5a 2022 · 8a(i) 2021 · 2c 2020 · 4b 2018 · 5a 2018 · 7b 2017 · 7b 2015 · 6b 2014 · 5e 2013 · 6b 2012 · 5a 2012 · 6a 2011 · 5a 2011 · 6b 2010 · 2b(iii) 2010 · 7a(ii) 2009 · 2b(i) 2009 · 7a(ii) 2007 · 1b(i) 2006 · 8a(iv) 2005 · 6a(iii) 2000 · 2a 1999 · 5b(ii) 1995 · 5d

Cover of the UPSC Prelims Topic-wise PYQ book with detailed explanations

From the Optional Province team

Preparing for Prelims too?

Our UPSC Prelims Topic-wise PYQ Book covers every Prelims question with detailed explanations, so you can see exactly where UPSC asks from. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Design a MOD-6 synchronous DOWN counter using J–K flip-flops.

2026 · Paper I · Q6a · 20 marks

Solution

Count sequence. A MOD-6 down counter needs three flip-flops (23=8≥6) and counts 5→4→3→2→1→0→5. States 6 and 7 are not used.

Excitation table. For a JK flip-flop: 0→0 needs J=0,K=×; 0→1 needs J=1,K=×; 1→0 needs J=×,K=1; 1→1 needs J=×,K=0.

Present Q2Q1Q0 Next J2K2 J1K1 J0K0
101 (5) 100 × 0 0 × × 1
100 (4) 011 × 1 1 × 1 ×
011 (3) 010 0 × × 0 × 1
010 (2) 001 0 × × 1 1 ×
001 (1) 000 0 × 0 × × 1
000 (0) 101 1 × 0 × 1 ×

States 110 and 111 are don’t-cares in every map.

Simplified inputs (from the K-maps): J0=K0=1,J1=Q2Q0,K1=Q0,J2=Q1Q0,K2=Q0.

For example, J2 is 1 only in state 000, and the other states with Q2=0 (001, 010, 011) give 0, so J2=Q1Q0. K2 is 1 in state 100 and 0 in state 101, so K2=Q0.

Circuit. All three clock inputs go to the common clock; two 2-input AND gates make Q2Q0 and Q1Q0.

KJQQFF2Q̅₁Q̅₀CLKQ̅₀Q₂Q̅₂KJQQFF1Q₂Q̅₀CLKQ̅₀Q₁Q̅₁KJQQFF01CLK1Q₀Q̅₀
MOD-6 synchronous down counter (inputs labelled by the gate output that drives them; all clocks common). On a phone, swipe sideways to see all of it.

Unused states. From 110 the counter goes to 001, and from 111 it goes to 110 and then 001. So it is self-starting: it never locks out.

✓ Checked by computer We stepped the counter through all eight states in code, including the two unused ones.

↑ Back to the question list

Design a sequential circuit with two D flip flops A and B and one input X. Let the state of the circuit remain the same for X = 0. However, when X = 1, the circuit goes through the state transitions from 00 to 10 to 11 to 01, back to 00 and then repeats.

2025 · Paper I · Q1d · 10 marks

Solution

State table. Let the state be AB.

Present AB Next AB (X = 0) Next AB (X = 1)
00 00 10
01 01 00
10 10 11
11 11 01

For a D flip-flop, D is simply the next state.

Equations. With X = 0 each flip-flop keeps its value. With X = 1, from the table, A+=B and B+=A. So DA=XA+XB,DB=XB+XA. Each D input is a 2-to-1 multiplexer with X as the select line.

DQQAX̅A + XB̅CLKAA̅DQQBX̅B + XACLKBB̅
The required circuit (each D input is a 2-to-1 multiplexer selected by X).

With X = 1 the circuit is a 2-bit Gray-code counter (00, 10, 11, 01). X acts as a count enable.

✓ Checked by computer We stepped both flip-flops through every state for X = 0 and X = 1 in code.

↑ Back to the question list

Consider the shift register shown in the figure below, which is implemented using D flip-flops and 2:1 multiplexers.

01DQCLRFF0CKCLRLoadX₀XL01DQCLRFF1CKCLRLoadX₁Q₀01DQCLRFF2CKCLRLoadX₂Q₁01DQCLRFF3CKCLRLoadX₃Q₂Q₃
Figure redrawn from the question paper. On a phone, swipe sideways to see all of it.

Complete the truth table shown as follows:

CK (Inputs) CLR (Inputs) Load (Inputs) Q3 (Next State) Q2 (Next State) Q1 (Next State) Q0 (Next State)
X 0 X
↑ (rising edge) 1 0
↑ (rising edge) 1 1

Complete the timing diagram below assuming X3X2X1X0=0101.

12345678910111213CKCLRLoadXLQ0 Q1 Q2 Q3
Timing diagram to be completed (redrawn). On a phone, swipe sideways to see all of it.

2023 · Paper I · Q3a(i) · 10 marks

Solution

How the circuit works. Each multiplexer picks the D input of its flip-flop.

  • Load = 0 selects input 0: D0=XL, D1=Q0, D2=Q1, D3=Q2. Each rising edge shifts the data one place towards Q3, and XL enters at Q0.
  • Load = 1 selects input 1: Di=Xi. The rising edge loads X3X2X1X0 in parallel.
  • CLR=0 clears all four flip-flops at once, whatever the clock does.

Truth table.

CK CLR Load Q3 Q2 Q1 Q0
× 0 × 0 0 0 0
↑ 1 0 Q2 Q1 Q0 XL
↑ 1 1 X3 X2 X1 X0

Timing diagram. Nothing sets the register before the 2nd rising edge, so its contents are unknown until then (shown dashed). At edge 2, Load = 1 loads X3X2X1X0=0101. After that Load = 0, so the register shifts at every edge.

After edge XL Q0 Q1 Q2 Q3
2 (load) – 1 0 1 0
3 0 0 1 0 1
4 0 0 0 1 0
5 0 0 0 0 1
6, 7 0 0 0 0 0
8 1 1 0 0 0
9 1 1 1 0 0
10 0 0 1 1 0
11 0 0 0 1 1
12 0 0 0 0 1

Just after edge 12, CLR goes low and all outputs fall to 0 at once; they stay 0 at edge 13.

12345678910111213CKCLRLoadXLQ0 Q1 Q2 Q3
Completed timing diagram (dashed: contents unknown before the load). On a phone, swipe sideways to see all of it.

✓ Checked by computer We simulated the register edge by edge in code for the given Load, XL and CLR waveforms.

↑ Back to the question list

The diagram of Master-Slave S-R flip-flop and the waveform applied to the Master flip-flop is shown in Figure 5(a). Draw the waveform that appears at the output of Slave flip-flop.

SRCQ₁Q₁CG₁G₂G₃G₄G₅G₆G₇G₈Q₂Q₂
Figure redrawn from the question paper. On a phone, swipe sideways to see all of it.
1234CLKSR
Waveforms applied to the master flip-flop (redrawn).

2022 · Paper I · Q5a · 10 marks

Solution

How the flip-flop works.

  • While C = 1, gates G1 and G2 pass S and R to the master latch (G3, G4), so Q1 follows S and R like an SR latch. C=0 keeps G5 and G6 at 1, so the slave holds.
  • While C = 0, the master is locked and the slave copies it: Q2=Q1.

So Q2 can change only when the clock falls, and it takes the value the master had at the end of that pulse.

Pulse by pulse. S and R change only at the falling edges, so they are steady during each pulse.

Pulse S, R during the pulse Master Q1 Slave Q2 after the pulse falls
1 S = 0, R = 1 0 (reset) 0
2 S = 1, R = 0 1 (set) 1
3 S = 0, R = 1 0 (reset) 0
4 S = 0, R = 0 0 (hold) 0

Before the end of pulse 1 the output depends on the unknown starting state (dashed).

1234CLKSRQ1 (master)Q2 (slave)
Output of the slave flip-flop, Q2 (dashed: unknown starting state).

So the slave output is a single pulse: it goes HIGH at the falling edge of clock pulse 2 and back LOW at the falling edge of pulse 3.

✓ Checked by computer We stepped the master and the slave through the four clock pulses in code.

↑ Back to the question list

Differentiate between the functions of Decade counter and BCD counter with example.

2022 · Paper I · Q8a(i) · 10 marks

Solution

Decade counter. Any counter with 10 distinct states (MOD-10). It may use any code for those 10 states. It needs at least 4 flip-flops in binary form, but other forms are also decade counters: a 5-stage Johnson counter or a 10-stage ring counter.

BCD counter. A decade counter that counts in the 8421 BCD code: 0000, 0001, …, 1001 and back to 0000. Its outputs can drive a BCD-to-7-segment decoder directly.

Decade counter BCD counter
States Any 10 states Exactly 0000 to 1001
Code Any (binary, 5421, Johnson, ring) 8421 BCD only
Relation The wider class A special case of a decade counter
Example 5-stage Johnson counter; 7490 wired as bi-quinary (5421) 7490 wired as 8421; 74160, 74LS90 in BCD mode

So every BCD counter is a decade counter, but a decade counter is a BCD counter only if it counts in 8421 code. For example, a 5-flip-flop Johnson counter divides by 10 but goes through 00000, 10000, 11000, …, so it needs decoding before display.

✓ Answer checked step by step We checked each point against the standard definitions step by step.

↑ Back to the question list

Consider the circuit shown in Figure 2(c) below. Let inputs A, B and C be all initially LOW. Output Y is supposed to go HIGH only when A, B and C go HIGH in a certain sequence. Determine the sequence that will make Y go HIGH. Modify this circuit to use D-Flip-flops.

KJQCLRKJQCLRABCXYStart (LOW pulse)
Figure redrawn from the question paper.

2021 · Paper I · Q2c · 10 marks

Solution

How the circuit works. Both flip-flops have K = 0, so a clock edge either sets Q (if J = 1) or leaves it unchanged (if J = 0). Once set, X and Y stay HIGH until the Start pulse clears them. We take the clock inputs as positive-edge triggered (no bubble is shown).

  • X goes HIGH at a rising edge of B only if A is already HIGH.
  • Y goes HIGH at a rising edge of C only if X is already HIGH.

Required sequence: A first, then B, then C. Any other order leaves Y LOW. For example, if B rises before A, the B edge finds J = 0 and X stays LOW.

With D flip-flops. A JK flip-flop with K = 0 obeys Q+=J+Q. So we feed each D input with an OR gate: D1=A+X(clock B),D2=X+Y(clock C). The clear inputs still go to Start.

DQCLRFF1StartA + XBXDQCLRFF2StartX + YCY
The same circuit with D flip-flops (each D input from a 2-input OR gate).

The OR feedback matters. With just D1=A, a later B edge with A LOW would clear X, which the JK circuit never does.

✓ Checked by computer We tried all six orders in which A, B and C can go HIGH in code; only one sets Y.

↑ Back to the question list

Design a synchronous sequential circuit with D-flip-flops for a state diagram shown in Figure 4(b).

011001100000111101010110
Figure redrawn from the question paper.

2020 · Paper I · Q4b · 20 marks

Solution

State table (D = next state; state ABC).

Present ABC Next ABC DA DB DC
000 001 0 0 1
001 100 1 0 0
010 000 0 0 0
011 100 1 0 0
100 111 1 1 1
101 000 0 0 0
110 101 1 0 1
111 101 1 0 1

K-map results.

  • DA=∑m(1,3,4,6,7): the pair (1, 3) gives AC, the pair (4, 6) gives AC and the pair (6, 7) gives AB. So DA=AC+AC+AB=(A⊕C)+AB.
  • DB=∑m(4)=ABC.
  • DC=∑m(0,4,6,7): the pair (0, 4) gives BC and the pair (6, 7) gives AB. So DC=BC+AB.
DQQAA̅C + AC̅ + ABCLKAA̅DQQBAB̅C̅CLKBB̅DQQCB̅C̅ + ABCLKCC̅
Synchronous circuit for the state diagram (common clock). On a phone, swipe sideways to see all of it.

All eight states are defined in the diagram, so there are no don’t-cares. States 010, 011 and 110 lead into the main cycle 000 → 001 → 100 → 111 → 101 → 000.

✓ Checked by computer We checked all eight next states from the three D equations in code.

↑ Back to the question list

Convert a D flip flop to function as an S-R flip flop. Draw the circuit.

2018 · Paper I · Q5a · 10 marks

Solution

Idea. A D flip-flop stores whatever is on D. So we make D equal to the next state an SR flip-flop would have.

S R Qn Qn+1 = D
0 0 0 0
0 0 1 1
0 1 × 0
1 0 × 1
1 1 × not allowed (don’t care)

K-map. D=S+RQ.

Circuit. An inverter on R, an AND gate making RQ (Q fed back from the output), and an OR gate adding S. The OR output drives D.

DQQCLKRQQS
SR flip-flop from a D flip-flop: D = S + R′Q.

✓ Checked by computer We checked D = S + R′Q against the SR table for all allowed inputs in code.

↑ Back to the question list

Design a synchronous counter using D flip flop that counts in the following sequence: 6, 3, 5, 0, 2, 6, 3, 5, 0, 2, 6, … Draw the circuit.

2018 · Paper I · Q7b · 20 marks

Solution

States. The sequence 6, 3, 5, 0, 2 has five states, so we need three flip-flops (ABC, A the MSB). States 1, 4 and 7 are unused (don’t-cares).

Present ABC Next ABC DA DB DC
110 (6) 011 (3) 0 1 1
011 (3) 101 (5) 1 0 1
101 (5) 000 (0) 0 0 0
000 (0) 010 (2) 0 1 0
010 (2) 110 (6) 1 1 0

K-maps (don’t-cares 1, 4, 7):

  • DA=∑m(2,3)=AB.
  • DB=∑m(0,2,6)+d(4)=C.
  • DC=∑m(3,6)+d(7)=BC+AB=B(A+C).
DQQAA̅BCLKAA̅DQQBC̅CLKBB̅DQQCB(A + C)CLKCC̅
Counter for 6, 3, 5, 0, 2 (common clock). On a phone, swipe sideways to see all of it.

Unused states. 1 → 0, 4 → 2 and 7 → 1 → 0. Every unused state enters the sequence within two clock pulses, so the counter is self-starting.

✓ Checked by computer We checked the sequence and all three unused states in code.

↑ Back to the question list

Find the state transition diagram and realization using J-K flip-flops to count Mod 7 in the following sequence: 000, 001, 011, 100, 101, 111.

2017 · Paper I · Q7b · 20 marks

Solution

Note on the question. The printed sequence 000, 001, 011, 100, 101, 111 has only six states, so it is a MOD-6 counter, not MOD-7. We design for the sequence as printed. If a seventh state was meant, the same method applies with one fewer don’t-care.

State transition diagram. States 010 and 110 are unused; with the design below they go to 101 and 001.

000001011100101111010110
State transition diagram (010 and 110 are the unused states).

Excitation table (ABC, A the MSB).

Present Next JAKA JBKB JCKC
000 001 0 × 0 × 1 ×
001 011 0 × 1 × × 0
011 100 1 × × 1 × 1
100 101 × 0 0 × 1 ×
101 111 × 0 1 × × 0
111 000 × 1 × 1 × 1

Simplified inputs (don’t-cares 010, 110): JA=KA=B,JB=C,KB=1,JC=1,KC=B.

KJQQABCLKBAA̅KJQQBCCLK1BB̅KJQQC1CLKBCC̅
JK realisation (common clock). On a phone, swipe sideways to see all of it.

Unused states. 010 → 101 and 110 → 001, both inside the sequence, so the counter is self-starting.

✓ Checked by computer We checked the six-state sequence and both unused states in code.

↑ Back to the question list

Divide by N counter is shown in the figure below. If initially Q0=0, Q1=1, Q2=0, what is the value of N?

KJQQFF2Q̅₁CLOCKQ₀Q₂Q̅₂KJQQFF1Q₂CLOCKQ̅₂Q₁Q̅₁KJQQFF0Q₁CLOCKQ̅₁Q₀Q̅₀
Figure redrawn from the question paper (inputs labelled by the signal they are wired to). On a phone, swipe sideways to see all of it.

2015 · Paper I · Q6b · 20 marks

Solution

Simplify first. For FF1, J1=Q2 and K1=Q2, so it acts as a D flip-flop: Q1+=Q2. In the same way Q0+=Q1. For FF2, J2=Q1 and K2=Q0.

Trace from Q2Q1Q0=010.

Clock Q2Q1Q0 J2K2 Next Q2
0 010 0 0 0 (hold)
1 001 1 1 1 (toggle)
2 100 1 0 1 (set)
3 110 0 0 1 (hold)
4 111 0 1 0 (reset)
5 011 0 1 0 (reset)
6 001

The starting state 010 is not repeated. After one clock the counter is in the cycle 001 → 100 → 110 → 111 → 011 → 001, which has 5 states.

So N = 5: each output, Q0 for example, repeats every 5 clock pulses.

✓ Checked by computer We stepped the counter from 010 and from every other state in code.

↑ Back to the question list

Design a circuit that gives the input-output relationship shown in Fig. 4.

12345InputOutput
Figure redrawn from the question paper.

2014 · Paper I · Q5e · 10 marks

Solution

What the output needs. It goes HIGH at the falling edge of pulse 4 and LOW at the falling edge of pulse 5. So it is HIGH exactly while 4 falling edges have been counted. A counter that advances on each falling edge and returns to 0 after 4 does this, with the output taken from the state “4”.

Design: a MOD-5 counter on negative edges. States 0 to 4 (000 to 100). State 4 is the only one with Q2=1, so the output is just Q2. The standard synchronous JK design is J0=Q2,K0=1;J1=K1=Q0;J2=Q1Q0,K2=1.

KJQFF2Q₁Q₀Input1Q₂ = YKJQFF1Q₀InputQ₀Q₁KJQFF0Q̅₂Input1Q₀
MOD-5 counter on falling edges; the output is Q2. On a phone, swipe sideways to see all of it.

Check. Starting from 000, the falling edges give 1, 2, 3, 4, 0, so Q2 is HIGH from the end of pulse 4 to the end of pulse 5.

12345InputQ0 Q1 Q2 = Out
Counter waveforms: Q2 is the required output.

If the input keeps running, the output pulse repeats every 5 input pulses. Unused states 101, 110, 111 go to 010, 010 and 000, so the counter cannot lock up.

✓ Checked by computer We simulated the counter for the five input pulses in code and compared its Q2 with the required output.

↑ Back to the question list

A sequential machine produces an output of 1 only when exactly two 0’s are followed by a 1 or exactly two 1’s are followed by a 0. Determine the reduced state table of the machine.

2013 · Paper I · Q6b · 20 marks

Solution

Reading of the question. We read “exactly two 0’s followed by a 1” as: a run of exactly two 0’s (not three or more) ends with a 1. The output is 1 at that 1. The same holds for two 1’s followed by a 0. We use a Mealy machine, so the output is written on each transition.

States. The machine must remember the last bit and how long its run is (1, 2, or 3 or more):

  • a: start (no input yet)
  • b, c, d: run of one, two, three-or-more 0’s
  • e, f, g: run of one, two, three-or-more 1’s

State table (next state / output).

Present x = 0 x = 1
a b / 0 e / 0
b c / 0 e / 0
c d / 0 e / 1
d d / 0 e / 0
e b / 0 f / 0
f b / 1 g / 0
g b / 0 g / 0

Reduction by partitioning.

  • By outputs: (a, b, d, e, g), (c), (f).
  • By next-state classes: b goes to c on 0 and e goes to f on 1, so each splits off. The groups become (a, d, g), (b), (e), (c), (f).
  • Next: on input 0, a goes to b, d goes to d and g goes to b; on input 1, a goes to e and g goes to g. These land in different groups, so a, d and g are all different.

No two states are equivalent, so the table above, with 7 states, is already the reduced state table.

If instead the question only means “the last three inputs are 001 or 110” (so that 0001 also gives an output), the machine needs only 5 states: start, last bit 0, last two bits 00, last bit 1, last two bits 11.

✓ Checked by computer We compared the machine with the word statement on 3000 random input strings and ran the state reduction in code.

↑ Back to the question list

Cover of the UPSC Mains Topic-wise and Year-wise PYQs book (2013–2026)

From the Optional Province team

Strengthen your GS papers

Our UPSC Mains Topic-wise & Year-wise PYQ Book (2013–2026) maps every GS question to the syllabus, so you know what UPSC asks and how often. Now available as a hard copy and an eBook.

Buy Hard Copy on AmazonBuy eBook (PDF)

Download a free sample

Show how a D flip-flop can be converted to SR flip-flop.

2012 · Paper I · Q5a · 12 marks

Solution

This is the same conversion as 2018 Q5(a) above.

The D input must equal the next state of an SR flip-flop: Qn+1=S+RQn, with S = R = 1 not allowed. So D=S+RQ.

Circuit. An inverter on R, an AND gate for RQ (Q fed back), and an OR gate adding S, feeding D.

DQQCLKRQQS
SR flip-flop from a D flip-flop: D = S + R′Q.

Check. S = 1, R = 0 gives D = 1 (set). S = 0, R = 1 gives D = 0 (reset). S = R = 0 gives D = Q (hold).

✓ Checked by computer We checked D = S + R′Q against the SR table for all allowed inputs in code.

↑ Back to the question list

Indicate how many flip-flops are required to construct each of the following counters: (i) mod–3 (ii) mod 6 (iii) mod–9.

2012 · Paper I · Q6a · 20 marks

Solution

Rule. A counter with N states needs the smallest number of flip-flops n with 2n≥N, that is n=⌈log2N⌉.

Counter States N Smallest n with 2n≥N Flip-flops
MOD-3 3 22=4≥3 2
MOD-6 6 23=8≥6 3
MOD-9 9 24=16≥9 4

Unused states. With n flip-flops, 2n−N states are unused: 1 for MOD-3, 2 for MOD-6 and 7 for MOD-9. The counter is made to skip them, for example by clearing it when it reaches N (ripple counters) or by treating them as don’t-cares in the design (synchronous counters).

These are the minimum numbers for binary-coded counters. Other kinds use more: a ring counter needs N flip-flops (3, 6, 9) and a Johnson counter needs N/2 (3 for MOD-6).

✓ Answer checked step by step We checked the rule 2n≥N for each modulus step by step.

↑ Back to the question list

Implement the following: (i) Half-adder using basic gates (ii) T flip-flop using J–K flip-flop (iii) 2 to 4 decoder using 1×4 demultiplexers.

2011 · Paper I · Q5a · 15 marks

Solution

(i) Half adder using basic gates.

A B Sum S Carry C
0 0 0 0
0 1 1 0
1 0 1 0
1 1 0 1

S=A⊕B=AB+AB and C=AB.

ABS = A ⊕ BC = AB
Half adder.

(ii) T flip-flop from a JK flip-flop. Tie J and K together and call the common input T.

  • T = 0: J = K = 0, so the flip-flop holds (Qn+1=Qn).
  • T = 1: J = K = 1, so it toggles (Qn+1=Qn).

This is exactly the T flip-flop: Qn+1=TQn+TQn.

KJQ’QCLKJKflip-flopTClock
T flip-flop from a JK flip-flop.

(iii) 2-to-4 decoder from a 1×4 demultiplexer. A demultiplexer sends its data input to the output chosen by the select lines. Tie the data input to logic 1 (it acts as an enable) and use A, B as the select inputs. The selected output becomes 1 and the others stay 0, which is a 2-to-4 decoder: D0=AB, D1=AB, D2=AB, D3=AB.

DY3Y2Y1Y0S1S01×4DEMUX1 (enable)ABD₀D₁D₂D₃
2-to-4 decoder from a 1×4 DEMUX.

✓ Answer checked step by step We checked each circuit against its truth table step by step.

↑ Back to the question list

Draw symbolic representation for +ve edge triggered clock input in a flip-flop and mark transition time by an arrow in clock input waveform for it.

2011 · Paper I · Q6b · 20 marks

Solution

Symbol. An edge-triggered clock input is marked with a small triangle (the dynamic indicator) inside the box at the clock pin.

  • Triangle alone: positive-edge triggered. The flip-flop acts on the LOW-to-HIGH transition.
  • Bubble plus triangle: negative-edge triggered. It acts on the HIGH-to-LOW transition.
DQQpositive edgeCLKDQQnegative edgeCLK
Edge-triggered clock inputs.

Transition instant. For the positive-edge flip-flop, the arrows below mark the moments it responds: every rising edge of the clock. Only the data present at these instants matters; D must be steady for the set-up time before the edge and the hold time after it.

CLK
Arrows mark the transitions at which a positive-edge flip-flop acts.

Between the arrows (while the clock is steady HIGH or LOW, and at falling edges) the output does not change, whatever the inputs do.

✓ Answer checked step by step We checked the symbol conventions step by step against the standard (IEEE/IEC) flip-flop symbols.

↑ Back to the question list

Design a decade counter using JK FF’s (MOD-10 counter) and draw the timing diagrams.

2010 · Paper I · Q2b(iii) · 8 marks

Solution

Design: ripple (asynchronous) decade counter. Four JK flip-flops in toggle mode (J = K = 1), negative-edge triggered. The clock drives FF0, and each Q output clocks the next flip-flop, so the counter counts up in binary.

To stop at 9, we detect 1010 (decimal 10). It is the first count with Q3=Q1=1, so a 2-input NAND of Q3 and Q1 drives the active-low clear inputs. The moment the count reaches 1010, all flip-flops reset to 0000.

TQCLRFF01TQCLRFF11TQCLRFF21TQCLRFF31ClockQ₀Q₁Q₂Q₃Q₁Q₃
Ripple decade (MOD-10) counter with JK flip-flops in toggle mode. On a phone, swipe sideways to see all of it.

Timing diagram. The count goes 0, 1, …, 9 on successive falling edges. At the 10th edge it reaches 1010 for a moment and is cleared at once to 0000.

12345678901ClockQ0 Q1 Q2 Q3
Timing diagram (numbers above: count after each falling edge). On a phone, swipe sideways to see all of it.

The state 1010 lasts only for the clear delay (a few nanoseconds), so it shows only as a narrow glitch on Q1. A synchronous decade counter avoids it, with J0=K0=1, J1=Q3Q0, K1=Q0, J2=K2=Q1Q0, J3=Q2Q1Q0, K3=Q0.

✓ Checked by computer We simulated the counter through twelve clock pulses in code.

↑ Back to the question list

Convert a clocked SR Flip-Flop to a clocked JK FF.

2010 · Paper I · Q7a(ii) · 10 marks

Solution

Idea. Choose S and R so that the SR flip-flop moves to the state a JK flip-flop would.

J K Qn Qn+1 (JK) S R
0 0 0 0 0 ×
0 0 1 1 × 0
0 1 0 0 0 ×
0 1 1 0 0 1
1 0 0 1 1 0
1 0 1 1 × 0
1 1 0 1 1 0
1 1 1 0 0 1

K-maps. S=JQn and R=KQn.

RSQQCLKJKQQ
JK flip-flop from a clocked SR flip-flop.

The feedback also removes the forbidden input: S and R can never both be 1, because one has Q and the other Q. With J = K = 1 the flip-flop toggles. The clock pulse must be short (or a master-slave SR used) to avoid race-around.

✓ Checked by computer We checked S = JQ′ and R = KQ against the JK table for all eight input combinations in code.

↑ Back to the question list

The figure below shows a divide-by-N counter.

KJQQFF2Q̅₁CLOCKQ₀Q₂Q̅₂KJQQFF1Q₂CLOCKQ̅₂Q₁Q̅₁KJQQFF0Q₁CLOCKQ̅₁Q₀Q̅₀
Figure redrawn from the question paper (inputs labelled by the signal they are wired to). On a phone, swipe sideways to see all of it.

(i) Find N. Assume initial value of Q0=1, Q1=0 and Q2=0.

(ii) Repeat Part (i), if initially Q0=1, Q1=0 and Q2=1.

2009 · Paper I · Q2b(i) · 10 marks · also asked 2009 (Q2b(ii))

Solution

The circuit. It is the same as 2015 Q6(b) above: Q1+=Q2, Q0+=Q1, and FF2 has J2=Q1, K2=Q0.

(i) Start at Q2Q1Q0=001.

001 → 100 → 110 → 111 → 011 → 001

The counter returns to 001 after 5 clocks, so N = 5.

(ii) Start at Q2Q1Q0=101.

  • At 101, J2=K2=1, so Q2 toggles to 0. Q1 becomes Q2=1 and Q0 becomes Q1=0, giving 010.
  • At 010, J2=K2=0, so the next state is 001.

101 → 010 → 001 → 100 → 110 → 111 → 011 → 001 → …

States 101 and 010 are not repeated. After two clocks the counter is in the same 5-state cycle, so again N = 5. The other unused state, 000, goes to 100, so whatever the starting state, the counter divides by 5 after at most two clocks.

✓ Checked by computer We stepped the counter from both starting states in code.

↑ Back to the question list

The waveforms shown in the figure below are applied to– 1. positive edge-triggered SR flip-flop; 2. master-slave SR flip-flop. Draw the output waveforms in each case.

abcdefghijClockSR
Figure redrawn from the question paper.

2009 · Paper I · Q7a(ii) · 10 marks

Solution

1. Positive edge-triggered SR flip-flop. It looks at S and R only at the rising edges a, c, e, g, i.

Edge S R Q after the edge
a 1 0 1 (set)
c 0 1 0 (reset)
e 1 0 1 (set)
g 0 1 0 (reset)
i 0 0 0 (hold)

2. Master-slave SR flip-flop. The master follows S and R while the clock is HIGH. The output changes at the falling edges b, d, f, h, j to the master’s final state.

Pulse S, R while the clock is HIGH Master at the end Q after
a to b 1, 0 1 1 at b
c to d 0, 1 then 0, 0 0 0 at d
e to f 1, 0 1 1 at f
g to h 0, 1 then 1, 0 1 1 at h
i to j 0, 0 then 0, 1 0 0 at j
abcdefghijClockSRQ (edge)Q (M-S)
Outputs (dashed: unknown starting state). On a phone, swipe sideways to see all of it.

The two outputs differ during the 4th and 5th pulses. At g the edge-triggered flip-flop sees only R = 1 and resets. The master-slave flip-flop also sees the later S = 1 in the same pulse, so it ends set at h. In the last pulse, R rises after i: the master-slave flip-flop is reset by it at j, while the edge-triggered one ignores it (it was already reset at g).

✓ Checked by computer We sampled S and R at each edge (edge-triggered) and over each HIGH pulse (master-slave) in code.

↑ Back to the question list

A partially filled truth table of a sequence generator (3-D flip-flops in cascade) is given below. Find the sequence generated. Q0 is LSB and Q2 is MSB.

State Q2 Q1 Q0
1 1 0
2 0
3
4 1
5 0 1
6
7 1 1
1 0 0

2007 · Paper I · Q1b(i) · 10 marks

Solution

Which way the data moves. In a cascade each flip-flop takes the previous one’s output. If data moved Q2→Q1→Q0, state 7 has Q2=1, so Q1 in the next state (state 1) would be 1. The table gives 0, so data moves the other way: Q2+=Q1,Q1+=Q0,Q0+=feedback.

Filling the table. Each Q2 is the previous Q1, and each Q1 is the previous Q0. Working through the given entries:

State Q2 Q1 Q0 Decimal
1 1 0 0 4
2 0 0 1 1
3 0 1 0 2
4 1 0 1 5
5 0 1 1 3
6 1 1 1 7
7 1 1 0 6
1 1 0 0 4

Sequence generated. Read at the serial output Q2, the sequence is 1 0 0 1 0 1 1, repeating every 7 clocks. Q0 gives the same sequence two clocks earlier.

Feedback. The new bit into Q0 is 1, 0, 1, 1, 1, 0, 0 for states 1 to 7, which is Q2⊕Q1 every time. So D0=Q2⊕Q1. This is a maximal-length (7-state) sequence generator: it never enters 000.

DQFF2Q₁CLKQ₂DQFF1Q₀CLKQ₁DQFF0Q₂ ⊕ Q₁CLKQ₀
The sequence generator (common clock). On a phone, swipe sideways to see all of it.

✓ Checked by computer We filled the table in code and confirmed that only one shift direction fits the given entries.

↑ Back to the question list

Draw the logic diagram and timing diagram of a 3-bit binary ripple up counter using positive edge triggered FF’s.

2006 · Paper I · Q8a(iv) · 5 marks

Solution

Circuit. Three flip-flops in toggle mode (T = 1, or a JK with J = K = 1), all positive-edge triggered.

For an up counter, each stage must toggle when the previous Q goes from 1 to 0. With positive-edge flip-flops, that falling edge of Q is a rising edge of Q. So each Q clocks the next stage.

TQQFF01Q₀TQQFF11Q₁TQQFF21Q₂Clock
3-bit ripple up counter with positive-edge flip-flops. On a phone, swipe sideways to see all of it.

Timing diagram. Q0 toggles at every rising clock edge. Q1 toggles when Q0 falls and Q2 when Q1 falls. The count goes 0, 1, 2, …, 7, 0. Each flip-flop’s delay adds to the one before it, so Q2 settles last.

123456701ClockQ0 Q1 Q2
Timing diagram (numbers above: count after each rising edge). On a phone, swipe sideways to see all of it.

✓ Checked by computer We simulated eight clock pulses in code.

↑ Back to the question list

A sequential circuit has one input and one output. The state diagram is shown in the figure. Design the sequential circuit using D flip-flop.

0/01/11/00/00/01/10/01/11/10/0001100011010000
Figure redrawn from the question paper.

2005 · Paper I · Q6a(iii) · 5 marks

Solution

Reading the diagram. We read the label “1/3” on the 010 → 000 arrow as 1/1 (an output can only be 0 or 1). We take the 0/0 line between 011 and 000 as 000 → 011, since every other state has both input values accounted for.

State table (state ABC; unused 101, 110, 111 are don’t-cares).

Present Next, x = 0 Next, x = 1 z (x = 0) z (x = 1)
000 011 100 0 1
001 001 100 0 1
010 010 000 0 1
011 001 010 0 1
100 010 011 0 0

Equations (K-maps in A, B, C, x with the don’t-cares): DA=ABx,DB=A+Cx+BCx,DC=ABx+Cx+Ax,z=Ax.

For example, DC is 1 for (state, x) = (000, 0), (001, 0), (011, 0) and (100, 1). Cx covers 001 and 011, ABx covers 000, and Ax covers 100 with x = 1.

DQQAA̅B̅xCLKAA̅DQQBA + C̅x̅ + BCxCLKBB̅DQQCA̅B̅x̅ + Cx̅ + AxCLKCC̅
D flip-flop realisation (common clock); output z = A′x. On a phone, swipe sideways to see all of it.

The output gate is one AND gate: z=Ax.

✓ Checked by computer We checked the next state and output for all ten state–input pairs from the equations in code.

↑ Back to the question list

The clock frequency of 1000 ns is connected to a 3-bit asynchronous counter with each flip-flip having 50 ns propagating delay. Which slate will never occur in it, if the clock frequency is decreased to 100 ns? Explain it by drawing wave- shapes for 1000 ns and 100 ns clock frequencies separately.

2000 · Paper I · Q2a · 20 marks

Solution

Note on the question. “Frequency of 1000 ns” means a clock period of 1000 ns (1 MHz); 100 ns means 10 MHz. The counter is a 3-bit ripple counter with negative-edge flip-flops, so the worst-case settling time is 3×50=150 ns (the change from 011 to 100, or from 111 to 000).

Clock period 1000 ns. The counter settles in at most 150 ns, so each count is held for at least 850 ns before the next edge. All eight states 0 to 7 appear in order. During the long ripples there are brief 50 ns transient states, for example 011 → 010 → 000 → 100.

1 µs2 µs3 µs4 µs5 µs6 µs7 µs8 µs9 µsCLKQ0 Q1 Q2 Count012345670
Clock period 1000 ns: counts 0 to 7 in order. On a phone, swipe sideways to see all of it.

Clock period 100 ns. Now the period is shorter than the 150 ns ripple time. Q1 changes 100 ns after the clock edge, at the same moment as the next edge. Q2 changes 150 ns after the edge, exactly when Q0 toggles again. The waveforms, in 50 ns steps:

100 ns300 ns500 ns700 ns900 nsCLKQ0 Q1 Q2 Count01023205467641
Clock period 100 ns (numbers: count in each 50 ns step). On a phone, swipe sideways to see all of it.
  • From 011 the counter goes 011 → 010 → 000 → 101. Q2 rises at the same instant Q0 rises for the next count, so 100 (count 4) never appears after 011.
  • In the same way, from 111 the counter goes 111 → 110 → 100 → 001, so 000 never appears after 111.
  • Read just before each clock edge, the counter gives 1, 0, 3, 2, 5, 4, 7, 6, …: each pair of counts is swapped.

So the expected answer is the state 100: with a 100 ns clock the counter jumps from 011 straight to 101. Strictly, the patterns 100 and 000 still flash briefly at other points in the cycle, but never as the correct next count. The counter is useless at this speed; the clock period must exceed 150 ns.

✓ Checked by computer We simulated the ripple counter with 50 ns flip-flop delays at both clock periods in code.

↑ Back to the question list

What is a race condition? How is it prevented?

1999 · Paper I · Q5b(ii) · 10 marks

Solution

Race (race-around) condition. In a level-triggered JK flip-flop with J = K = 1, the output should toggle once per clock pulse. But Q and Q are fed back to the input gates. If the clock stays HIGH longer than the propagation delay of the flip-flop (tp>Δt), the new output reaches the inputs while the clock is still HIGH and toggles the flip-flop again. The output keeps toggling for the whole pulse, and its final state is unpredictable. This is the race-around condition.

How it is prevented.

  • Short clock pulse: keep the pulse width below the propagation delay (tp<Δt<T). This is hard to guarantee in practice.
  • Master-slave flip-flop: the master accepts the inputs while the clock is HIGH and the slave updates only when the clock goes LOW. The fed-back output cannot change while the master is open, so the flip-flop toggles exactly once per pulse.
  • Edge-triggered flip-flop: the inputs are sampled only at a clock edge, so the output cannot reach the inputs within the sampling window.

Race in asynchronous sequential circuits. A race also occurs when two or more state variables must change together and the circuit’s final state depends on which changes first (a critical race). It is avoided by a race-free state assignment, so that adjacent states differ in one variable (Gray-code style), or by adding intermediate states.

✓ Answer checked step by step We checked the explanation step by step against the standard theory of latches and flip-flops.

↑ Back to the question list

The circuit shown in Fig. Q. 5(d) is using master-slave flip-flops. VCC is high and can be taken to be 1. Find B0 and B1 for the first seven clock cycles after these are initially cleared. Give precise explanations for your answers.

KJQCRFF1KJQCRFF2VCCVCCAACLKB₀B₁VCC
Figure redrawn from the question paper.

1995 · Paper I · Q5d · 20 marks

Solution

How the circuit works. Both flip-flops have J = K = 1 (VCC, and A is also at VCC), so each toggles once per clock. Master-slave flip-flops change their outputs when their clock falls (HIGH to LOW).

  • FF1 is clocked by CLK, so B0 toggles at every falling edge of CLK.
  • FF2 is clocked by B0, so B1 toggles whenever B0 falls from 1 to 0.

This is a 2-bit ripple counter. Starting from B1B0=00:

Clock cycle B1 B0 Why
1 0 1 B0 toggles; it rises, so FF2 is not triggered
2 1 0 B0 falls, so B1 toggles
3 1 1 B0 rises
4 0 0 B0 falls, so B1 toggles
5 0 1
6 1 0
7 1 1
1234567CLKB0 B1
B1B0 after each falling clock edge.

So B1B0 counts 1, 2, 3, 0, 1, 2, 3: a MOD-4 up counter. B0 has half and B1 a quarter of the clock frequency.

✓ Checked by computer We stepped both flip-flops through seven clock cycles in code.

↑ Back to the question list

More on Digital Electronics

Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper I, 1995–2026. Solutions: Optional Province. Found an error? Tell us.

Spotted an error? Tell us.

We classify every PYQ with care, but mistakes can slip in. If a question is in the wrong topic, has a typo, the wrong year, or is missing, let us know. We review every report and update the page.

Report an Error
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted