Sequential Circuits
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
- Setup time
- Hold time
- Combinational logic delay: ,
- Clock skew between the launching and capturing flip-flop: (capture clock arrives later than launch clock by this amount).
(a) With zero skew, determine the maximum operating clock frequency. (4)
(b) With (capture edge delayed), recompute the maximum frequency. Explain the direction of the change. (4)
(c) Check the hold constraint for both and . 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 input as a Boolean function of , , and current output . Show the derivation using the JK characteristic behaviour. (6)
(b) Using your result, tabulate for all four combinations for both and , 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 (a mod-4 sequence over 3 output bits ), 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 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
- Settling window
- Clock-to-Q + setup overhead consuming 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 where is resolution time, the sampling clock frequency, the data toggle rate (). 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 , asserting output in the state reached after a valid pattern.
(a) Draw the state diagram (list states, transitions on , 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: . . (2) . (2)
(b) Positive skew (capture later) relaxes setup: . (2) . Frequency increases because the capture edge has more time to wait for data. (2)
(c) Hold constraint: .
- : ✓ no violation. (2)
- : need ✓ 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: . T characteristic: , so . (2) Substitute: . Evaluate by cases: when , , so . When , , so . (2) Thus . (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 ; sequence .
(a) State table:
| Present | Next |
|---|---|
| 000 | 011 |
| 011 | 101 |
| 101 | 110 |
| 110 | 000 |
| 001,010,100,111 | d d d |
(4)
(b) Since , fill K-maps over the 4 defined minterms (rest = don't-care).
Defined outputs:
- 000 →
- 011 →
- 101 →
- 110 →
: =1 at states 011,101; =0 at 000,110. A valid minimal cover using don't-cares: (check: 000→Q0=0=D2✓; 011→Q0=1=1✓; 101→Q0=1=1✓; 110→Q0=0=0✓). (2)
: =1 at 000 only; =0 at 011,101,110. works, but using don't-cares simplify: 000 is the only 1. Choose (check: 000→1✓; 011→Q0=1→0✓; 101→Q2=1→0✓; 110→Q0=0,Q2=1→0✓). (3)
: =1 at 000,011; =0 at 101,110. (check: 000→1✓; 011→1✓; 101→0✓; 110→0✓). (2)
Final: .
(c) Self-start check — trace unused states with these equations:
- 001: (in main cycle) ✓
- 010: ✓
- 100: ✓
- 111: ✓
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) . (1) Per stage resolution time available for metastability decay. (2)
(b) Two-stage effective resolution time . (1) , , s, . Exponent . (2) Denominator . . (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:
1from 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)"}
]