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
Design a MOD-6 synchronous DOWN counter using – flip-flops.
Solution
Count sequence. A MOD-6 down counter needs three flip-flops () and counts . States 6 and 7 are not used.
Excitation table. For a JK flip-flop: needs ; needs ; needs ; needs .
| Present | Next | |||
|---|---|---|---|---|
| 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):
For example, is 1 only in state 000, and the other states with (001, 010, 011) give 0, so . is 1 in state 100 and 0 in state 101, so .
Circuit. All three clock inputs go to the common clock; two 2-input AND gates make and .
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.
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.
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, and . So Each D input is a 2-to-1 multiplexer with X as the select line.
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.
Consider the shift register shown in the figure below, which is implemented using D flip-flops and multiplexers.
Complete the truth table shown as follows:
| CK (Inputs) | (Inputs) | Load (Inputs) | (Next State) | (Next State) | (Next State) | (Next State) |
| X | 0 | X | ||||
| ↑ (rising edge) | 1 | 0 | ||||
| ↑ (rising edge) | 1 | 1 |
Complete the timing diagram below assuming .
Solution
How the circuit works. Each multiplexer picks the D input of its flip-flop.
- Load = 0 selects input 0: , , , . Each rising edge shifts the data one place towards , and enters at .
- Load = 1 selects input 1: . The rising edge loads in parallel.
- clears all four flip-flops at once, whatever the clock does.
Truth table.
| CK | Load | |||||
|---|---|---|---|---|---|---|
| × | 0 | × | 0 | 0 | 0 | 0 |
| ↑ | 1 | 0 | ||||
| ↑ | 1 | 1 |
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 . After that Load = 0, so the register shifts at every edge.
| After edge | |||||
|---|---|---|---|---|---|
| 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, goes low and all outputs fall to 0 at once; they stay 0 at edge 13.
✓ Checked by computer We simulated the register edge by edge in code for the given Load, XL and CLR waveforms.
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.
Solution
How the flip-flop works.
- While C = 1, gates and pass and to the master latch (, ), so follows S and R like an SR latch. keeps and at 1, so the slave holds.
- While C = 0, the master is locked and the slave copies it: .
So 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 | Slave 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).
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.
Differentiate between the functions of Decade counter and BCD counter with example.
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.
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.
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 . So we feed each D input with an OR gate: The clear inputs still go to Start.
The OR feedback matters. With just , 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.
Design a synchronous sequential circuit with D-flip-flops for a state diagram shown in Figure 4(b).
Solution
State table (D = next state; state ABC).
| Present ABC | Next ABC | |||
|---|---|---|---|---|
| 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.
- : the pair (1, 3) gives , the pair (4, 6) gives and the pair (6, 7) gives . So .
- .
- : the pair (0, 4) gives and the pair (6, 7) gives . So .
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.
Convert a D flip flop to function as an S-R flip flop. Draw the circuit.
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 | = D | |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 |
| 0 | 1 | × | 0 |
| 1 | 0 | × | 1 |
| 1 | 1 | × | not allowed (don’t care) |
K-map. .
Circuit. An inverter on R, an AND gate making (Q fed back from the output), and an OR gate adding S. The OR output drives D.
✓ Checked by computer We checked D = S + R′Q against the SR table for all allowed inputs in code.
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.
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 | |||
|---|---|---|---|---|
| 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):
- .
- .
- .
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.
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.
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.
Excitation table (ABC, A the MSB).
| Present | Next | |||
|---|---|---|---|---|
| 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):
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.
Divide by N counter is shown in the figure below. If initially , , , what is the value of N?
Solution
Simplify first. For FF1, and , so it acts as a D flip-flop: . In the same way . For FF2, and .
Trace from .
| Clock | Next | ||
|---|---|---|---|
| 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, for example, repeats every 5 clock pulses.
✓ Checked by computer We stepped the counter from 010 and from every other state in code.
Design a circuit that gives the input-output relationship shown in Fig. 4.
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 , so the output is just . The standard synchronous JK design is
Check. Starting from 000, the falling edges give 1, 2, 3, 4, 0, so is HIGH from the end of pulse 4 to the end of pulse 5.
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.
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.
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.
Show how a D flip-flop can be converted to SR flip-flop.
Solution
This is the same conversion as 2018 Q5(a) above.
The D input must equal the next state of an SR flip-flop: , with S = R = 1 not allowed. So
Circuit. An inverter on R, an AND gate for (Q fed back), and an OR gate adding S, feeding D.
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.
Indicate how many flip-flops are required to construct each of the following counters: (i) mod–3 (ii) mod 6 (iii) mod–9.
Solution
Rule. A counter with N states needs the smallest number of flip-flops n with , that is .
| Counter | States N | Smallest n with | Flip-flops |
|---|---|---|---|
| MOD-3 | 3 | 2 | |
| MOD-6 | 6 | 3 | |
| MOD-9 | 9 | 4 |
Unused states. With n flip-flops, 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 for each modulus step by step.
Implement the following: (i) Half-adder using basic gates (ii) flip-flop using – flip-flop (iii) 2 to 4 decoder using 1×4 demultiplexers.
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 |
and .
(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 ().
- T = 1: J = K = 1, so it toggles ().
This is exactly the T 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: , , , .
✓ Answer checked step by step We checked each circuit against its truth table step by step.
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.
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.
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.
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.
Design a decade counter using JK FF’s (MOD-10 counter) and draw the timing diagrams.
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 , so a 2-input NAND of and drives the active-low clear inputs. The moment the count reaches 1010, all flip-flops reset to 0000.
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.
The state 1010 lasts only for the clear delay (a few nanoseconds), so it shows only as a narrow glitch on . A synchronous decade counter avoids it, with , , , , , .
✓ Checked by computer We simulated the counter through twelve clock pulses in code.
Convert a clocked SR Flip-Flop to a clocked JK FF.
Solution
Idea. Choose S and R so that the SR flip-flop moves to the state a JK flip-flop would.
| J | K | (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. and .
The feedback also removes the forbidden input: S and R can never both be 1, because one has 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.
The figure below shows a divide-by- counter.
(i) Find . Assume initial value of , and .
(ii) Repeat Part (i), if initially , and .
Solution
The circuit. It is the same as 2015 Q6(b) above: , , and FF2 has , .
(i) Start at .
001 → 100 → 110 → 111 → 011 → 001
The counter returns to 001 after 5 clocks, so N = 5.
(ii) Start at .
- At 101, , so toggles to 0. becomes and becomes , giving 010.
- At 010, , 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.
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.
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 |
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.
A partially filled truth table of a sequence generator (3-D flip-flops in cascade) is given below. Find the sequence generated. is LSB and is MSB.
| State | |||
| 1 | 1 | 0 | |
| 2 | 0 | ||
| 3 | |||
| 4 | 1 | ||
| 5 | 0 | 1 | |
| 6 | |||
| 7 | 1 | 1 | |
| 1 | 0 | 0 |
Solution
Which way the data moves. In a cascade each flip-flop takes the previous one’s output. If data moved , state 7 has , so in the next state (state 1) would be 1. The table gives 0, so data moves the other way:
Filling the table. Each is the previous , and each is the previous . Working through the given entries:
| State | 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 , the sequence is 1 0 0 1 0 1 1, repeating every 7 clocks. gives the same sequence two clocks earlier.
Feedback. The new bit into is 1, 0, 1, 1, 1, 0, 0 for states 1 to 7, which is every time. So . This is a maximal-length (7-state) sequence generator: it never enters 000.
✓ Checked by computer We filled the table in code and confirmed that only one shift direction fits the given entries.
Draw the logic diagram and timing diagram of a 3-bit binary ripple up counter using positive edge triggered FF’s.
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 . So each clocks the next stage.
Timing diagram. toggles at every rising clock edge. toggles when falls and when falls. The count goes 0, 1, 2, …, 7, 0. Each flip-flop’s delay adds to the one before it, so settles last.
✓ Checked by computer We simulated eight clock pulses in code.
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.
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):
For example, is 1 for (state, x) = (000, 0), (001, 0), (011, 0) and (100, 1). covers 001 and 011, covers 000, and covers 100 with x = 1.
The output gate is one AND gate: .
✓ Checked by computer We checked the next state and output for all ten state–input pairs from the equations in code.
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.
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 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.
Clock period 100 ns. Now the period is shorter than the 150 ns ripple time. changes 100 ns after the clock edge, at the same moment as the next edge. changes 150 ns after the edge, exactly when toggles again. The waveforms, in 50 ns steps:
- From 011 the counter goes 011 → 010 → 000 → 101. rises at the same instant 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.
What is a race condition? How is it prevented?
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 are fed back to the input gates. If the clock stays HIGH longer than the propagation delay of the flip-flop (), 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 (). 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.
The circuit shown in Fig. Q. 5(d) is using master-slave flip-flops. is high and can be taken to be 1. Find and for the first seven clock cycles after these are initially cleared. Give precise explanations for your answers.
Solution
How the circuit works. Both flip-flops have J = K = 1 (, and A is also at ), 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 toggles at every falling edge of CLK.
- FF2 is clocked by , so toggles whenever falls from 1 to 0.
This is a 2-bit ripple counter. Starting from :
| Clock cycle | Why | ||
|---|---|---|---|
| 1 | 0 | 1 | toggles; it rises, so FF2 is not triggered |
| 2 | 1 | 0 | falls, so toggles |
| 3 | 1 | 1 | rises |
| 4 | 0 | 0 | falls, so toggles |
| 5 | 0 | 1 | |
| 6 | 1 | 0 | |
| 7 | 1 | 1 |
So counts 1, 2, 3, 0, 1, 2, 3: a MOD-4 up counter. has half and a quarter of the clock frequency.
✓ Checked by computer We stepped both flip-flops through seven clock cycles in code.
More on Digital Electronics
- All Electrical Engineering PYQ solutions, topic by topic
- Digital Electronics topic-wise PYQs (questions only, for practice)
- Electrical Engineering PYQ analysis: which units carry the marks year by year
- Year-wise question papers
- Electrical Engineering booklist
Questions: UPSC Civil Services (Main) Examination, Electrical Engineering Paper I, 1995–2026. Solutions: Optional Province. Found an error? Tell us.

