Level 2 — RecallSequential Circuits

Sequential Circuits

30 minutes40 marksprintable — key stays hidden on paper

Subject: Hardware
Chapter: 3.4 Sequential Circuits
Difficulty: Level 2 — Recall / Standard Problems
Time Limit: 30 minutes
Total Marks: 40


Instructions: Answer all questions. Show working for derivations. Use ...... notation for logic expressions where needed.


Q1. (3 marks) Define the SR latch. State the input combination that is forbidden for a NOR-based SR latch and explain briefly why.

Q2. (4 marks) Complete the characteristic table for a D latch (gated, active-high enable). Give the output QnextQ_{next} for enable E=1E=1 and for E=0E=0, in terms of DD and the current state QQ.

Q3. (4 marks) State the characteristic equations of the following flip-flops: (a) JK flip-flop (b) T flip-flop (c) D flip-flop

Q4. (5 marks) Explain the difference between setup time and hold time of an edge-triggered D flip-flop. Given a flip-flop with setup time tsu=0.3 nst_{su}=0.3\text{ ns}, clock-to-Q delay tcq=0.4 nst_{cq}=0.4\text{ ns}, and combinational logic delay tlogic=2.1 nst_{logic}=2.1\text{ ns}, compute the maximum clock frequency of the circuit (ignore skew).

Q5. (4 marks) Distinguish between a synchronous counter and an asynchronous (ripple) counter. State one advantage of each.

Q6. (5 marks) A 4-bit Johnson counter and a 4-bit ring counter are both initialised appropriately. (a) State the number of distinct states in each counter's sequence. (2) (b) Write the first four states of a 4-bit Johnson counter starting from 00000000. (3)

Q7. (4 marks) Explain the difference between a Mealy machine and a Moore machine. In which does the output depend only on the current state?

Q8. (5 marks) Design the state table for a T flip-flop-based counter that counts the sequence 012300 \to 1 \to 2 \to 3 \to 0 (2-bit). Give the required T1,T0T_1, T_0 inputs for each present state. (Present state bits Q1Q0Q_1Q_0.)

Q9. (3 marks) Define metastability. State why a two-flip-flop synchroniser is used when crossing a clock domain boundary.

Q10. (3 marks) Define clock skew and clock jitter, distinguishing the two.

Answer keyMark scheme & solutions

Q1. (3 marks)

  • Definition: An SR latch is a bistable memory element with two inputs, Set (S) and Reset (R), that stores one bit; S=1 sets Q=1, R=1 resets Q=0. (1 mark)
  • Forbidden input: For a NOR-based SR latch, S=R=1S=R=1 is forbidden. (1 mark)
  • Why: With both inputs high, both outputs are forced to 0, so QQ and Qˉ\bar Q are no longer complementary; and on releasing both inputs simultaneously the final state is unpredictable (race condition). (1 mark)

Q2. (4 marks)

  • When E=1E=1 (transparent): Qnext=DQ_{next}=D. (2 marks)
  • When E=0E=0 (hold/latched): Qnext=QQ_{next}=Q (retains previous value). (2 marks)
E D QnextQ_{next}
0 X QQ (hold)
1 0 0
1 1 1

Q3. (4 marks)

  • (a) JK: Qnext=JQˉ+KˉQQ_{next}=J\bar Q + \bar K Q. (2 marks)
  • (b) T: Qnext=TQ=TQˉ+TˉQQ_{next}=T\oplus Q = T\bar Q + \bar T Q. (1 mark)
  • (c) D: Qnext=DQ_{next}=D. (1 mark)

Q4. (5 marks)

  • Setup time tsut_{su}: minimum time the data input must be stable before the active clock edge. (1 mark)
  • Hold time tht_h: minimum time the data input must remain stable after the active clock edge. (1 mark)
  • Max frequency: The clock period must satisfy Ttcq+tlogic+tsu=0.4+2.1+0.3=2.8 ns.T \ge t_{cq}+t_{logic}+t_{su}=0.4+2.1+0.3=2.8\text{ ns}. (2 marks)
  • fmax=1/T=1/2.8 ns357.1 MHz.f_{max}=1/T = 1/2.8\text{ ns}\approx 357.1\text{ MHz}. (1 mark)

Q5. (4 marks)

  • Synchronous: all flip-flops share a common clock; they change state simultaneously. (1 mark)
  • Asynchronous (ripple): clock of each stage is driven by the output of the previous stage; state changes ripple through. (1 mark)
  • Advantage of synchronous: no cumulative propagation delay → faster, glitch-free, higher max frequency. (1 mark)
  • Advantage of asynchronous: simpler circuit, fewer gates, lower power/hardware cost. (1 mark)

Q6. (5 marks)

  • (a) 4-bit ring counter: 4 distinct states. 4-bit Johnson counter: 8 distinct states (2n2n). (2 marks: 1 each)
  • (b) Johnson counter from 00000000 (shift with inverted feedback): (3 marks)
    • 00001000110011100000 \to 1000 \to 1100 \to 1110

Q7. (4 marks)

  • Mealy machine: output depends on both the current state and the current inputs. (1.5 marks)
  • Moore machine: output depends only on the current state. (1.5 marks)
  • The Moore machine is the one whose output depends only on the current state. (1 mark)

Q8. (5 marks) For a T flip-flop, T=QnextQpresentT = Q_{next}\oplus Q_{present}. Counting 012300\to1\to2\to3\to0:

Q1Q0Q_1Q_0 Next Q1Q0Q_1Q_0 T1T_1 T0T_0
00 01 0 1
01 10 1 1
10 11 0 1
11 00 1 1

(3 marks for correct table)

  • T0=1T_0=1 always (LSB toggles every count). (1 mark)
  • T1=Q0T_1=Q_0 (MSB toggles when LSB is 1). (1 mark)

Q9. (3 marks)

  • Metastability: an unstable intermediate condition where a flip-flop's output hovers between valid logic 0 and 1 for an unbounded time, occurring when setup/hold timing is violated (e.g., asynchronous input). (2 marks)
  • Two-FF synchroniser: the first flip-flop may go metastable, but the extra clock period before the second flip-flop samples gives the metastable state time to resolve, greatly reducing the probability of propagating an invalid value downstream. (1 mark)

Q10. (3 marks)

  • Clock skew: the spatial difference in clock arrival time at different flip-flops caused by unequal routing/distribution paths (a fixed/static offset). (1.5 marks)
  • Clock jitter: the temporal variation of the clock edge from its ideal position from cycle to cycle (a random/dynamic timing uncertainty). (1.5 marks)

[
  {"claim":"Min clock period is 2.8 ns", "code":"tcq=Rational(4,10); tlogic=Rational(21,10); tsu=Rational(3,10); T=tcq+tlogic+tsu; result = (T == Rational(28,10))"},
  {"claim":"f_max approx 357.1 MHz", "code":"T=Rational(28,10); f=1/(T*10**-9); result = (round(f/10**6,1)==357.1)"},
  {"claim":"Johnson counter 4-bit has 8 states, ring has 4", "code":"n=4; result = (2*n==8 and n==4)"},
  {"claim":"T flip-flop inputs: T0 always 1, T1 = Q0 for 2-bit up counter", "code":"states=[(0,0),(0,1),(1,0),(1,1)]; ok=True\nfor i,(q1,q0) in enumerate(states):\n    n1,n0=states[(i+1)%4]\n    T1=q1^n1; T0=q0^n0\n    if T0!=1 or T1!=q0: ok=False\nresult = ok"}
]