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 () are used, clocked on the positive edge. (A Moore machine would need 4 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Y (X=0) | Y (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | A | C | 0 | 0 |
| C | "11" received | A | C | 1 | 0 |
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
| State | A | B | C |
|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 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 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Y |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | X | 0 | X | 0 |
| 0 0 | 1 | 0 1 | 0 | X | 1 | X | 0 |
| 0 1 | 0 | 0 0 | 0 | X | X | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | X | X | 1 | 0 |
| 1 0 | 0 | 0 0 | X | 1 | 0 | X | 1 |
| 1 0 | 1 | 1 0 | X | 0 | 0 | X | 0 |
Step 5: K-maps (rows , columns )
| J1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 |
| 1 | X | X | X | X |
| K1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | X | X |
| 1 | 1 | 0 | X | X |
| J0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | X | X |
| 1 | 0 | 0 | X | X |
| K0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 1 | 1 |
| 1 | X | X | X | X |
| Y: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | X | X |
Step 6: Equations
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
| X | 0 | 1 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | A | B | C | A | B | C | C | A | B |
| Y | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
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 () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Z (X=0) | Z (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | A | C | 0 | 0 |
| C | "11" received | D | C | 0 | 0 |
| D | "110" received | A | B | 0 | 1 |
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
| State | A | B | C | D |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 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 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | X | 0 | X | 0 |
| 0 0 | 1 | 0 1 | 0 | X | 1 | 0 | 0 |
| 0 1 | 0 | 0 0 | 0 | X | 0 | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 1 0 | 0 | 1 1 | X | 0 | 1 | 0 | 0 |
| 1 0 | 1 | 1 0 | X | 0 | 0 | X | 0 |
| 1 1 | 0 | 0 0 | 0 | 1 | 0 | 1 | 0 |
| 1 1 | 1 | 0 1 | 0 | 1 | X | 0 | 1 |
Step 5: K-maps (rows , columns )
| S1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 |
| 1 | X | X | 0 | 0 |
| R1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 0 | X |
| 1 | 0 | 0 | 1 | 1 |
| S0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | X | 0 |
| R0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | 0 | 1 | 1 |
| 1 | 0 | X | 0 | 1 |
| Z: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 |
Step 6: Equations
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
| X | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | A | B | C | D | B | C | D | B | A |
| Z | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 |
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 () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Y (X=0) | Y (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | C | B | 0 | 0 |
| C | "10" received | A | D | 0 | 0 |
| D | "101" received | C | B | 0 | 1 |
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
| State | A | B | C | D |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 1 |
Step 4: Excitation table
T excitation: T = 1 when the flip-flop must change, T = 0 when it must hold ().
| Q1 Q0 | X | Q1+ Q0+ | T1 | T0 | Y |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 1 0 | 1 | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | 0 | 0 |
| 1 0 | 0 | 0 0 | 1 | 0 | 0 |
| 1 0 | 1 | 1 1 | 0 | 1 | 0 |
| 1 1 | 0 | 1 0 | 0 | 1 | 0 |
| 1 1 | 1 | 0 1 | 1 | 0 | 1 |
Step 5: K-maps (rows , columns )
| T1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 |
| T0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| Y: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 |
Step 6: Equations
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
| X | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | A | B | C | D | B | C | D | B | C |
| Y | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 |
Y = 1 appears exactly on the clock in which the last bit of 1011 arrives; overlapping sequences are also detected.
Note: , 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 () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Z (X=0) | Z (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | C | B | 0 | 0 |
| C | "10" received | A | D | 0 | 0 |
| D | "101" received | C | B | 1 | 0 |
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
| State | A | B | C | D |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 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 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | X | 0 | X | 0 |
| 0 0 | 1 | 0 1 | 0 | X | 1 | X | 0 |
| 0 1 | 0 | 1 0 | 1 | X | X | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | X | X | 0 | 0 |
| 1 0 | 0 | 0 0 | X | 1 | 0 | X | 0 |
| 1 0 | 1 | 1 1 | X | 0 | 1 | X | 0 |
| 1 1 | 0 | 1 0 | X | 0 | X | 1 | 1 |
| 1 1 | 1 | 0 1 | X | 1 | X | 0 | 0 |
Step 5: K-maps (rows , columns )
| J1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | X | X | X | X |
| K1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | X | X |
| 1 | 1 | 0 | 1 | 0 |
| J0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | X | X |
| 1 | 0 | 1 | X | X |
| K0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 0 | 1 |
| 1 | X | X | 0 | 1 |
| Z: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 |
Step 6: Equations
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
| X | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | A | B | C | D | C | D | C | D | C |
| Z | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
Z = 1 appears exactly on the clock in which the last bit of 1010 arrives; overlapping sequences are also detected.
Note: (an XNOR gate), and FF0 simply follows the input (, ).
- 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 () are used, clocked on the positive edge. (A Moore machine would need 4 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Y (X=0) | Y (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | C | B | 0 | 0 |
| C | "10" received | A | B | 0 | 1 |
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
| State | A | B | C |
|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 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 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Y |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | X | 0 | X | 0 |
| 0 0 | 1 | 0 1 | 0 | X | 1 | X | 0 |
| 0 1 | 0 | 1 0 | 1 | X | X | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | X | X | 0 | 0 |
| 1 0 | 0 | 0 0 | X | 1 | 0 | X | 0 |
| 1 0 | 1 | 0 1 | X | 1 | 1 | X | 1 |
Step 5: K-maps (rows , columns )
| J1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | X | X | X | X |
| K1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | X | X |
| 1 | 1 | 1 | X | X |
| J0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | X | X |
| 1 | 0 | 1 | X | X |
| K0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 0 | 1 |
| 1 | X | X | X | X |
| Y: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | X | X |
Step 6: Equations
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
| X | 0 | 1 | 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | A | B | C | B | C | B | B | C | B |
| Y | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 |
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 () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (x=0) | Next (x=1) | y (x=0) | y (x=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | A | C | 0 | 0 |
| C | "11" received | D | C | 0 | 0 |
| D | "110" received | A | B | 0 | 1 |
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
| State | A | B | C | D |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 1 |
Step 4: Excitation table
T excitation: T = 1 when the flip-flop must change, T = 0 when it must hold ().
| Q1 Q0 | x | Q1+ Q0+ | T1 | T0 | y |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 0 0 | 0 | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | 1 | 0 |
| 1 0 | 0 | 1 1 | 0 | 1 | 0 |
| 1 0 | 1 | 1 0 | 0 | 0 | 0 |
| 1 1 | 0 | 0 0 | 1 | 1 | 0 |
| 1 1 | 1 | 0 1 | 1 | 0 | 1 |
Step 5: K-maps (rows , columns )
| T1: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 |
| T0: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| y: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 |
Step 6: Equations
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
| x | 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | B | C | D | B | C | D | B | C | D |
| y | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
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 () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (X=0) | Next (X=1) | Z (X=0) | Z (X=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | A | B | 0 | 0 |
| B | "1" received | C | B | 0 | 0 |
| C | "10" received | A | D | 0 | 0 |
| D | "101" received | C | B | 1 | 0 |
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
| State | A | B | C | D |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 1 |
Step 4: Excitation table
T excitation: T = 1 when the flip-flop must change, T = 0 when it must hold ().
| Q1 Q0 | X | Q1+ Q0+ | T1 | T0 | Z |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 1 0 | 1 | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | 0 | 0 |
| 1 0 | 0 | 0 0 | 1 | 0 | 0 |
| 1 0 | 1 | 1 1 | 0 | 1 | 0 |
| 1 1 | 0 | 1 0 | 0 | 1 | 1 |
| 1 1 | 1 | 0 1 | 1 | 0 | 0 |
Step 5: K-maps (rows , columns )
| T1: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 |
| T0: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 |
| Z: Q1 / Q0X | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 |
Step 6: Equations
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
| X | 1 | 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | B | C | D | C | D | C | A | B | C |
| Z | 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
Z = 1 appears exactly on the clock in which the last bit of 1010 arrives; overlapping sequences are also detected.
Note: , 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 () are used, clocked on the positive edge. (A Moore machine would need 4 states.)
Step 1: States
| Present state | Meaning | Next (x=0) | Next (x=1) | z (x=0) | z (x=1) |
|---|---|---|---|---|---|
| A | reset / no useful bits | B | A | 0 | 0 |
| B | "0" received | C | A | 0 | 0 |
| C | "00" received | C | A | 0 | 1 |
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
| State | A | B | C |
|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 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 Q0 | x | Q1+ Q0+ | J1 | K1 | J0 | K0 | z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | X | 1 | X | 0 |
| 0 0 | 1 | 0 0 | 0 | X | 0 | X | 0 |
| 0 1 | 0 | 1 0 | 1 | X | X | 1 | 0 |
| 0 1 | 1 | 0 0 | 0 | X | X | 1 | 0 |
| 1 0 | 0 | 1 0 | X | 0 | 0 | X | 0 |
| 1 0 | 1 | 0 0 | X | 1 | 0 | X | 1 |
Step 5: K-maps (rows , columns )
| J1: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | X | X | X | X |
| K1: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | X | X |
| 1 | 0 | 1 | X | X |
| J0: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 1 | 0 | X | X |
| 1 | 0 | 0 | X | X |
| K0: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | X | X | 1 | 1 |
| 1 | X | X | X | X |
| z: Q1 / Q0x | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | X | X |
Step 6: Equations
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
| x | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | A | B | C | A | B | C | A | B | C | C |
| z | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
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 () are used, clocked on the positive edge. (A Moore machine would need 5 states.)
Step 1: States
| Present state | Meaning | Next (A=0) | Next (A=1) | Y (A=0) | Y (A=1) |
|---|---|---|---|---|---|
| S0 | reset / no useful bits | S0 | S1 | 0 | 0 |
| S1 | "1" received | S2 | S1 | 0 | 0 |
| S2 | "10" received | S3 | S1 | 0 | 0 |
| S3 | "100" received | S0 | S1 | 0 | 1 |
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
| State | S0 | S1 | S2 | S3 |
|---|---|---|---|---|
| Q1 Q0 | 0 0 | 0 1 | 1 0 | 1 1 |
Step 4: Excitation table
D excitation: (D equals the next state).
| Q1 Q0 | A | Q1+ Q0+ | D1 | D0 | Y |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 1 0 | 1 | 0 | 0 |
| 0 1 | 1 | 0 1 | 0 | 1 | 0 |
| 1 0 | 0 | 1 1 | 1 | 1 | 0 |
| 1 0 | 1 | 0 1 | 0 | 1 | 0 |
| 1 1 | 0 | 0 0 | 0 | 0 | 0 |
| 1 1 | 1 | 0 1 | 0 | 1 | 1 |
Step 5: K-maps (rows , columns )
| D1: Q1 / Q0A | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 | 0 |
| D0: Q1 / Q0A | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
| Y: Q1 / Q0A | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 |
Step 6: Equations
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
| A | 1 | 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 0 |
|---|---|---|---|---|---|---|---|---|---|---|
| State | S0 | S1 | S2 | S3 | S1 | S2 | S3 | S1 | S1 | S2 |
| Y | 0 | 0 | 0 | 1 | 0 | 0 | 1 | 0 | 0 | 0 |
Y = 1 appears exactly on the clock in which the last bit of 1001 arrives; overlapping sequences are also detected.
Note: , 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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | C | B | 0 | 0 |
| C | D | B | 0 | 0 |
| D | A | B | 0 | 1 |
State assignment
A = 00, B = 01, C = 10, D = 11 (flip-flop outputs ).
Excitation table of S-R flip-flop
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 1 | 0 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | x | x | 0 | 0 |
| 1 0 | 0 | 1 1 | x | 0 | 1 | 0 | 0 |
| 1 0 | 1 | 0 1 | 0 | 1 | 1 | 0 | 0 |
| 1 1 | 0 | 0 0 | 0 | 1 | 0 | 1 | 0 |
| 1 1 | 1 | 0 1 | 0 | 1 | x | 0 | 1 |
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
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 outputs or NOT gates):
- : a 3-input AND for .
- : a 2-input AND for ; direct line , combined in a 2-input OR gate.
- : a 2-input AND for ; direct line , combined in a 2-input OR gate.
- : a 2-input AND for .
- : a 3-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | C | B | 0 | 0 |
| C | A | D | 0 | 0 |
| D | C | B | 0 | 1 |
State assignment
A = 00, B = 01, C = 10, D = 11 (flip-flop outputs ).
Excitation table of J-K flip-flop
| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | x | 0 |
| 0 1 | 0 | 1 0 | 1 | x | x | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | x | x | 0 | 0 |
| 1 0 | 0 | 0 0 | x | 1 | 0 | x | 0 |
| 1 0 | 1 | 1 1 | x | 0 | 1 | x | 0 |
| 1 1 | 0 | 1 0 | x | 0 | x | 1 | 0 |
| 1 1 | 1 | 0 1 | x | 1 | x | 0 | 1 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : a 2-input AND for ; a 2-input AND for , combined in a 2-input OR gate.
- : direct line .
- : direct line .
- : a 3-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | B | A | 0 | 0 |
| B | B | C | 0 | 0 |
| C | B | A | 0 | 1 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 0 | 1 | 0 0 | 0 | x | 0 | x | 0 |
| 0 1 | 0 | 0 1 | 0 | x | x | 0 | 0 |
| 0 1 | 1 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 1 0 | 0 | 0 1 | 0 | 1 | 1 | 0 | 0 |
| 1 0 | 1 | 0 0 | 0 | 1 | 0 | x | 1 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : direct line .
- : direct line .
- : direct line .
- : a 2-input AND for .
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 state | Next, W=0 | Next, W=1 | F (W=0) | F (W=1) |
|---|---|---|---|---|
| X | X | Y | 0 | 0 |
| Y | X | Z | 0 | 0 |
| Z | X | Z | 0 | 1 |
State assignment
X = 00, Y = 01, Z = 10 (flip-flop outputs ). 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
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | W | Q1+ Q0+ | S1 | R1 | S0 | R0 | F |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 1 | 0 | 0 0 | 0 | x | 0 | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 1 0 | 0 | 0 0 | 0 | 1 | 0 | x | 0 |
| 1 0 | 1 | 1 0 | x | 0 | 0 | x | 1 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : direct line .
- : a 3-input AND for .
- : direct line .
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | C | B | 0 | 0 |
| C | A | B | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | x | 0 |
| 0 1 | 0 | 1 0 | 1 | x | x | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | x | x | 0 | 0 |
| 1 0 | 0 | 0 0 | x | 1 | 0 | x | 1 |
| 1 0 | 1 | 0 1 | x | 1 | 1 | x | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : tied to logic 1.
- : direct line .
- : direct line .
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | B | A | 0 | 0 |
| B | B | C | 0 | 0 |
| C | B | A | 0 | 1 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | x | 1 | x | 0 |
| 0 0 | 1 | 0 0 | 0 | x | 0 | x | 0 |
| 0 1 | 0 | 0 1 | 0 | x | x | 0 | 0 |
| 0 1 | 1 | 1 0 | 1 | x | x | 1 | 0 |
| 1 0 | 0 | 0 1 | x | 1 | 1 | x | 0 |
| 1 0 | 1 | 0 0 | x | 1 | 0 | x | 1 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : tied to logic 1.
- : direct line .
- : direct line .
- : a 2-input AND for .
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 state | Next (X=0) | Next (X=1) | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | A | B | 0 | 1 |
- 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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | A | C | 0 | 0 |
| C | A | C | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | D |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | D1 | D0 | Z |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 0 0 | 0 | 0 | 0 |
| 0 1 | 1 | 1 0 | 1 | 0 | 0 |
| 1 0 | 0 | 0 0 | 0 | 0 | 1 |
| 1 0 | 1 | 1 0 | 1 | 0 | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for ; a 2-input AND for , combined in a 2-input OR gate.
- : a 3-input AND for .
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | B | A | 0 | 0 |
| B | C | A | 0 | 0 |
| C | C | A | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | x | 1 | x | 0 |
| 0 0 | 1 | 0 0 | 0 | x | 0 | x | 0 |
| 0 1 | 0 | 1 0 | 1 | x | x | 1 | 0 |
| 0 1 | 1 | 0 0 | 0 | x | x | 1 | 0 |
| 1 0 | 0 | 1 0 | x | 0 | 0 | x | 1 |
| 1 0 | 1 | 0 0 | x | 1 | 0 | x | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : direct line .
- : a 2-input AND for .
- : tied to logic 1.
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | A | C | 0 | 0 |
| C | A | C | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 1 | 0 | 0 0 | 0 | x | 0 | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 1 0 | 0 | 0 0 | 0 | 1 | 0 | x | 1 |
| 1 0 | 1 | 1 0 | x | 0 | 0 | x | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : direct line .
- : a 3-input AND for .
- : direct line .
- : a 2-input AND for .
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 must go from 00 to 11. If changes first the circuit passes 10; if 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. when A changes with B = C = 1. Fixed by adding the consensus term .
- 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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | A | C | 0 | 0 |
| C | A | C | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | x | 0 | x | 0 |
| 0 0 | 1 | 0 1 | 0 | x | 1 | x | 0 |
| 0 1 | 0 | 0 0 | 0 | x | x | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | x | x | 1 | 0 |
| 1 0 | 0 | 0 0 | x | 1 | 0 | x | 1 |
| 1 0 | 1 | 1 0 | x | 0 | 0 | x | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : direct line .
- : a 2-input AND for .
- : tied to logic 1.
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | A | C | 0 | 0 |
| C | A | D | 0 | 0 |
| D | A | D | 1 | 0 |
State assignment
A = 00, B = 01, C = 10, D = 11 (flip-flop outputs ).
Excitation table of T flip-flop
| Q | Q+ | T |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | T1 | T0 | Z |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 0 0 | 0 | 1 | 0 |
| 0 1 | 1 | 1 0 | 1 | 1 | 0 |
| 1 0 | 0 | 0 0 | 1 | 0 | 0 |
| 1 0 | 1 | 1 1 | 0 | 1 | 0 |
| 1 1 | 0 | 0 0 | 1 | 1 | 1 |
| 1 1 | 1 | 1 1 | 0 | 0 | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for ; a 3-input AND for , combined in a 2-input OR gate.
- : a 2-input AND for ; a 2-input AND for ; a 2-input AND for , combined in a 3-input OR gate.
- : a 3-input AND for .
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 = 00, 01, 10, 11, so no extra state assignment is needed. Input X, output Z, two S-R flip-flops ( = 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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| 00 | 01 | 00 | 0 | 1 |
| 01 | 01 | 10 | 1 | 0 |
| 10 | 11 | 10 | 0 | 0 |
| 11 | 11 | 00 | 1 | 0 |
Excitation table of S-R flip-flop
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 0 | 1 | 0 0 | 0 | x | 0 | x | 1 |
| 0 1 | 0 | 0 1 | 0 | x | x | 0 | 1 |
| 0 1 | 1 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 1 0 | 0 | 1 1 | x | 0 | 1 | 0 | 0 |
| 1 0 | 1 | 1 0 | x | 0 | 0 | x | 0 |
| 1 1 | 0 | 1 1 | x | 0 | x | 0 | 1 |
| 1 1 | 1 | 0 0 | 0 | 1 | 0 | 1 | 0 |
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
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 outputs or NOT gates):
- : a 3-input AND for .
- : a 3-input AND for .
- : direct line .
- : direct line .
- : a 2-input AND for ; a 3-input AND for , 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. and 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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | B | A | 0 | 0 |
| B | B | C | 0 | 0 |
| C | B | A | 0 | 1 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | T |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | T1 | T0 | Z |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | 1 | 0 |
| 0 0 | 1 | 0 0 | 0 | 0 | 0 |
| 0 1 | 0 | 0 1 | 0 | 0 | 0 |
| 0 1 | 1 | 1 0 | 1 | 1 | 0 |
| 1 0 | 0 | 0 1 | 1 | 1 | 0 |
| 1 0 | 1 | 0 0 | 1 | 0 | 1 |
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
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 outputs or NOT gates):
- : a 2-input AND for ; direct line , combined in a 2-input OR gate.
- : a 2-input AND for ; a 2-input AND for , combined in a 2-input OR gate.
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | A | B | 0 | 0 |
| B | C | B | 0 | 0 |
| C | A | B | 0 | 1 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | T |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | T1 | T0 | Z |
|---|---|---|---|---|---|
| 0 0 | 0 | 0 0 | 0 | 0 | 0 |
| 0 0 | 1 | 0 1 | 0 | 1 | 0 |
| 0 1 | 0 | 1 0 | 1 | 1 | 0 |
| 0 1 | 1 | 0 1 | 0 | 0 | 0 |
| 1 0 | 0 | 0 0 | 1 | 0 | 0 |
| 1 0 | 1 | 0 1 | 1 | 1 | 1 |
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
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 outputs or NOT gates):
- : a 2-input AND for ; direct line , combined in a 2-input OR gate.
- : a 2-input AND for ; a 2-input AND for , combined in a 2-input OR gate.
- : a 2-input AND for .
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 (, = 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 | XY=00 | XY=01 | XY=10 | XY=11 |
|---|---|---|---|---|
| 00 | 01 | 11 | 01 | 10 |
| 01 | 10 | 00 | 11 | 11 |
| 10 | 11 | 00 | 00 | 01 |
| 11 | 00 | 10 | 10 | 00 |
Excitation table of T flip-flop
| Q | Q+ | T |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
T = 1 whenever the flip-flop must change ().
Transition and excitation table
| Q1 Q0 | X Y | Q1+ Q0+ | T1 | T0 |
|---|---|---|---|---|
| 0 0 | 0 0 | 0 1 | 0 | 1 |
| 0 0 | 0 1 | 1 1 | 1 | 1 |
| 0 0 | 1 0 | 0 1 | 0 | 1 |
| 0 0 | 1 1 | 1 0 | 1 | 0 |
| 0 1 | 0 0 | 1 0 | 1 | 1 |
| 0 1 | 0 1 | 0 0 | 0 | 1 |
| 0 1 | 1 0 | 1 1 | 1 | 0 |
| 0 1 | 1 1 | 1 1 | 1 | 0 |
| 1 0 | 0 0 | 1 1 | 0 | 1 |
| 1 0 | 0 1 | 0 0 | 1 | 0 |
| 1 0 | 1 0 | 0 0 | 1 | 0 |
| 1 0 | 1 1 | 0 1 | 1 | 1 |
| 1 1 | 0 0 | 0 0 | 1 | 1 |
| 1 1 | 0 1 | 1 0 | 0 | 1 |
| 1 1 | 1 0 | 1 0 | 0 | 1 |
| 1 1 | 1 1 | 0 0 | 1 | 1 |
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
Logic diagram
+---------------+ T1 +------+
X ------>| T-input |------>| FF1 |--+-- Q1
Y ------>| logic | T0 +------+ |
+---->| (equations) |------>| FF0 |--+-- Q0
| +---------------+ +------+ |
| CLK to both FFs |
+------------ Q1, Q0 fed back ----------+
Gates needed:
- : a 3-input AND for ; a 2-input AND for ; a 3-input AND for ; a 3-input AND for ; a 2-input AND for , combined in a 5-input OR gate.
- : a 2-input AND for ; a 3-input AND for ; a 3-input AND for ; a 2-input AND for ; a 2-input AND for , 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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | B | A | 0 | 0 |
| B | C | A | 0 | 0 |
| C | C | A | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | S | R |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | S1 | R1 | S0 | R0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | x | 1 | 0 | 0 |
| 0 0 | 1 | 0 0 | 0 | x | 0 | x | 0 |
| 0 1 | 0 | 1 0 | 1 | 0 | 0 | 1 | 0 |
| 0 1 | 1 | 0 0 | 0 | x | 0 | 1 | 0 |
| 1 0 | 0 | 1 0 | x | 0 | 0 | x | 1 |
| 1 0 | 1 | 0 0 | 0 | 1 | 0 | x | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : direct line .
- : a 3-input AND for .
- : direct line .
- : a 2-input AND for .
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 state | Next, X=0 | Next, X=1 | Z (X=0) | Z (X=1) |
|---|---|---|---|---|
| A | B | A | 0 | 0 |
| B | B | C | 0 | 0 |
| C | B | A | 1 | 0 |
State assignment
A = 00, B = 01, C = 10 (flip-flop outputs ). 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
| Q | Q+ | J | K |
|---|---|---|---|
| 0 | 0 | 0 | x |
| 0 | 1 | 1 | x |
| 1 | 0 | x | 1 |
| 1 | 1 | x | 0 |
Transition and excitation table
| Q1 Q0 | X | Q1+ Q0+ | J1 | K1 | J0 | K0 | Z |
|---|---|---|---|---|---|---|---|
| 0 0 | 0 | 0 1 | 0 | x | 1 | x | 0 |
| 0 0 | 1 | 0 0 | 0 | x | 0 | x | 0 |
| 0 1 | 0 | 0 1 | 0 | x | x | 0 | 0 |
| 0 1 | 1 | 1 0 | 1 | x | x | 1 | 0 |
| 1 0 | 0 | 0 1 | x | 1 | 1 | x | 1 |
| 1 0 | 1 | 0 0 | x | 1 | 0 | x | 0 |
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
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 outputs or NOT gates):
- : a 2-input AND for .
- : tied to logic 1.
- : direct line .
- : direct line .
- : a 2-input AND for .
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 ↗