Level 4 — ApplicationSequential Circuits

Sequential Circuits

printable — key stays hidden on paper

Level 4 (Application) | Time: 60 minutes | Total: 60 marks

Instructions: Answer all questions. Show all working. Assume positive-edge-triggered flip-flops unless stated. All timing figures are given per gate/element.


Question 1 — Timing Closure (14 marks)

A synchronous pipeline has two flip-flops FF1 → combinational logic → FF2, all on the same clock. The parameters are:

  • Clock-to-Q delay tcq=0.6 nst_{cq} = 0.6\text{ ns}
  • Setup time tsu=0.3 nst_{su} = 0.3\text{ ns}
  • Hold time th=0.4 nst_{h} = 0.4\text{ ns}
  • Combinational logic delay: tlogic,max=4.2 nst_{logic,\max} = 4.2\text{ ns}, tlogic,min=0.5 nst_{logic,\min} = 0.5\text{ ns}
  • Clock skew between the launching and capturing flip-flop: tskewt_{skew} (capture clock arrives later than launch clock by this amount).

(a) With zero skew, determine the maximum operating clock frequency. (4)

(b) With tskew=+0.5 nst_{skew} = +0.5\text{ ns} (capture edge delayed), recompute the maximum frequency. Explain the direction of the change. (4)

(c) Check the hold constraint for both tskew=0t_{skew}=0 and tskew=+0.5 nst_{skew}=+0.5\text{ ns}. State whether a hold violation occurs. (4)

(d) Explain why increasing clock skew can help the setup path but harm the hold path. (2)


Question 2 — Flip-Flop Conversion (12 marks)

You are given only T flip-flops (with clock and asynchronous clear) and any number of AND/OR/NOT gates.

(a) Derive the excitation logic to build a JK flip-flop from a T flip-flop, i.e. express the required TT input as a Boolean function of JJ, KK, and current output QQ. Show the derivation using the JK characteristic behaviour. (6)

(b) Using your result, tabulate TT for all four JKJK combinations for both Q=0Q=0 and Q=1Q=1, and confirm the flip-flop reproduces correct JK behaviour. (4)

(c) State one practical advantage of a T flip-flop in counter design. (2)


Question 3 — Counter Design (14 marks)

Design a synchronous counter that cycles through the sequence 035600 \to 3 \to 5 \to 6 \to 0 \to \dots (a mod-4 sequence over 3 output bits Q2Q1Q0Q_2Q_1Q_0), using D flip-flops.

(a) Write the state table showing present state and next state for the four used states. Treat unused states (1,2,4,7) as don't-cares. (4)

(b) Derive minimized next-state equations D2,D1,D0D_2, D_1, D_0 using Karnaugh maps (with don't-cares). (7)

(c) Determine whether any unused state can trap the counter in an unintended cycle (self-start check). Justify. (3)


Question 4 — Clock Domain Crossing & Metastability (12 marks)

A single-bit control signal passes from a 50 MHz domain into a 200 MHz domain. The receiving synchronizer uses two cascaded flip-flops. Each flip-flop has:

  • Metastability resolution time constant τ=0.15 ns\tau = 0.15\text{ ns}
  • Settling window Tw=0.02 nsT_w = 0.02\text{ ns}
  • Clock-to-Q + setup overhead consuming 0.5 ns0.5\text{ ns} of each clock period.

(a) Compute the clock period of the 200 MHz domain and the time available for metastability resolution in one flip-flop stage. (3)

(b) The mean time between failures for a single-stage synchronizer is MTBF=etr/τTwfcfd\text{MTBF} = \frac{e^{t_r/\tau}}{T_w \cdot f_c \cdot f_d} where trt_r is resolution time, fcf_c the sampling clock frequency, fdf_d the data toggle rate (=25 MHz=25\text{ MHz}). Compute the MTBF of the two-stage synchronizer, where the effective resolution time is the sum of both stages' resolution times. (6)

(c) Explain why a multi-bit bus cannot be safely synchronized by simply placing a 2-FF synchronizer on each bit, and name one correct technique. (3)


Question 5 — FSM Design & Minimization (8 marks)

A Moore machine detects the serial bit pattern 101 (overlapping allowed) on input xx, asserting output z=1z=1 in the state reached after a valid pattern.

(a) Draw the state diagram (list states, transitions on x=0/1x=0/1, and output per state). (4)

(b) Give the state table, then state whether any two states are equivalent and can be merged. Justify briefly. (4)


Answer keyMark scheme & solutions

Question 1

(a) Setup constraint: Tclktcq+tlogic,max+tsuT_{clk} \ge t_{cq} + t_{logic,\max} + t_{su}. Tclk0.6+4.2+0.3=5.1 nsT_{clk} \ge 0.6 + 4.2 + 0.3 = 5.1\text{ ns}. (2) fmax=1/5.1 ns=196.1 MHzf_{\max} = 1/5.1\text{ ns} = 196.1\text{ MHz}. (2)

(b) Positive skew (capture later) relaxes setup: Tclktcq+tlogic,max+tsutskew=5.10.5=4.6 nsT_{clk} \ge t_{cq}+t_{logic,\max}+t_{su}-t_{skew} = 5.1 - 0.5 = 4.6\text{ ns}. (2) fmax=1/4.6 ns=217.4 MHzf_{\max} = 1/4.6\text{ ns} = 217.4\text{ MHz}. Frequency increases because the capture edge has more time to wait for data. (2)

(c) Hold constraint: tcq+tlogic,minth+tskewt_{cq}+t_{logic,\min} \ge t_h + t_{skew}.

  • tskew=0t_{skew}=0: 0.6+0.5=1.10.40.6+0.5 = 1.1 \ge 0.4 ✓ no violation. (2)
  • tskew=+0.5t_{skew}=+0.5: need 1.10.4+0.5=0.91.1 \ge 0.4+0.5 = 0.9 ✓ still holds (margin 0.2 ns). (2)

(d) Positive skew gives the setup path extra time (capture edge later ⇒ longer effective period), but the same delayed capture edge means new data can arrive too soon relative to the still-required hold window, eroding hold margin. (2)


Question 2

(a) JK characteristic: Q+=JQˉ+KˉQQ^+ = J\bar{Q} + \bar{K}Q. T characteristic: Q+=TQQ^+ = T \oplus Q, so T=Q+QT = Q^+ \oplus Q. (2) Substitute: T=(JQˉ+KˉQ)QT = (J\bar{Q}+\bar{K}Q) \oplus Q. Evaluate by cases: when Q=0Q=0, Q+=JQ^+=J, so T=JT = J. When Q=1Q=1, Q+=KˉQ^+=\bar K, so T=Kˉ1=KT = \bar K \oplus 1 = K. (2) Thus T=JQˉ+KQ\boxed{T = J\bar{Q} + KQ}. (2)

(b) Table:

J K Q=0 (T=J) Q=1 (T=K) resulting behaviour
0 0 T=0 → hold T=0 → hold hold ✓
0 1 T=0 → 0 T=1 → toggle to 0 reset ✓
1 0 T=1 → toggle to 1 T=0 → hold set ✓
1 1 T=1 → toggle to 1 T=1 → toggle to 0 toggle ✓

All four JK operations reproduced. (4)

(c) T flip-flops directly implement toggling, so ripple/binary counters need no external combinational feedback per stage (T tied to 1 = divide-by-2). (2)


Question 3

State encoding Q2Q1Q0Q_2Q_1Q_0; sequence 0(000)3(011)5(101)6(110)00(000)\to3(011)\to5(101)\to6(110)\to0.

(a) State table:

Present Q2Q1Q0Q_2Q_1Q_0 Next Q2+Q1+Q0+Q_2^+Q_1^+Q_0^+
000 011
011 101
101 110
110 000
001,010,100,111 d d d

(4)

(b) Since Di=Qi+D_i = Q_i^+, fill K-maps over the 4 defined minterms (rest = don't-care).

Defined outputs:

  • 000 → D2D1D0=011D_2D_1D_0 = 0\,1\,1
  • 011 → 1011\,0\,1
  • 101 → 1101\,1\,0
  • 110 → 0000\,0\,0

D2D_2: =1 at states 011,101; =0 at 000,110. A valid minimal cover using don't-cares: D2=Q0D_2 = Q_0 (check: 000→Q0=0=D2✓; 011→Q0=1=1✓; 101→Q0=1=1✓; 110→Q0=0=0✓). (2)

D1D_1: =1 at 000 only; =0 at 011,101,110. D1=Q2ˉQ1ˉQ0ˉD_1 = \bar{Q_2}\,\bar{Q_1}\,\bar{Q_0} works, but using don't-cares simplify: 000 is the only 1. Choose D1=Q2Q0D_1=\overline{Q_2}\,\overline{Q_0} (check: 000→1✓; 011→Q0=1→0✓; 101→Q2=1→0✓; 110→Q0=0,Q2=1→0✓). (3)

D0D_0: =1 at 000,011; =0 at 101,110. D0=Q2D_0 = \overline{Q_2} (check: 000→1✓; 011→1✓; 101→0✓; 110→0✓). (2)

Final: D2=Q0,D1=Q2Q0,D0=Q2D_2=Q_0,\quad D_1=\overline{Q_2}\,\overline{Q_0},\quad D_0=\overline{Q_2}.

(c) Self-start check — trace unused states with these equations:

  • 001: D2=Q0=1,D1=Qˉ2Qˉ0=0,D0=Qˉ2=1101D_2=Q_0=1,D_1=\bar Q_2\bar Q_0=0,D_0=\bar Q_2=1 →101 (in main cycle) ✓
  • 010: D2=0,D1=Qˉ2Qˉ0=1,D0=1011D_2=0,D_1=\bar Q_2\bar Q_0=1,D_0=1 →011
  • 100: D2=0,D1=0,D0=0000D_2=0,D_1=0,D_0=0 →000
  • 111: D2=1,D1=0,D0=0100000D_2=1,D_1=0,D_0=0 →100→000

Every unused state re-enters the main cycle within ≤2 steps; no trapped/hung cycle exists, so the design is self-starting. (3)


Question 4

(a) T200=1/200 MHz=5 nsT_{200} = 1/200\text{ MHz} = 5\text{ ns}. (1) Per stage resolution time tr=T2000.5=4.5 nst_r = T_{200} - 0.5 = 4.5\text{ ns} available for metastability decay. (2)

(b) Two-stage effective resolution time tr,eff=4.5+4.5=9 nst_{r,eff} = 4.5+4.5 = 9\text{ ns}. (1) fc=200 MHz=2×108f_c = 200\text{ MHz}=2\times10^8, fd=25 MHz=2.5×107f_d = 25\text{ MHz}=2.5\times10^7, Tw=0.02 ns=2×1011T_w=0.02\text{ ns}=2\times10^{-11}s, τ=0.15 ns\tau=0.15\text{ ns}. Exponent tr,eff/τ=9/0.15=60t_{r,eff}/\tau = 9/0.15 = 60. (2) MTBF=e60(2×1011)(2×108)(2.5×107)\text{MTBF} = \frac{e^{60}}{(2\times10^{-11})(2\times10^{8})(2.5\times10^{7})} Denominator =2×1011×2×108×2.5×107=1×105= 2\times10^{-11}\times2\times10^{8}\times2.5\times10^{7}=1\times10^{5}. e601.142×1026e^{60}\approx 1.142\times10^{26}. MTBF1.142×1021 s\text{MTBF} \approx 1.142\times10^{21}\text{ s} (astronomically safe). (3)

(c) Independent per-bit synchronizers can settle on different clock edges, so bits of a multi-bit word are captured at inconsistent times, giving transient invalid combinations (data incoherence). Correct techniques: gray-code encoding (only one bit changes at a time), or an asynchronous FIFO with handshake / dual-clock FIFO. (3)


Question 5

(a) Moore states (output shown in state):

  • S0 (z=0): reset/no useful prefix
  • S1 (z=0): seen 1
  • S2 (z=0): seen 10
  • S3 (z=1): seen 101

Transitions:

  • S0: x=0→S0, x=1→S1
  • S1: x=0→S2, x=1→S1
  • S2: x=0→S0, x=1→S3
  • S3: x=0→S2, x=1→S1 (overlap: 1 from S3 restarts)

(4)

(b) State table:

State x=0 x=1 z
S0 S0 S1 0
S1 S2 S1 0
S2 S0 S3 0
S3 S2 S1 1

Equivalence: S0 and S3 differ in output (0 vs 1) → not equivalent. S1 and S3 have same transitions (x=0→S2, x=1→S1) but different outputs → not equivalent. No two states share both identical outputs and identical next-state pairs, so no states can be merged; the machine is already minimal (4 states). (4)


[
  {"claim":"Q1a Tmin=5.1ns, fmax≈196.08MHz","code":"Tclk=Rational(6,10)+Rational(42,10)+Rational(3,10); f=1/(Tclk*10**-9); result=(Tclk==Rational(51,10)) and abs(f-196078431)<2000"},
  {"claim":"Q1b with skew 0.5, Tmin=4.6ns, fmax≈217.39MHz","code":"T=Rational(51,10)-Rational(5,10); f=1/(T*10**-9); result=(T==Rational(46,10)) and abs(f-217391304)<3000"},
  {"claim":"Q1c hold holds with skew: 1.1>=0.9","code":"lhs=Rational(6,10)+Rational(5,10); rhs=Rational(4,10)+Rational(5,10); result=(lhs>=rhs)"},
  {"claim":"Q2 T=J*~Q+K*Q reproduces JK char Q+=J~Q+~KQ","code":"from sympy.logic.boolalg import Xor; J,K,Q=symbols('J K Q'); T=(J&~Q)|(K&Q); ok=True; \nfor jv in [0,1]:\n  for kv in [0,1]:\n    for qv in [0,1]:\n      tval=((jv and not qv) or (kv and qv)); qn=tval ^ qv; jkchar=((jv and not qv) or ((not kv) and qv)); ok=ok and (qn==jkchar)\nresult=ok"},
  {"claim":"Q3 next-state eqns reproduce cycle 0->3->5->6->0","code":"def nxt(q2,q1,q0):\n  d2=q0; d1=(1-q2)*(1-q0); d0=1-q2; return (d2,d1,d0)\nseq=[(0,0,0),(0,1,1),(1,0,1),(1,1,0)]; ok=True\nfor i in range(4):\n  ok=ok and nxt(*seq[i])==seq[(i+1)%4]\nresult=ok"},
  {"claim":"Q3 unused states all reach main cycle (self-start)","code":"def nxt(s):\n  q2,q1,q0=s; return (q0,(1-q2)*(1-q0),1-q2)\nmain={(0,0,0),(0,1,1),(1,0,1),(1,1,0)}; ok=True\nfor s in [(0,0,1),(0,1,0),(1,0,0),(1,1,1)]:\n  cur=s; reached=False\n  for _ in range(4):\n    cur=nxt(cur)\n    if cur in main: reached=True; break\n  ok=ok and reached\nresult=ok"},
  {"claim":"Q4 MTBF denominator=1e5 and exponent=60","code":"Tw=Rational(2,10**11); fc=2*10**8; fd=Rational(25,10**6)*10**12/10**6; den=Rational(2,10**11)*2*10**8*25*10**6; expo=Rational(9,Rational(15,100)); result=(expo==60) and (den==100000)"}
]