Skip to main content

Chapter 9 · 8 hours

Sequential Machines

IOE past exam questions

Past questions and answers

28 questions set from this chapter, 5 of them more than once. Most asked first.

  • Asked 3 times
  • 2081 Bhadra · 12 marks
  • 2080 Baisakh · 10 marks
  • 2074 Chaitra · 10 marks

Design a sequential machine that produces output Y = 1 when it detects the serial message X = 110 using JK flip-flop.

Answer

The machine has one serial input X and one output Y. Y = 1 when the last three bits received are 1, 1, 0.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 3 bits, 3 states are needed, so 2 JK flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 4 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Y (X=0)Y (X=1)
Areset / no useful bitsAB00
B"1" receivedAC00
C"11" receivedAC10

Step 2: State diagram

 Main path (label = X/Y):
 A -1/0-> B -1/0-> C -0/1-> A
 Other transitions:
 A -0/0-> A    B -0/0-> A
 C -1/0-> C

Step 3: State assignment

StateABC
Q1 Q00 00 11 0

Code 11 is unused and is treated as a don't care.

Step 4: Excitation table

JK excitation: 0→0: J=0, K=X; 0→1: J=1, K=X; 1→0: J=X, K=1; 1→1: J=X, K=0.

Q1 Q0XQ1+ Q0+J1K1J0K0Y
0 000 00X0X0
0 010 10X1X0
0 100 00XX10
0 111 01XX10
1 000 0X10X1
1 011 0X00X0

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

J1: Q1 / Q0X00011110
00010
1XXXX
K1: Q1 / Q0X00011110
0XXXX
110XX
J0: Q1 / Q0X00011110
001XX
100XX
K0: Q1 / Q0X00011110
0XX11
1XXXX
Y: Q1 / Q0X00011110
00000
110XX

Step 6: Equations

J1=Q0X,K1=X‾J0=Q1‾X,K0=1Y=Q1X‾\begin{aligned} &J_1 = Q_0X,\quad K_1 = \overline{X} \\ &J_0 = \overline{Q_1}X,\quad K_0 = 1 \\ &Y = Q_1\overline{X} \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
J0>|J   Q|-Q0 J1>|J   Q|-Q1
   | FF0 |       | FF1 |
K0>|K    |    K1>|K    |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
J1 = Q0.X   K1 = X'
J0 = Q1'.X   K0 = 1
Y = Q1.X'

The gates for each flip-flop input are built from the equations; the output gate gives Y directly (Mealy output).

Unused state 11: with the equations above, from 11 the machine goes to 00 when X = 0 and to 10 when X = 1, so it enters the valid states after one clock. Since Y can be 1 from state 11 for one clock, the flip-flops should be cleared to 00 at power-on (reset).

Check with an input stream

X0110111010
StateAABCABCCAB
Y0001000100

Y = 1 appears exactly on the clock in which the last bit of 110 arrives; overlapping sequences are also detected.

  • Asked 2 times
  • 2081 Bhadra · 12 marks
  • 2076 Asoj

Design a sequential machine that consists of a single input, X and the single output, Z. The machine is required to give output high when input contains serial message 1101 sequence. Use SR flip-flops only.

Answer

The machine has one serial input X and one output Z. Z = 1 when the last four bits received are 1, 1, 0, 1. Only SR flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 SR flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 5 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Z (X=0)Z (X=1)
Areset / no useful bitsAB00
B"1" receivedAC00
C"11" receivedDC00
D"110" receivedAB01

Step 2: State diagram

 Main path (label = X/Z):
 A -1/0-> B -1/0-> C -0/0-> D -1/1-> B
 Other transitions:
 A -0/0-> A    B -0/0-> A
 C -1/0-> C    D -0/0-> A

Step 3: State assignment

StateABCD
Q1 Q00 00 11 01 1

Step 4: Excitation table

SR excitation: 0→0: S=0, R=X; 0→1: S=1, R=0; 1→0: S=0, R=1; 1→1: S=X, R=0.

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 00X0X0
0 010 10X100
0 100 00X010
0 111 010010
1 001 1X0100
1 011 0X00X0
1 100 001010
1 110 101X01

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

S1: Q1 / Q0X00011110
00010
1XX00
R1: Q1 / Q0X00011110
0XX0X
10011
S0: Q1 / Q0X00011110
00100
110X0
R0: Q1 / Q0X00011110
0X011
10X01
Z: Q1 / Q0X00011110
00000
10010

Step 6: Equations

S1=Q1‾Q0X,R1=Q1Q0S0=Q1Q0‾X‾+Q1‾Q0‾X,R0=Q1‾Q0+Q0X‾Z=Q1Q0X\begin{aligned} &S_1 = \overline{Q_1}Q_0X,\quad R_1 = Q_1Q_0 \\ &S_0 = Q_1\overline{Q_0}\overline{X} + \overline{Q_1}\overline{Q_0}X,\quad R_0 = \overline{Q_1}Q_0 + Q_0\overline{X} \\ &Z = Q_1Q_0X \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
S0>|S   Q|-Q0 S1>|S   Q|-Q1
   | FF0 |       | FF1 |
R0>|R    |    R1>|R    |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
S1 = Q1'.Q0.X   R1 = Q1.Q0
S0 = Q1.Q0'.X' + Q1'.Q0'.X   R0 = Q1'.Q0 + Q0.X'
Z = Q1.Q0.X

The gates for each flip-flop input are built from the equations; the output gate gives Z directly (Mealy output).

Check with an input stream

X0110110100
StateAABCDBCDBA
Z0000100100

Z = 1 appears exactly on the clock in which the last bit of 1101 arrives; overlapping sequences are also detected.

  • Asked 2 times
  • 2080 Baisakh · 13 marks
  • 2076 Chaitra · 10 marks

Consider a sequential detector that receives binary data stream at its input 'X' and signals when a serial sequence '1011' arrives at the input by making its output 'Y' high, otherwise output remains low. Design a sequence detector state machine using positive edge triggered T flip flops.

Answer

The detector watches the serial data stream X and makes Y = 1 when the last four bits received are 1, 0, 1, 1; otherwise Y = 0. Positive-edge triggered T flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 T flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 5 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Y (X=0)Y (X=1)
Areset / no useful bitsAB00
B"1" receivedCB00
C"10" receivedAD00
D"101" receivedCB01

Step 2: State diagram

 Main path (label = X/Y):
 A -1/0-> B -0/0-> C -1/0-> D -1/1-> B
 Other transitions:
 A -0/0-> A    B -1/0-> B
 C -0/0-> A    D -0/0-> C

Step 3: State assignment

StateABCD
Q1 Q00 00 11 01 1

Step 4: Excitation table

T excitation: T = 1 when the flip-flop must change, T = 0 when it must hold (T=Q⊕Q+T = Q \oplus Q^+).

Q1 Q0XQ1+ Q0+T1T0Y
0 000 0000
0 010 1010
0 101 0110
0 110 1000
1 000 0100
1 011 1010
1 101 0010
1 110 1101

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

T1: Q1 / Q0X00011110
00001
11010
T0: Q1 / Q0X00011110
00101
10101
Y: Q1 / Q0X00011110
00000
10010

Step 6: Equations

T1=Q1Q0X+Q1Q0‾X‾+Q1‾Q0X‾T0=Q0X‾+Q0‾XY=Q1Q0X\begin{aligned} &T_1 = Q_1Q_0X + Q_1\overline{Q_0}\overline{X} + \overline{Q_1}Q_0\overline{X} \\ &T_0 = Q_0\overline{X} + \overline{Q_0}X \\ &Y = Q_1Q_0X \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
T0>|T   Q|-Q0 T1>|T   Q|-Q1
   | FF0 |       | FF1 |
   |     |       |     |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
T1 = Q1.Q0.X + Q1.Q0'.X' + Q1'.Q0.X'
T0 = Q0.X' + Q0'.X
Y = Q1.Q0.X

The gates for each flip-flop input are built from the equations; the output gate gives Y directly (Mealy output).

Check with an input stream

X0101101101
StateAABCDBCDBC
Y0000100100

Y = 1 appears exactly on the clock in which the last bit of 1011 arrives; overlapping sequences are also detected.

Note: T0=Q0⊕XT_0 = Q_0 \oplus X, so FF0 needs only one XOR gate.

  • Asked 2 times
  • 2079 Bhadra · 12 marks
  • 2068 Chaitra · 12 marks

Design a sequential machine that has one serial input X and output Z. The machine is required to have an output Z = 1 when the input X contains the serial message 1010.

Answer

The machine has one serial input X and one output Z; Z = 1 when the last four bits received are 1, 0, 1, 0. Since no flip-flop type is specified, JK flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 JK flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 5 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Z (X=0)Z (X=1)
Areset / no useful bitsAB00
B"1" receivedCB00
C"10" receivedAD00
D"101" receivedCB10

Step 2: State diagram

 Main path (label = X/Z):
 A -1/0-> B -0/0-> C -1/0-> D -0/1-> C
 Other transitions:
 A -0/0-> A    B -1/0-> B
 C -0/0-> A    D -1/0-> B

Step 3: State assignment

StateABCD
Q1 Q00 00 11 01 1

Step 4: Excitation table

JK excitation: 0→0: J=0, K=X; 0→1: J=1, K=X; 1→0: J=X, K=1; 1→1: J=X, K=0.

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 00X0X0
0 010 10X1X0
0 101 01XX10
0 110 10XX00
1 000 0X10X0
1 011 1X01X0
1 101 0X0X11
1 110 1X1X00

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

J1: Q1 / Q0X00011110
00001
1XXXX
K1: Q1 / Q0X00011110
0XXXX
11010
J0: Q1 / Q0X00011110
001XX
101XX
K0: Q1 / Q0X00011110
0XX01
1XX01
Z: Q1 / Q0X00011110
00000
10001

Step 6: Equations

J1=Q0X‾,K1=Q0X+Q0‾X‾J0=X,K0=X‾Z=Q1Q0X‾\begin{aligned} &J_1 = Q_0\overline{X},\quad K_1 = Q_0X + \overline{Q_0}\overline{X} \\ &J_0 = X,\quad K_0 = \overline{X} \\ &Z = Q_1Q_0\overline{X} \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
J0>|J   Q|-Q0 J1>|J   Q|-Q1
   | FF0 |       | FF1 |
K0>|K    |    K1>|K    |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
J1 = Q0.X'   K1 = Q0.X + Q0'.X'
J0 = X   K0 = X'
Z = Q1.Q0.X'

The gates for each flip-flop input are built from the equations; the output gate gives Z directly (Mealy output).

Check with an input stream

X0101010100
StateAABCDCDCDC
Z0000101010

Z = 1 appears exactly on the clock in which the last bit of 1010 arrives; overlapping sequences are also detected.

Note: K1=Q0⊕X‾K_1 = \overline{Q_0 \oplus X} (an XNOR gate), and FF0 simply follows the input (J0=XJ_0 = X, K0=X‾K_0 = \overline{X}).

  • Asked 2 times
  • 2075 Chaitra · 10 marks
  • 2073 Shrawan · 12 marks

Design a sequential machine that detects 101 from input stream X by making Y is 1. Using J-K flip-flop.

Answer

The machine watches the serial input X and makes Y = 1 when the last three bits received are 1, 0, 1.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 3 bits, 3 states are needed, so 2 JK flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 4 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Y (X=0)Y (X=1)
Areset / no useful bitsAB00
B"1" receivedCB00
C"10" receivedAB01

Step 2: State diagram

 Main path (label = X/Y):
 A -1/0-> B -0/0-> C -1/1-> B
 Other transitions:
 A -0/0-> A    B -1/0-> B
 C -0/0-> A

Step 3: State assignment

StateABC
Q1 Q00 00 11 0

Code 11 is unused and is treated as a don't care.

Step 4: Excitation table

JK excitation: 0→0: J=0, K=X; 0→1: J=1, K=X; 1→0: J=X, K=1; 1→1: J=X, K=0.

Q1 Q0XQ1+ Q0+J1K1J0K0Y
0 000 00X0X0
0 010 10X1X0
0 101 01XX10
0 110 10XX00
1 000 0X10X0
1 010 1X11X1

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

J1: Q1 / Q0X00011110
00001
1XXXX
K1: Q1 / Q0X00011110
0XXXX
111XX
J0: Q1 / Q0X00011110
001XX
101XX
K0: Q1 / Q0X00011110
0XX01
1XXXX
Y: Q1 / Q0X00011110
00000
101XX

Step 6: Equations

J1=Q0X‾,K1=1J0=X,K0=X‾Y=Q1X\begin{aligned} &J_1 = Q_0\overline{X},\quad K_1 = 1 \\ &J_0 = X,\quad K_0 = \overline{X} \\ &Y = Q_1X \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
J0>|J   Q|-Q0 J1>|J   Q|-Q1
   | FF0 |       | FF1 |
K0>|K    |    K1>|K    |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
J1 = Q0.X'   K1 = 1
J0 = X   K0 = X'
Y = Q1.X

The gates for each flip-flop input are built from the equations; the output gate gives Y directly (Mealy output).

Unused state 11: with the equations above, from 11 the machine goes to 00 when X = 0 and to 01 when X = 1, so it enters the valid states after one clock. Since Y can be 1 from state 11 for one clock, the flip-flops should be cleared to 00 at power-on (reset).

Check with an input stream

X0101011010
StateAABCBCBBCB
Y0001010010

Y = 1 appears exactly on the clock in which the last bit of 101 arrives; overlapping sequences are also detected.

  • 2081 Baisakh · 12 marks

Design a sequential machine that has a single input 'x' and single output 'y'. The machine is required to give high output (y=1) when it detects the serial sequence of x = 1101 message. Use T flip-flops only.

Answer

The machine has a single input x and a single output y; y = 1 when the last four bits received are 1, 1, 0, 1. Only T flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 T flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 5 states.)

Step 1: States

Present stateMeaningNext (x=0)Next (x=1)y (x=0)y (x=1)
Areset / no useful bitsAB00
B"1" receivedAC00
C"11" receivedDC00
D"110" receivedAB01

Step 2: State diagram

 Main path (label = x/y):
 A -1/0-> B -1/0-> C -0/0-> D -1/1-> B
 Other transitions:
 A -0/0-> A    B -0/0-> A
 C -1/0-> C    D -0/0-> A

Step 3: State assignment

StateABCD
Q1 Q00 00 11 01 1

Step 4: Excitation table

T excitation: T = 1 when the flip-flop must change, T = 0 when it must hold (T=Q⊕Q+T = Q \oplus Q^+).

Q1 Q0xQ1+ Q0+T1T0y
0 000 0000
0 010 1010
0 100 0010
0 111 0110
1 001 1010
1 011 0000
1 100 0110
1 110 1101

Step 5: K-maps (rows Q1Q_1, columns Q0xQ_0x)

T1: Q1 / Q0x00011110
00010
10011
T0: Q1 / Q0x00011110
00111
11001
y: Q1 / Q0x00011110
00000
10010

Step 6: Equations

T1=Q1Q0+Q0xT0=Q1x‾+Q1‾x+Q0x‾y=Q1Q0x\begin{aligned} &T_1 = Q_1Q_0 + Q_0x \\ &T_0 = Q_1\overline{x} + \overline{Q_1}x + Q_0\overline{x} \\ &y = Q_1Q_0x \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
T0>|T   Q|-Q0 T1>|T   Q|-Q1
   | FF0 |       | FF1 |
   |     |       |     |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
x = serial input, common to the gates
T1 = Q1.Q0 + Q0.x
T0 = Q1.x' + Q1'.x + Q0.x'
y = Q1.Q0.x

The gates for each flip-flop input are built from the equations; the output gate gives y directly (Mealy output).

Check with an input stream

x1101101100
StateABCDBCDBCD
y0001001000

y = 1 appears exactly on the clock in which the last bit of 1101 arrives; overlapping sequences are also detected.

  • 2080 Bhadra · 10 marks

Design a sequential machine that has one serial input X and one output Z. The machine is required to give an output Z = 1, when the serial input X contains the message 1010. Use T flip-flop.

Answer

The machine has one serial input X and one output Z; Z = 1 when the last four bits received are 1, 0, 1, 0. T flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 T flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 5 states.)

Step 1: States

Present stateMeaningNext (X=0)Next (X=1)Z (X=0)Z (X=1)
Areset / no useful bitsAB00
B"1" receivedCB00
C"10" receivedAD00
D"101" receivedCB10

Step 2: State diagram

 Main path (label = X/Z):
 A -1/0-> B -0/0-> C -1/0-> D -0/1-> C
 Other transitions:
 A -0/0-> A    B -1/0-> B
 C -0/0-> A    D -1/0-> B

Step 3: State assignment

StateABCD
Q1 Q00 00 11 01 1

Step 4: Excitation table

T excitation: T = 1 when the flip-flop must change, T = 0 when it must hold (T=Q⊕Q+T = Q \oplus Q^+).

Q1 Q0XQ1+ Q0+T1T0Z
0 000 0000
0 010 1010
0 101 0110
0 110 1000
1 000 0100
1 011 1010
1 101 0011
1 110 1100

Step 5: K-maps (rows Q1Q_1, columns Q0XQ_0X)

T1: Q1 / Q0X00011110
00001
11010
T0: Q1 / Q0X00011110
00101
10101
Z: Q1 / Q0X00011110
00000
10001

Step 6: Equations

T1=Q1Q0X+Q1Q0‾X‾+Q1‾Q0X‾T0=Q0X‾+Q0‾XZ=Q1Q0X‾\begin{aligned} &T_1 = Q_1Q_0X + Q_1\overline{Q_0}\overline{X} + \overline{Q_1}Q_0\overline{X} \\ &T_0 = Q_0\overline{X} + \overline{Q_0}X \\ &Z = Q_1Q_0\overline{X} \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
T0>|T   Q|-Q0 T1>|T   Q|-Q1
   | FF0 |       | FF1 |
   |     |       |     |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
X = serial input, common to the gates
T1 = Q1.Q0.X + Q1.Q0'.X' + Q1'.Q0.X'
T0 = Q0.X' + Q0'.X
Z = Q1.Q0.X'

The gates for each flip-flop input are built from the equations; the output gate gives Z directly (Mealy output).

Check with an input stream

X1010100101
StateABCDCDCABC
Z0001010000

Z = 1 appears exactly on the clock in which the last bit of 1010 arrives; overlapping sequences are also detected.

Note: T0=Q0⊕XT_0 = Q_0 \oplus X, so FF0 needs only one XOR gate.

  • 2079 Baisakh · 12 marks

Design a sequential machine that has a single input 'x' and single output 'z'. The machine is required to give high output when it detects the serial sequence of 001 message. Use JK flip-flops only.

Answer

The machine has a single input x and a single output z; z = 1 when the last three bits received are 0, 0, 1. Only JK flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 3 bits, 3 states are needed, so 2 JK flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 4 states.)

Step 1: States

Present stateMeaningNext (x=0)Next (x=1)z (x=0)z (x=1)
Areset / no useful bitsBA00
B"0" receivedCA00
C"00" receivedCA01

Step 2: State diagram

 Main path (label = x/z):
 A -0/0-> B -0/0-> C -1/1-> A
 Other transitions:
 A -1/0-> A    B -1/0-> A
 C -0/0-> C

Step 3: State assignment

StateABC
Q1 Q00 00 11 0

Code 11 is unused and is treated as a don't care.

Step 4: Excitation table

JK excitation: 0→0: J=0, K=X; 0→1: J=1, K=X; 1→0: J=X, K=1; 1→1: J=X, K=0.

Q1 Q0xQ1+ Q0+J1K1J0K0z
0 000 10X1X0
0 010 00X0X0
0 101 01XX10
0 110 00XX10
1 001 0X00X0
1 010 0X10X1

Step 5: K-maps (rows Q1Q_1, columns Q0xQ_0x)

J1: Q1 / Q0x00011110
00001
1XXXX
K1: Q1 / Q0x00011110
0XXXX
101XX
J0: Q1 / Q0x00011110
010XX
100XX
K0: Q1 / Q0x00011110
0XX11
1XXXX
z: Q1 / Q0x00011110
00000
101XX

Step 6: Equations

J1=Q0x‾,K1=xJ0=Q1‾x‾,K0=1z=Q1x\begin{aligned} &J_1 = Q_0\overline{x},\quad K_1 = x \\ &J_0 = \overline{Q_1}\overline{x},\quad K_0 = 1 \\ &z = Q_1x \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
J0>|J   Q|-Q0 J1>|J   Q|-Q1
   | FF0 |       | FF1 |
K0>|K    |    K1>|K    |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
x = serial input, common to the gates
J1 = Q0.x'   K1 = x
J0 = Q1'.x'   K0 = 1
z = Q1.x

The gates for each flip-flop input are built from the equations; the output gate gives z directly (Mealy output).

Unused state 11: with the equations above, from 11 the machine goes to 10 when x = 0 and to 00 when x = 1, so it enters the valid states after one clock. Since z can be 1 from state 11 for one clock, the flip-flops should be cleared to 00 at power-on (reset).

Check with an input stream

x0010010001
StateABCABCABCC
z0010010001

z = 1 appears exactly on the clock in which the last bit of 001 arrives; overlapping sequences are also detected.

  • 2078 Kartik · 12 marks

A sequential machine which has one input, A and one output, Y. The machine is required to give the output high when the input contains a serial message of 1001, use only D flip-flops for realizing the design.

Answer

The machine has one input A and one output Y; Y = 1 when the last four bits received on A are 1, 0, 0, 1. Only D flip-flops are used.

A Mealy machine is used (output depends on the present state and the present input), and overlapping sequences are detected. Since the sequence has 4 bits, 4 states are needed, so 2 D flip-flops (Q1Q0Q_1Q_0) are used, clocked on the positive edge. (A Moore machine would need 5 states.)

Step 1: States

Present stateMeaningNext (A=0)Next (A=1)Y (A=0)Y (A=1)
S0reset / no useful bitsS0S100
S1"1" receivedS2S100
S2"10" receivedS3S100
S3"100" receivedS0S101

Step 2: State diagram

 Main path (label = A/Y):
 S0 -1/0-> S1 -0/0-> S2 -0/0-> S3 -1/1-> S1
 Other transitions:
 S0 -0/0-> S0    S1 -1/0-> S1
 S2 -1/0-> S1    S3 -0/0-> S0

Step 3: State assignment

StateS0S1S2S3
Q1 Q00 00 11 01 1

Step 4: Excitation table

D excitation: D=Q+D = Q^+ (D equals the next state).

Q1 Q0AQ1+ Q0+D1D0Y
0 000 0000
0 010 1010
0 101 0100
0 110 1010
1 001 1110
1 010 1010
1 100 0000
1 110 1011

Step 5: K-maps (rows Q1Q_1, columns Q0AQ_0A)

D1: Q1 / Q0A00011110
00001
11000
D0: Q1 / Q0A00011110
00110
11110
Y: Q1 / Q0A00011110
00000
10010

Step 6: Equations

D1=Q1Q0‾A‾+Q1‾Q0A‾D0=Q1Q0‾+AY=Q1Q0A\begin{aligned} &D_1 = Q_1\overline{Q_0}\overline{A} + \overline{Q_1}Q_0\overline{A} \\ &D_0 = Q_1\overline{Q_0} + A \\ &Y = Q_1Q_0A \end{aligned}

Step 7: Logic diagram

   +-----+       +-----+
D0>|D   Q|-Q0 D1>|D   Q|-Q1
   | FF0 |       | FF1 |
   |     |       |     |
   +--^--+       +--^--+
      |             |
CLK---+-------------+
A = serial input, common to the gates
D1 = Q1.Q0'.A' + Q1'.Q0.A'
D0 = Q1.Q0' + A
Y = Q1.Q0.A

The gates for each flip-flop input are built from the equations; the output gate gives Y directly (Mealy output).

Check with an input stream

A1001001100
StateS0S1S2S3S1S2S3S1S1S2
Y0001001000

Y = 1 appears exactly on the clock in which the last bit of 1001 arrives; overlapping sequences are also detected.

Note: D1=A‾ (Q1⊕Q0)D_1 = \overline{A}\,(Q_1 \oplus Q_0), so FF1 needs one XOR and one AND gate.

  • 2078 Bhadra · 10 marks

Design a sequential machine that has one serial input X and one output Z. The machine is required to give an output z = 1 when the input X contains the message 1001. Use S-R flip-flop.

Answer

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 1001 arrives. Flip-flops: S-R.

States (what has been received so far):

  • A: reset / no useful bits
  • B: "1" received
  • C: "10" received
  • D: "100" received

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --0/0--> C --0/0--> D --1/1--> B

 A --0/0--> A  (self loop)
 B --1/0--> B  (self loop)
 C --1/0--> B
 D --0/0--> A

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BCB00
CDB00
DAB01

State assignment

A = 00, B = 01, C = 10, D = 11 (flip-flop outputs Q1Q0Q_1 Q_0).

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 00x0x0
0 010 10x100
0 101 010010
0 110 10xx00
1 001 1x0100
1 010 101100
1 100 001010
1 110 101x01

K-maps and simplified equations

S1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       1    0
Q1Q0=11       0    0
Q1Q0=10       x    0

R1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       0    x
Q1Q0=11       1    1
Q1Q0=10       0    1

S0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       0    x
Q1Q0=11       0    x
Q1Q0=10       1    1

R0          X=0  X=1
Q1Q0=00       x    0
Q1Q0=01       1    0
Q1Q0=11       1    0
Q1Q0=10       0    0

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       0    1
Q1Q0=10       0    0
S1=Q1′Q0X′R1=Q1Q0+XS0=Q1Q0′+XR0=Q0X′Z=Q1Q0X\begin{aligned} S_1 &= Q_1' Q_0 X' \\ R_1 &= Q_1 Q_0 + X \\ S_0 &= Q_1 Q_0' + X \\ R_0 &= Q_0 X' \\ Z &= Q_1 Q_0 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 3-input AND for Q1′Q0X′Q_1' Q_0 X'.
  • R1R_1: a 2-input AND for Q1Q0Q_1 Q_0; direct line XX, combined in a 2-input OR gate.
  • S0S_0: a 2-input AND for Q1Q0′Q_1 Q_0'; direct line XX, combined in a 2-input OR gate.
  • R0R_0: a 2-input AND for Q0X′Q_0 X'.
  • ZZ: a 3-input AND for Q1Q0XQ_1 Q_0 X.

Check: input X = 01001001 gives Z = 00001001; Z = 1 at the 5th and 8th bits, so overlapping 1001s are both detected.

  • 2076 Asoj · 12 marks

Design a sequential machine with one input x and one output z which gives output z=1 when serial input contains 1011 message. Use J-K flip-flop.

Answer

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 1011 arrives. Flip-flops: J-K.

States (what has been received so far):

  • A: reset / no useful bits
  • B: "1" received
  • C: "10" received
  • D: "101" received

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --0/0--> C --1/0--> D --1/1--> B

 A --0/0--> A  (self loop)
 B --1/0--> B  (self loop)
 C --0/0--> A
 D --0/0--> C

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BCB00
CAD00
DCB01

State assignment

A = 00, B = 01, C = 10, D = 11 (flip-flop outputs Q1Q0Q_1 Q_0).

Excitation table of J-K flip-flop

QQ+JK
000x
011x
10x1
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 00x0x0
0 010 10x1x0
0 101 01xx10
0 110 10xx00
1 000 0x10x0
1 011 1x01x0
1 101 0x0x10
1 110 1x1x01

K-maps and simplified equations

J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       x    x

K1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    x
Q1Q0=11       0    1
Q1Q0=10       1    0

J0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       0    1

K0          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       1    0
Q1Q0=11       1    0
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       0    1
Q1Q0=10       0    0
J1=Q0X′K1=Q0X+Q0′X′J0=XK0=X′Z=Q1Q0X\begin{aligned} J_1 &= Q_0 X' \\ K_1 &= Q_0 X + Q_0' X' \\ J_0 &= X \\ K_0 &= X' \\ Z &= Q_1 Q_0 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two J-K flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • J1J_1: a 2-input AND for Q0X′Q_0 X'.
  • K1K_1: a 2-input AND for Q0XQ_0 X; a 2-input AND for Q0′X′Q_0' X', combined in a 2-input OR gate.
  • J0J_0: direct line XX.
  • K0K_0: direct line X′X'.
  • ZZ: a 3-input AND for Q1Q0XQ_1 Q_0 X.

Check: input X = 1011011 gives Z = 0001001; Z = 1 at bits 4 and 7 (overlapping 1011011). From D, input 0 gives "1010" whose useful tail is "10", so D goes to C.

  • 2075 Chaitra · 11 marks

Design a synchronous sequential machine such that it gives output Z=1 if input contains the sequence of message 011 and it retains in its own state in other condition giving output zero. Use RS-Flip-Flop.

Answer

The machine stays in its own state when the input does not advance the sequence (A on 1, B on 0), and gives Z = 0 except when 011 is completed.

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 011 arrives. Flip-flops: S-R.

States (what has been received so far):

  • A: reset, or last bit 1 not part of a sequence (stays in A on 1)
  • B: "0" received (stays in B on further 0s)
  • C: "01" received

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --1/0--> C --1/1--> A

 A --1/0--> A  (self loop)
 B --0/0--> B  (self loop)
 C --0/0--> B

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BBC00
CBA01

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state).

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 10x100
0 010 00x0x0
0 100 10xx00
0 111 010010
1 000 101100
1 010 0010x1

K-maps and simplified equations

S1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       0    0

R1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    0
Q1Q0=11       x    x
Q1Q0=10       1    1

S0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       x    0
Q1Q0=11       x    x
Q1Q0=10       1    0

R0          X=0  X=1
Q1Q0=00       0    x
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       0    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    1
S1=Q0XR1=Q0′S0=X′R0=XZ=Q1X\begin{aligned} S_1 &= Q_0 X \\ R_1 &= Q_0' \\ S_0 &= X' \\ R_0 &= X \\ Z &= Q_1 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 2-input AND for Q0XQ_0 X.
  • R1R_1: direct line Q0′Q_0'.
  • S0S_0: direct line X′X'.
  • R0R_0: direct line XX.
  • ZZ: a 2-input AND for Q1XQ_1 X.

Check: input X = 1011011 gives Z = 0001001; Z = 1 at bits 4 and 7.

  • 2075 Asoj · 10 marks

Design a synchronous sequential machine from the state diagram given below. Use S-R Flip-Flop. [Figure: state diagram with three states X, Y, Z, edges labelled input/output: X→X on 0/0; X→Y on 1/0; Y→X on 0/0; Y→Z on 1/0; Z→Z on 1/1; Z→X on 0/0]

Answer

The state diagram is a Mealy diagram with 3 states. To avoid confusion with the state names X, Y, Z, the input is called W and the output F. From the diagram, F = 1 only when the machine is in Z and W = 1, i.e. the machine detects three or more consecutive 1s. Flip-flops: S-R.

State diagram (given)

Arc label = input/output

 X --1/0--> Y --1/0--> Z --1/1--> Z

 X --0/0--> X  (self loop)
 Y --0/0--> X
 Z --0/0--> X

State table

Present stateNext, W=0Next, W=1F (W=0)F (W=1)
XXY00
YXZ00
ZXZ01

State assignment

X = 00, Y = 01, Z = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (W=0 goes to X, W=1 goes to Z), so it is self-starting.

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0WQ1+ Q0+S1R1S0R0F
0 000 00x0x0
0 010 10x100
0 100 00x010
0 111 010010
1 000 0010x0
1 011 0x00x1

K-maps and simplified equations

S1          W=0  W=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       0    x

R1          W=0  W=1
Q1Q0=00       x    x
Q1Q0=01       x    0
Q1Q0=11       x    x
Q1Q0=10       1    0

S0          W=0  W=1
Q1Q0=00       0    1
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    0

R0          W=0  W=1
Q1Q0=00       x    0
Q1Q0=01       1    1
Q1Q0=11       x    x
Q1Q0=10       x    x

F           W=0  W=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    1
S1=Q0WR1=W′S0=Q1′Q0′WR0=Q0F=Q1W\begin{aligned} S_1 &= Q_0 W \\ R_1 &= W' \\ S_0 &= Q_1' Q_0' W \\ R_0 &= Q_0 \\ F &= Q_1 W \end{aligned}

Logic diagram

           +-------------+     +----------+
 W  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> F
 W  ------>| logic       |
           +-------------+

Gates needed (two S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 2-input AND for Q0WQ_0 W.
  • R1R_1: direct line W′W'.
  • S0S_0: a 3-input AND for Q1′Q0′WQ_1' Q_0' W.
  • R0R_0: direct line Q0Q_0.
  • FF: a 2-input AND for Q1WQ_1 W.

Check: input W = 0111101 gives F = 0001100 — F = 1 at the 3rd and 4th consecutive 1, as the diagram requires (Z → Z on 1/1).

  • 2074 Asoj · 10 marks

Design a sequential machine that produces output Y = 1 when it detects the serial input X = 100.

Answer

No flip-flop type is specified, so J-K flip-flops are used (output named Y in the question is written Z below; Y = Z).

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 100 arrives. Flip-flops: J-K.

States (what has been received so far):

  • A: reset / no useful bits
  • B: "1" received
  • C: "10" received

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --0/0--> C --0/1--> A

 A --0/0--> A  (self loop)
 B --1/0--> B  (self loop)
 C --1/0--> B

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BCB00
CAB10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to A, X=1 goes to B), so it is self-starting.

Excitation table of J-K flip-flop

QQ+JK
000x
011x
10x1
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 00x0x0
0 010 10x1x0
0 101 01xx10
0 110 10xx00
1 000 0x10x1
1 010 1x11x0

K-maps and simplified equations

J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       x    x

K1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       1    1

J0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       0    1

K0          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
J1=Q0X′K1=1J0=XK0=X′Z=Q1X′\begin{aligned} J_1 &= Q_0 X' \\ K_1 &= 1 \\ J_0 &= X \\ K_0 &= X' \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two J-K flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • J1J_1: a 2-input AND for Q0X′Q_0 X'.
  • K1K_1: tied to logic 1.
  • J0J_0: direct line XX.
  • K0K_0: direct line X′X'.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 1100100 gives Z = 0001001; Z = 1 at bits 4 and 7.

  • 2072 Chaitra · 12 marks

Design a sequential machine that has a single input 'x' and single output 'z'. The machine is required to give high output when it detects the serial sequence of 011 message. Use JK flip-flops only.

Answer

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 011 arrives. Flip-flops: J-K.

States (what has been received so far):

  • A: reset, or last bits were 11 / 1
  • B: "0" received
  • C: "01" received

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --1/0--> C --1/1--> A

 A --1/0--> A  (self loop)
 B --0/0--> B  (self loop)
 C --0/0--> B

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BBC00
CBA01

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to B, X=1 goes to A), so it is self-starting.

Excitation table of J-K flip-flop

QQ+JK
000x
011x
10x1
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 10x1x0
0 010 00x0x0
0 100 10xx00
0 111 01xx10
1 000 1x11x0
1 010 0x10x1

K-maps and simplified equations

J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       x    x

K1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       1    1

J0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       1    0

K0          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    1
J1=Q0XK1=1J0=X′K0=XZ=Q1X\begin{aligned} J_1 &= Q_0 X \\ K_1 &= 1 \\ J_0 &= X' \\ K_0 &= X \\ Z &= Q_1 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two J-K flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • J1J_1: a 2-input AND for Q0XQ_0 X.
  • K1K_1: tied to logic 1.
  • J0J_0: direct line X′X'.
  • K0K_0: direct line XX.
  • ZZ: a 2-input AND for Q1XQ_1 X.

Check: input X = 0011011 gives Z = 0001001; Z = 1 at bits 4 and 7 ("high output" when 011 ends).

  • 2070 Chaitra · 2 marks

Define state diagram and state table with example.

Answer

A state diagram is a graph that shows the behaviour of a sequential circuit: each state is a circle, and each arrow shows the move to the next state on a clock pulse, labelled input/output (Mealy) or with the output written inside the circle (Moore).

A state table gives the same information in tabular form: for every present state and input, it lists the next state and the output.

Example: a Mealy machine that gives Z = 1 when two consecutive 1s arrive (states A = no 1, B = one 1).

 Arc label = X/Z

 A --1/0--> B --1/1--> B  (self loop)
 A --0/0--> A  (self loop)
 B --0/0--> A
Present stateNext (X=0)Next (X=1)Z (X=0)Z (X=1)
AAB00
BAB01
  • 2070 Chaitra · 8 marks

Design a sequential machine that has one serial input and one output z. The machine is required to give an output z = 1 when the input X contains the message 110.

Answer

No flip-flop type is specified, so D flip-flops are used (simplest: D = next state).

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 110 arrives. Flip-flops: D.

States (what has been received so far):

  • A: reset / last bit 0
  • B: "1" received
  • C: "11" received (stays in C on more 1s)

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --1/0--> C --0/1--> A

 A --0/0--> A  (self loop)
 B --0/0--> A
 C --1/0--> C  (self loop)

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BAC00
CAC10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to A, X=1 goes to C), so it is self-starting.

Excitation table of D flip-flop

QQ+D
000
011
100
111

Transition and excitation table

Q1 Q0XQ1+ Q0+D1D0Z
0 000 0000
0 010 1010
0 100 0000
0 111 0100
1 000 0001
1 011 0100

K-maps and simplified equations

D1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       0    1

D0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    0

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
D1=Q0X+Q1XD0=Q1′Q0′XZ=Q1X′\begin{aligned} D_1 &= Q_0 X + Q_1 X \\ D_0 &= Q_1' Q_0' X \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two D flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • D1D_1: a 2-input AND for Q0XQ_0 X; a 2-input AND for Q1XQ_1 X, combined in a 2-input OR gate.
  • D0D_0: a 3-input AND for Q1′Q0′XQ_1' Q_0' X.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 0110110 gives Z = 0001001; Z = 1 at bits 4 and 7.

  • 2069 Chaitra · 12 marks

Design a sequential machine that detects three consecutive zeros from an input data stream X by making output, Y = 1.

Answer

No flip-flop type is specified, so J-K flip-flops are used. Output Y of the question is written Z (Y = Z). With overlapping, a run of four 0s gives Y = 1 on the 3rd and 4th zero.

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 000 arrives. Flip-flops: J-K.

States (what has been received so far):

  • A: reset / last bit 1
  • B: one 0 received
  • C: two or more consecutive 0s received

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --0/0--> C --0/1--> C

 A --1/0--> A  (self loop)
 B --1/0--> A
 C --1/0--> A

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BCA00
CCA10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to C, X=1 goes to A), so it is self-starting.

Excitation table of J-K flip-flop

QQ+JK
000x
011x
10x1
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 10x1x0
0 010 00x0x0
0 101 01xx10
0 110 00xx10
1 001 0x00x1
1 010 0x10x0

K-maps and simplified equations

J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       x    x

K1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       0    1

J0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       0    0

K0          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       1    1
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
J1=Q0X′K1=XJ0=Q1′X′K0=1Z=Q1X′\begin{aligned} J_1 &= Q_0 X' \\ K_1 &= X \\ J_0 &= Q_1' X' \\ K_0 &= 1 \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two J-K flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • J1J_1: a 2-input AND for Q0X′Q_0 X'.
  • K1K_1: direct line XX.
  • J0J_0: a 2-input AND for Q1′X′Q_1' X'.
  • K0K_0: tied to logic 1.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 1000010 gives Z = 0001100; Z = 1 at the 4th and 5th bits (third and fourth consecutive 0).

  • 2068 Baisakh · 12 marks

Design a synchronous state machine with the following specification: a) No. of input: 1 b) No. of output: 1 c) The output of the machine is to be set high when the data in the input is 110 in sequence, starting from the MSB (Use SR flip-flop).

Answer

"Starting from the MSB" means the bits arrive serially in the order 1, 1, 0 (MSB first).

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 110 arrives. Flip-flops: S-R.

States (what has been received so far):

  • A: reset / last bit 0
  • B: "1" (first bit, MSB) received
  • C: "11" received

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --1/0--> C --0/1--> A

 A --0/0--> A  (self loop)
 B --0/0--> A
 C --1/0--> C  (self loop)

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BAC00
CAC10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to A, X=1 goes to C), so it is self-starting.

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 00x0x0
0 010 10x100
0 100 00x010
0 111 010010
1 000 0010x1
1 011 0x00x0

K-maps and simplified equations

S1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       0    x

R1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    0
Q1Q0=11       x    x
Q1Q0=10       1    0

S0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    0

R0          X=0  X=1
Q1Q0=00       x    0
Q1Q0=01       1    1
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
S1=Q0XR1=X′S0=Q1′Q0′XR0=Q0Z=Q1X′\begin{aligned} S_1 &= Q_0 X \\ R_1 &= X' \\ S_0 &= Q_1' Q_0' X \\ R_0 &= Q_0 \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 2-input AND for Q0XQ_0 X.
  • R1R_1: direct line X′X'.
  • S0S_0: a 3-input AND for Q1′Q0′XQ_1' Q_0' X.
  • R0R_0: direct line Q0Q_0.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 0110110 gives Z = 0001001; Z = 1 at bits 4 and 7.

  • 2068 Baisakh · 6 marks

With an example, state and explain the problems associated in the design of asynchronous sequential circuit.

Answer

An asynchronous sequential circuit has no clock: its state (held in feedback loops through gate delays) changes as soon as an input changes. This makes it fast, but the design has several problems that clocked circuits avoid.

1. Races

A race happens when two or more state variables must change in one transition. Due to unequal delays they do not change together, so the circuit passes through an intermediate state.

  • Non-critical race: the circuit still reaches the correct final state whatever order the variables change in.
  • Critical race: the final stable state depends on which variable changes first, so the circuit may settle in a wrong state.

Example: state y1y2y_1 y_2 must go from 00 to 11. If y1y_1 changes first the circuit passes 10; if y2y_2 first, it passes 01. If, for the present input, 01 is a stable state, the circuit stops at 01 instead of 11 — a critical race.

  00 ---> 11   intended
  00 ---> 10 ---> 11   (y1 first, OK)
  00 ---> 01 (stable) stuck  (y2 first, error)

Remedy: choose a race-free state assignment (adjacent codes differing in one bit), add extra states, or use a one-hot code.

2. Cycles

The circuit may go through a sequence of unstable states before reaching a stable one. If no stable state exists in that column, it keeps oscillating (an unending cycle) between states.

3. Hazards

Unequal gate delays give momentary wrong outputs (glitches):

  • Static-1 hazard: output should stay 1 but drops to 0 briefly, e.g. F=AB+A′CF = AB + A'C when A changes with B = C = 1. Fixed by adding the consensus term BCBC.
  • Static-0 / dynamic hazards are similar for 0 and for changing outputs.
  • Essential hazard: caused by an input change reaching different parts of the circuit at different times; removed by adding delay in the feedback.

Because feedback carries these glitches, a hazard can push the circuit into a wrong stable state.

4. Other restrictions

  • Fundamental mode: only one input may change at a time, and only after the circuit is stable.
  • Analysis and design are harder (flow table, merging of rows, state assignment), and the circuit is sensitive to temperature and delay variations.
  • 2082 Shrawan · 10 marks

Using Mealy circuit with JK flip-flops design a synchronous sequence detector that produces output Z = 1 when it detects the serial input X = 110.

Answer

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 110 arrives. Flip-flops: J-K.

States (what has been received so far):

  • A: reset / last bit 0
  • B: "1" received
  • C: "11" received (stays in C on more 1s)

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --1/0--> C --0/1--> A

 A --0/0--> A  (self loop)
 B --0/0--> A
 C --1/0--> C  (self loop)

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BAC00
CAC10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to A, X=1 goes to C), so it is self-starting.

Excitation table of J-K flip-flop

QQ+JK
000x
011x
10x1
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 00x0x0
0 010 10x1x0
0 100 00xx10
0 111 01xx10
1 000 0x10x1
1 011 0x00x0

K-maps and simplified equations

J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       x    x

K1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       1    0

J0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       0    0

K0          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       1    1
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
J1=Q0XK1=X′J0=Q1′XK0=1Z=Q1X′\begin{aligned} J_1 &= Q_0 X \\ K_1 &= X' \\ J_0 &= Q_1' X \\ K_0 &= 1 \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two J-K flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • J1J_1: a 2-input AND for Q0XQ_0 X.
  • K1K_1: direct line X′X'.
  • J0J_0: a 2-input AND for Q1′XQ_1' X.
  • K0K_0: tied to logic 1.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 1110110 gives Z = 0001001; Z = 1 at bits 4 and 7.

  • 2082 Baisakh · 10 marks

Design a sequential machine that has a single input 'X' and single output 'Z'. The machine is required to give high output when it detects the serial sequence of 1110 message. Use T-flip-flops only.

Answer

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 1110 arrives. Flip-flops: T.

States (what has been received so far):

  • A: reset / last bit 0
  • B: "1" received
  • C: "11" received
  • D: "111" received (stays in D on more 1s)

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --1/0--> C --1/0--> D --0/1--> A

 A --0/0--> A  (self loop)
 B --0/0--> A
 C --0/0--> A
 D --1/0--> D  (self loop)

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BAC00
CAD00
DAD10

State assignment

A = 00, B = 01, C = 10, D = 11 (flip-flop outputs Q1Q0Q_1 Q_0).

Excitation table of T flip-flop

QQ+T
000
011
101
110

Transition and excitation table

Q1 Q0XQ1+ Q0+T1T0Z
0 000 0000
0 010 1010
0 100 0010
0 111 0110
1 000 0100
1 011 1010
1 100 0111
1 111 1000

K-maps and simplified equations

T1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       1    0
Q1Q0=10       1    0

T0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       1    1
Q1Q0=11       1    0
Q1Q0=10       0    1

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       1    0
Q1Q0=10       0    0
T1=Q1X′+Q1′Q0XT0=Q0X′+Q0′X+Q1′XZ=Q1Q0X′\begin{aligned} T_1 &= Q_1 X' + Q_1' Q_0 X \\ T_0 &= Q_0 X' + Q_0' X + Q_1' X \\ Z &= Q_1 Q_0 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two T flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • T1T_1: a 2-input AND for Q1X′Q_1 X'; a 3-input AND for Q1′Q0XQ_1' Q_0 X, combined in a 2-input OR gate.
  • T0T_0: a 2-input AND for Q0X′Q_0 X'; a 2-input AND for Q0′XQ_0' X; a 2-input AND for Q1′XQ_1' X, combined in a 3-input OR gate.
  • ZZ: a 3-input AND for Q1Q0X′Q_1 Q_0 X'.

Check: input X = 0111101110 gives Z = 0000010001; Z = 1 at bits 6 and 10. Note D stays in D on 1, since "1111" still ends in "111".

  • 2081 Baisakh · 10 marks

Design a synchronous sequential machine from the given state diagram. Use SR flip-flops for realization. [Figure: state diagram with four states 00, 01, 10, 11, edges labelled input/output: 00→00 on 1/1; 00→01 on 0/0; 01→01 on 0/1; 01→10 on 1/0; 10→10 on 1/0; 10→11 on 0/0; 11→11 on 0/1; 11→00 on 1/0]

Answer

The diagram is a Mealy machine with 4 states already coded as Q1Q0Q_1 Q_0 = 00, 01, 10, 11, so no extra state assignment is needed. Input X, output Z, two S-R flip-flops (Q1Q_1 = MSB). Each state stays in itself on one input value and moves to the next state on the other.

State diagram (given)

Arc label = input/output

 00 --0/0--> 01 --1/0--> 10 --0/0--> 11 --1/0--> 00

 00 --1/1--> 00  (self loop)
 01 --0/1--> 01  (self loop)
 10 --1/0--> 10  (self loop)
 11 --0/1--> 11  (self loop)

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
00010001
01011010
10111000
11110010

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 10x100
0 010 00x0x1
0 100 10xx01
0 111 010010
1 001 1x0100
1 011 0x00x0
1 101 1x0x01
1 110 001010

K-maps and simplified equations

S1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    0
Q1Q0=10       x    x

R1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    0
Q1Q0=11       0    1
Q1Q0=10       0    0

S0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       x    0
Q1Q0=11       x    0
Q1Q0=10       1    0

R0          X=0  X=1
Q1Q0=00       0    x
Q1Q0=01       0    1
Q1Q0=11       0    1
Q1Q0=10       0    x

Z           X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       1    0
Q1Q0=11       1    0
Q1Q0=10       0    0
S1=Q1′Q0XR1=Q1Q0XS0=X′R0=XZ=Q0X′+Q1′Q0′X\begin{aligned} S_1 &= Q_1' Q_0 X \\ R_1 &= Q_1 Q_0 X \\ S_0 &= X' \\ R_0 &= X \\ Z &= Q_0 X' + Q_1' Q_0' X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 3-input AND for Q1′Q0XQ_1' Q_0 X.
  • R1R_1: a 3-input AND for Q1Q0XQ_1 Q_0 X.
  • S0S_0: direct line X′X'.
  • R0R_0: direct line XX.
  • ZZ: a 2-input AND for Q0X′Q_0 X'; a 3-input AND for Q1′Q0′XQ_1' Q_0' X, combined in a 2-input OR gate.

Check: from 00, X = 10101 gives states 00 → 00 → 01 → 10 → 11 → 00 and Z = 10000, matching the diagram. S1R1S_1 R_1 and S0R0S_0 R_0 are never both 1.

  • 2080 Bhadra · 10 marks

A asynchronous state machine has one bit serial input. The Y of the machine is set to be high when the input contains the message 011. Draw the state diagram for this machine and design the circuit. Use T Flip-Flop.

Answer

Since flip-flops and a clock are used, the machine is designed as a clocked (synchronous) Mealy machine; the output Y of the question is written Z (Y = Z).

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 011 arrives. Flip-flops: T.

States (what has been received so far):

  • A: reset / last bits 11 or 1
  • B: "0" received
  • C: "01" received

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --1/0--> C --1/1--> A

 A --1/0--> A  (self loop)
 B --0/0--> B  (self loop)
 C --0/0--> B

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BBC00
CBA01

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to B, X=1 goes to A), so it is self-starting.

Excitation table of T flip-flop

QQ+T
000
011
101
110

Transition and excitation table

Q1 Q0XQ1+ Q0+T1T0Z
0 000 1010
0 010 0000
0 100 1000
0 111 0110
1 000 1110
1 010 0101

K-maps and simplified equations

T1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       1    1

T0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       1    0

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    1
T1=Q0X+Q1T0=Q0X+Q0′X′Z=Q1X\begin{aligned} T_1 &= Q_0 X + Q_1 \\ T_0 &= Q_0 X + Q_0' X' \\ Z &= Q_1 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two T flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • T1T_1: a 2-input AND for Q0XQ_0 X; direct line Q1Q_1, combined in a 2-input OR gate.
  • T0T_0: a 2-input AND for Q0XQ_0 X; a 2-input AND for Q0′X′Q_0' X', combined in a 2-input OR gate.
  • ZZ: a 2-input AND for Q1XQ_1 X.

Check: input X = 0011011 gives Z = 0001001; Z = 1 at bits 4 and 7.

  • 2079 Bhadra · 10 marks

A synchronous machine has 1-bit input 'X'. The output 'Y' goes high when input contains the message '101'. Draw the state diagram, derive the transition table (state table), excitation table and design circuit. Use only T flip-flops.

Answer

Output Y of the question is written Z (Y = Z).

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 101 arrives. Flip-flops: T.

States (what has been received so far):

  • A: reset / no useful bits
  • B: "1" received
  • C: "10" received

State diagram (Mealy)

Arc label = input/output

 A --1/0--> B --0/0--> C --1/1--> B

 A --0/0--> A  (self loop)
 B --1/0--> B  (self loop)
 C --0/0--> A

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
AAB00
BCB00
CAB01

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to A, X=1 goes to B), so it is self-starting.

Excitation table of T flip-flop

QQ+T
000
011
101
110

Transition and excitation table

Q1 Q0XQ1+ Q0+T1T0Z
0 000 0000
0 010 1010
0 101 0110
0 110 1000
1 000 0100
1 010 1111

K-maps and simplified equations

T1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       1    1

T0          X=0  X=1
Q1Q0=00       0    1
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       0    1

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    1
T1=Q0X′+Q1T0=Q0X′+Q0′XZ=Q1X\begin{aligned} T_1 &= Q_0 X' + Q_1 \\ T_0 &= Q_0 X' + Q_0' X \\ Z &= Q_1 X \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two T flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • T1T_1: a 2-input AND for Q0X′Q_0 X'; direct line Q1Q_1, combined in a 2-input OR gate.
  • T0T_0: a 2-input AND for Q0X′Q_0 X'; a 2-input AND for Q0′XQ_0' X, combined in a 2-input OR gate.
  • ZZ: a 2-input AND for Q1XQ_1 X.

Check: input X = 0101011 gives Z = 0001010; Z = 1 at bits 4 and 6 ("10101" contains two overlapping 101s) and 0 at bit 7.

  • 2078 Bhadra · 12 marks

Design a sequential circuit with T flip-flop and two inputs X and Y. If X=1 and Y=0 the circuit goes through 00 to 01 to 11 to 10. When X=Y=1, the circuit goes through the transition from 00 to 10 to 01 to 11. When X = 0 and Y=1, the circuit goes through 00 to 11 to 10 to 00. When X = Y = 0, the circuit 00 to 01 to 10 to 11 and repeats.

Answer

The circuit has 2 flip-flops (Q1Q0Q_1 Q_0, Q1Q_1 = MSB), two control inputs X, Y, no separate output (the outputs are the states). It is a counter whose counting sequence is chosen by XY. Flip-flops: T.

Assumptions: each sequence returns to 00 after its last state (XY = 10: 10 → 00; XY = 11: 11 → 00; XY = 00: 11 → 00). For XY = 01 the state 01 is not in the given sequence, so it is taken to go to 00 (keeps the circuit from locking).

State diagram

Arc label = XY

 00 -10-> 01 -10-> 11 -10-> 10 -10-> 00
 00 -11-> 10 -11-> 01 -11-> 11 -11-> 00
 00 -01-> 11 -01-> 10 -01-> 00
          01 -01-> 00 (assumed)
 00 -00-> 01 -00-> 10 -00-> 11 -00-> 00

State table (next state)

Present Q1Q0Q_1 Q_0XY=00XY=01XY=10XY=11
0001110110
0110001111
1011000001
1100101000

Excitation table of T flip-flop

QQ+T
000
011
101
110

T = 1 whenever the flip-flop must change (T=Q⊕Q+T = Q \oplus Q^+).

Transition and excitation table

Q1 Q0X YQ1+ Q0+T1T0
0 00 00 101
0 00 11 111
0 01 00 101
0 01 11 010
0 10 01 011
0 10 10 001
0 11 01 110
0 11 11 110
1 00 01 101
1 00 10 010
1 01 00 010
1 01 10 111
1 10 00 011
1 10 11 001
1 11 01 001
1 11 10 011

K-maps and simplified equations

T1          XY=00  XY=01  XY=11  XY=10
Q1Q0=00         0      1      1      0
Q1Q0=01         1      0      1      1
Q1Q0=11         1      0      1      0
Q1Q0=10         0      1      1      1

T0          XY=00  XY=01  XY=11  XY=10
Q1Q0=00         1      1      0      1
Q1Q0=01         1      1      0      0
Q1Q0=11         1      1      1      1
Q1Q0=10         1      0      1      0
T1=Q0X′Y′+Q0′Y+Q1Q0′X+Q1′Q0Y′+XYT0=Q1Q0+Q1XY+Q1′Q0′Y′+Q1′X′+X′Y′\begin{aligned} T_1 &= Q_0 X' Y' + Q_0' Y + Q_1 Q_0' X + Q_1' Q_0 Y' + X Y \\ T_0 &= Q_1 Q_0 + Q_1 X Y + Q_1' Q_0' Y' + Q_1' X' + X' Y' \end{aligned}

Logic diagram

          +---------------+   T1  +------+
 X ------>|  T-input      |------>| FF1  |--+-- Q1
 Y ------>|  logic        |   T0  +------+  |
    +---->|  (equations)  |------>| FF0  |--+-- Q0
    |     +---------------+       +------+  |
    |      CLK to both FFs                  |
    +------------ Q1, Q0 fed back ----------+

Gates needed:

  • T1T_1: a 3-input AND for Q0X′Y′Q_0 X' Y'; a 2-input AND for Q0′YQ_0' Y; a 3-input AND for Q1Q0′XQ_1 Q_0' X; a 3-input AND for Q1′Q0Y′Q_1' Q_0 Y'; a 2-input AND for XYX Y, combined in a 5-input OR gate.
  • T0T_0: a 2-input AND for Q1Q0Q_1 Q_0; a 3-input AND for Q1XYQ_1 X Y; a 3-input AND for Q1′Q0′Y′Q_1' Q_0' Y'; a 2-input AND for Q1′X′Q_1' X'; a 2-input AND for X′Y′X' Y', combined in a 5-input OR gate.

Check: with XY = 10 from 00 the equations give 00 → 01 → 11 → 10 → 00; with XY = 11, 00 → 10 → 01 → 11 → 00, as required.

  • 2078 Kartik · 10 marks

Design a sequential machine that detects three consecutive zeros from an input data stream x by making output y=1. (Use SR flip flop in your design)

Answer

Output y of the question is written Z (y = Z). With overlapping, every 0 after two 0s gives Z = 1.

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 000 arrives. Flip-flops: S-R.

States (what has been received so far):

  • A: reset / last bit 1
  • B: one 0 received
  • C: two or more consecutive 0s

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --0/0--> C --0/1--> C

 A --1/0--> A  (self loop)
 B --1/0--> A
 C --1/0--> A

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BCA00
CCA10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to C, X=1 goes to A), so it is self-starting.

Excitation table of S-R flip-flop

QQ+SR
000x
0110
1001
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+S1R1S0R0Z
0 000 10x100
0 010 00x0x0
0 101 010010
0 110 00x010
1 001 0x00x1
1 010 0010x0

K-maps and simplified equations

S1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       1    0
Q1Q0=11       x    x
Q1Q0=10       x    0

R1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       0    x
Q1Q0=11       x    x
Q1Q0=10       0    1

S0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       0    0

R0          X=0  X=1
Q1Q0=00       0    x
Q1Q0=01       1    1
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
S1=Q0X′R1=XS0=Q1′Q0′X′R0=Q0Z=Q1X′\begin{aligned} S_1 &= Q_0 X' \\ R_1 &= X \\ S_0 &= Q_1' Q_0' X' \\ R_0 &= Q_0 \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two S-R flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • S1S_1: a 2-input AND for Q0X′Q_0 X'.
  • R1R_1: direct line XX.
  • S0S_0: a 3-input AND for Q1′Q0′X′Q_1' Q_0' X'.
  • R0R_0: direct line Q0Q_0.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 1000010 gives Z = 0001100; Z = 1 at bits 4 and 5.

  • 2076 Chaitra · 10 marks

Using Mealy circuit with J-K flip-flops design a synchronous sequence detector that produces output Z=1 when it detects the serial input X=010.

Answer

A Mealy machine is used (output depends on present state and input), so fewer states are needed. Overlapping sequences are allowed: after a detection the machine keeps the useful tail of the input. One input X and one output Z; Z = 1 in the clock period in which the last bit of 010 arrives. Flip-flops: J-K.

States (what has been received so far):

  • A: reset / no useful bits
  • B: "0" received
  • C: "01" received

State diagram (Mealy)

Arc label = input/output

 A --0/0--> B --1/0--> C --0/1--> B

 A --1/0--> A  (self loop)
 B --0/0--> B  (self loop)
 C --1/0--> A

State table

Present stateNext, X=0Next, X=1Z (X=0)Z (X=1)
ABA00
BBC00
CBA10

State assignment

A = 00, B = 01, C = 10 (flip-flop outputs Q1Q0Q_1 Q_0). The unused code 11 is taken as don't care (x) in all K-maps. The flip-flops are cleared to 00 at power-on (start state). Checking the final equations, from 11 the machine goes to a valid state on the next clock (X=0 goes to B, X=1 goes to A), so it is self-starting.

Excitation table of J-K flip-flop

QQ+JK
000x
011x
10x1
11x0

Transition and excitation table

Q1 Q0XQ1+ Q0+J1K1J0K0Z
0 000 10x1x0
0 010 00x0x0
0 100 10xx00
0 111 01xx10
1 000 1x11x1
1 010 0x10x0

K-maps and simplified equations

J1          X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       x    x

K1          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       1    1

J0          X=0  X=1
Q1Q0=00       1    0
Q1Q0=01       x    x
Q1Q0=11       x    x
Q1Q0=10       1    0

K0          X=0  X=1
Q1Q0=00       x    x
Q1Q0=01       0    1
Q1Q0=11       x    x
Q1Q0=10       x    x

Z           X=0  X=1
Q1Q0=00       0    0
Q1Q0=01       0    0
Q1Q0=11       x    x
Q1Q0=10       1    0
J1=Q0XK1=1J0=X′K0=XZ=Q1X′\begin{aligned} J_1 &= Q_0 X \\ K_1 &= 1 \\ J_0 &= X' \\ K_0 &= X \\ Z &= Q_1 X' \end{aligned}

Logic diagram

           +-------------+     +----------+
 X  ------>| next-state  |---->| FF1, FF0 |--+--> Q1, Q0
    +----->| logic       |     |  (CLK)   |  |
    |      +-------------+     +----------+  |
    +-------------------<--------------------+
    |      +-------------+
    +----->| output      |----> Z
 X  ------>| logic       |
           +-------------+

Gates needed (two J-K flip-flops with a common clock; complements are taken from the Q′Q' outputs or NOT gates):

  • J1J_1: a 2-input AND for Q0XQ_0 X.
  • K1K_1: tied to logic 1.
  • J0J_0: direct line X′X'.
  • K0K_0: direct line XX.
  • ZZ: a 2-input AND for Q1X′Q_1 X'.

Check: input X = 1010101 gives Z = 0001010; Z = 1 at bits 4 and 6 (overlapping 01010). After 010 the tail "0" is kept, so C goes to B on 0.

Questions from Old Question Collection (EX 502) (IOE EX 502 exam papers (BEL/BEX/BCT II/I) from 2068 to 2081) and Old Question Collection (BEI, EX 401) (IOE EX 401 exam papers (BEI I/I) from 2075 to 2082). Answers are written for this site; check them against your class notes.

Chapter titles and hours from the IOE syllabus ↗