Level 3 — ProductionSequential Circuits

Sequential Circuits

45 minutes60 marksprintable — key stays hidden on paper

Chapter: 3.4 Sequential Circuits Level: 3 — Production (from-scratch derivations, design-from-memory, explain-out-loud) Time limit: 45 minutes Total marks: 60

Show all reasoning. For "explain-out-loud" prompts, write the explanation as if teaching a peer. Timing answers must include units.


Question 1 — Latch/Flip-flop from scratch (10 marks)

(a) From memory, draw the NOR-based SR latch and derive its characteristic behaviour. Complete the excitation/next-state table for inputs (S,R)(S,R) and identify the forbidden input combination, explaining why it is forbidden. (5)

(b) Explain out loud the essential difference between a gated D latch and an edge-triggered D flip-flop, using the terms transparency and sampling instant. (3)

(c) Derive the characteristic equation of a JK flip-flop in the form Q+=f(J,K,Q)Q^{+}=f(J,K,Q). (2)


Question 2 — Timing constraints derivation (12 marks)

A flip-flop-based pipeline stage uses a single clock. The parameters are:

  • Clock-to-Q delay tcq=90t_{cq} = 90 ps
  • Setup time tsu=60t_{su} = 60 ps
  • Hold time th=40t_{h} = 40 ps
  • Combinational logic: longest path tpd=520t_{pd} = 520 ps, shortest path tcd=45t_{cd} = 45 ps

(a) Derive the setup constraint and compute the minimum clock period TminT_{min} and maximum frequency fmaxf_{max}. (4)

(b) Derive the hold constraint and determine whether it is satisfied. If not, state one fix. (4)

(c) Now introduce clock skew tskew=35t_{skew}=35 ps where the receiving flip-flop's clock arrives later than the launching flip-flop's. Re-derive both constraints and state the new TminT_{min} and the new hold margin. (4)


Question 3 — Counter design from scratch (12 marks)

(a) Design a synchronous mod-6 up counter (states 0→5→0) using T flip-flops. Give the state table, derive the T-input excitation equations for T2,T1,T0T_2,T_1,T_0 (bits Q2Q1Q0Q_2Q_1Q_0), and simplify. (8)

(b) Explain out loud, comparing a synchronous vs a ripple (asynchronous) mod-6 counter, why the worst-case settling delay differs, and give the worst-case output-valid delay for the ripple version in terms of tcqt_{cq}. (4)


Question 4 — Ring vs Johnson counter (8 marks)

(a) A 4-bit Johnson (twisted-ring) counter starts at 00000000. List the full state sequence and state the modulus. (4)

(b) Contrast a 4-bit ring counter and a 4-bit Johnson counter on: number of distinct states, and decoding-gate complexity for detecting one unique state. (2)

(c) Explain out loud why both counters can enter an illegal/unused state cycle, and name one self-correction technique. (2)


Question 5 — FSM design and minimisation (12 marks)

Design a Mealy finite state machine that outputs 1 whenever the serial input bit-stream contains the pattern 101 (overlapping allowed).

(a) Draw the state diagram and give the state table (states, next-state, output). (6)

(b) Explain out loud one key structural difference between a Mealy and a Moore machine for this same detector, including the effect on output timing and number of states. (3)

(c) Given the state table below, apply state minimisation (find equivalent states) and give the reduced table. (3)

Present Next(x=0) Next(x=1) Out
A B C 0
B B D 0
C B C 0
D B C 1

Question 6 — Metastability & CDC (6 marks)

(a) Define metastability and explain out loud why a two-flip-flop synchroniser reduces the probability of failure but cannot eliminate it. (3)

(b) The mean time between failures for a synchroniser is MTBF=etr/τfcfdT0MTBF = \dfrac{e^{t_r/\tau}}{f_c\, f_d\, T_0}. If τ=0.10\tau=0.10 ns, T0=1T_0=1 ns, fc=100f_c=100 MHz, fd=10f_d=10 MHz, and the available resolution time tr=2.0t_r=2.0 ns, compute the MTBF. State whether adding one more synchroniser stage that adds 1.01.0 ns of resolution time improves matters, and by what factor. (3)

Answer keyMark scheme & solutions

Question 1 (10)

(a) NOR SR latch: two cross-coupled NOR gates; SS into one, RR into the other; outputs Q,QˉQ,\bar Q. (1 for structure)

Next-state table (active-high, NOR latch): (3 for correct table)

S R Q+Q^{+} Comment
0 0 QQ Hold
0 1 0 Reset
1 0 1 Set
1 1 0 (both outputs 0) Forbidden

Forbidden is S=R=1S=R=1: it forces both outputs to 0, violating Q=QˉQ=\overline{\bar Q}; and on releasing to 0,00,0 the final state is unpredictable (race), depending on gate delays. (1 for why)

(b) A gated D latch is level-sensitive/transparent: while the enable is asserted, QQ follows DD continuously. An edge-triggered D flip-flop samples DD only at the active clock edge (the sampling instant) and holds it otherwise — it is never transparent. (3: transparency 1, sampling instant 1, correct contrast 1)

(c) JK: on hold Q+=QQ^{+}=Q, set when J=1J=1, reset when K=1K=1, toggle when J=K=1J=K=1. Q+=JQˉ+KˉQ.Q^{+}=J\bar Q + \bar K Q. (2)


Question 2 (12)

(a) Setup constraint: Ttcq+tpd+tsuT \ge t_{cq}+t_{pd}+t_{su}. (1) Tmin=90+520+60=670 ps.T_{min}=90+520+60=670\text{ ps}. (2) fmax=1/670ps1.493 GHz.f_{max}=1/670\text{ps}\approx 1.493\text{ GHz}. (1)

(b) Hold constraint: tcq+tcdtht_{cq}+t_{cd}\ge t_{h}. (1) 90+45=135 ps40 pssatisfied (margin 95 ps).90+45=135\text{ ps}\ge 40\text{ ps} \Rightarrow \text{satisfied (margin }95\text{ ps).} (2) If it had failed, fix = add buffer/delay on data path (increase tcdt_{cd}). (1)

(c) Positive skew (receiver clock later by tskewt_{skew}): Setup: Ttcq+tpd+tsutskewT \ge t_{cq}+t_{pd}+t_{su}-t_{skew} → skew relaxes setup. (1) Tmin=67035=635 ps.T_{min}=670-35=635\text{ ps}. (1) Hold: tcq+tcdth+tskewt_{cq}+t_{cd}\ge t_{h}+t_{skew} → skew tightens hold. New required: th+tskew=75t_h+t_{skew}=75 ps; available 135135 ps → margin =13575=60=135-75=60 ps, still satisfied. (2)


Question 3 (12)

(a) Mod-6 counts 000001010011100101000000\to001\to010\to011\to100\to101\to000. T flip-flop toggles when T=1T=1; Ti=QiQi+T_i=Q_i\oplus Q_i^{+}. (2 for table)

Q2Q1Q0Q_2Q_1Q_0 next T2T1T0T_2T_1T_0
000 001 001
001 010 011
010 011 001
011 100 111
100 101 001
101 000 101

Derive (states 110,111 are don't-cares): (4 for correct simplified equations)

  • T0=1T_0=1 (toggles every cycle). ✔ all listed states have T0=1T_0=1.
  • T1T_1: =1 for rows 001,011,101 → whenever Q0=1Q_0=1 except when returning… check: 001→T1=1T_1=1, 011→T1=1T_1=1, 101→T1=0T_1=0. So T1=Q0Qˉ2T_1 = Q_0\bar Q_2 (with don't-cares).
  • T2T_2: =1 for 011 and 101 → T2=Q1Q0+Q2Q0=Q0(Q1+Q2)T_2 = Q_1Q_0 + Q_2Q_0 = Q_0(Q_1+Q_2).

Final:   T0=1,T1=Q0Qˉ2,T2=Q0(Q1+Q2).\;T_0=1,\quad T_1=Q_0\bar Q_2,\quad T_2=Q_0(Q_1+Q_2). (2 for using don't-cares/simplification)

(b) In a synchronous counter all flip-flops share the clock, so worst-case is one tcqt_{cq} plus next-state logic — outputs settle together. In a ripple counter each stage clocks the next, so delays add: bit 0's transition ripples through. Worst-case output-valid delay ntcq\approx n\cdot t_{cq} (here up to 3tcq3\,t_{cq} for 3 stages), and glitches/transient wrong codes appear. (4: mechanism 2, ripple delay expression 2)


Question 4 (8)

(a) 4-bit Johnson feeds inverted MSB into LSB. Sequence from 0000: (3) 000010001100111011110111001100010000.0000\to1000\to1100\to1110\to1111\to0111\to0011\to0001\to0000. Modulus =2×4=8=2\times4=8. (1)

(b) Ring (one-hot circulating 1): 4 distinct states, single-bit decode (1 gate/no gate). Johnson: 8 states, each decoded with a 2-input gate (adjacent-bit pattern). (2)

(c) Both have unused states forming isolated loops the counter can lock into on power-up/glitch; ring counter has 244=122^4-4=12 unused states, Johnson 248=82^4-8=8. Self-correction: add logic to force a legal state (e.g., steer into the sequence when an illegal pattern is detected). (2)


Question 5 (12)

(a) Mealy 101 detector, states: S0 (nothing), S1 (saw 1), S2 (saw 10). Output on transition. (4 table + 2 diagram)

Present x=0 → next/out x=1 → next/out
S0 S0 / 0 S1 / 0
S1 S2 / 0 S1 / 0
S2 S0 / 0 S1 / 1

(Overlap handled: from S2 on 1 we output 1 and go to S1, since that 1 can start a new 101.) (6)

(b) Mealy output depends on state and current input, so the 1 appears combinationally in the same cycle the last bit arrives (faster, fewer states — 3 here). Moore output depends on state only, needs an extra "detected" state, giving output one cycle later and typically more states (4). (3)

(c) Minimisation: A,B,C,D. Group by output: {A,B,C} out=0, {D} out=1.

  • Check within {A,B,C}: A→(B,C), C→(B,C) identical ⇒ A≡C. B→(B,D): D is in different group ⇒ B not equivalent to A/C. Reduced states: {A,C}=P, {B}=Q, {D}=R. (2)
Present Next(0) Next(1) Out
P (A,C) Q P 0
Q (B) Q R 0
R (D) Q P 1

4 states → 3 states. (1)


Question 6 (6)

(a) Metastability: a flip-flop clocked while its data violates setup/hold can enter a balanced state between 0 and 1, resolving after an unbounded time. A 2-FF synchroniser gives the first FF a full clock period to resolve before the second samples it, exponentially lowering failure probability — but since resolution time is only probabilistic (exponential tail), it can never be zero. (3)

(b) MTBF=etr/τfcfdT0MTBF=\dfrac{e^{t_r/\tau}}{f_c f_d T_0} with tr/τ=2.0/0.10=20t_r/\tau=2.0/0.10=20. e204.852×108;fcfdT0=108107109=106.e^{20}\approx 4.852\times10^{8};\quad f_c f_d T_0=10^{8}\cdot10^{7}\cdot10^{-9}=10^{6}. MTBF4.852×108/106=4.85×102 s485 s.MTBF\approx 4.852\times10^{8}/10^{6}=4.85\times10^{2}\text{ s}\approx 485\text{ s}. (2) Extra stage adds tr=1.0t_r=1.0 ns → factor e1.0/0.10=e102.20×104e^{1.0/0.10}=e^{10}\approx 2.20\times10^{4} improvement. Yes, hugely improves. (1)

[
 {"claim":"Setup Tmin=670ps, fmax≈1.4925GHz","code":"tcq=90;tpd=520;tsu=60;Tmin=tcq+tpd+tsu;fmax=1/(Tmin*1e-12);result=(Tmin==670 and abs(fmax-1.4925e9)<1e7)"},
 {"claim":"Hold satisfied margin 95ps and skew hold margin 60ps","code":"tcq=90;tcd=45;th=40;skew=35;m1=tcq+tcd-th;m2=tcq+tcd-(th+skew);result=(m1==95 and m2==60)"},
 {"claim":"Skew setup Tmin=635ps","code":"result=(670-35==635)"},
 {"claim":"Johnson 4-bit modulus is 8","code":"result=(2*4==8)"},
 {"claim":"MTBF approx 485s","code":"import sympy as sp;tr=sp.Rational(20,10);tau=sp.Rational(1,10);num=sp.exp(tr/tau);den=sp.Integer(10)**6;mtbf=float(num/den);result=(abs(mtbf-485)<5)"},
 {"claim":"Extra stage improvement factor e^10≈2.20e4","code":"import sympy as sp;f=float(sp.exp(10));result=(abs(f-2.2026e4)<50)"}
]