In: Computer Science
5. a) Draw a state diagram for a sequential circuit that outputs a 1 if and only if its single
input has completed the sequence 1111.
b) Then build the circuit using D flip-flops and any necessary gates. NO Overlap is
Allowed.
6. Repeat question 5 but this time OVERLAP IS ALLOWED:
5 (a) State Diagram:

state table:
| Present State |
Next state (X = 0) |
Next State (x = 1) |
|---|---|---|
| a | a/0 | b/0 |
| b | a/0 | c/0 |
| c | a/0 | d/0 |
| d | a/0 | a/1 |
Let
a : y0= 0 y1= 0
b : y0= 0 y1= 1
c : y0= 1 y1= 0
d : y0= 1 y1= 1
Truth Table:
| y0 | y1 | X | Y0 | Y1 | Z | |
|---|---|---|---|---|---|---|
| a | 0 | 0 | 0 | 0 | 0 | 0 |
| a | 0 | 0 | 1 | 0 | 1 | 0 |
| b | 0 | 1 | 0 | 0 | 0 | 0 |
| b | 0 | 1 | 1 | 1 | 0 | 0 |
| c | 1 | 0 | 0 | 0 | 0 | 0 |
| c | 1 | 0 | 1 | 1 | 1 | 0 |
| d | 1 | 1 | 0 | 0 | 0 | 0 |
| d | 1 | 1 | 1 | 0 | 0 | 1 |
K-MAP:
Layout:
| X' | X | |
|---|---|---|
| y'0y1 | 0 | 1 |
| y'0y1 | 2 | 3 |
| y0y1 | 6 | 7 |
| y0y'1 | 4 | 5 |
K-map Groups:
For Y0
| (3) | y'0y1X |
| (5) | y0y'1X |
Boolean expression: Y0 = y'0y1X + y0y'1X = X(y'0y1 + y0y'1) = X (y0 XOR y1)
Groups For Y1:
| (1,5) | y'1X |
Boolean expression: Y1 = y'1X
Groups for Z:
| (7) | y0y1X |
Boolean expression: Y1 = y0y1X
(b) Circuit using D Flip flop:
(6)
(a) State Diagram:

State Table:
| Present State |
Next state (X = 0) |
Next State (x = 1) |
|---|---|---|
| a | a/0 | b/0 |
| b | a/0 | c/0 |
| c | a/0 | d/0 |
| d | a/0 | d/1 |
Truth Table:
| y0 | y1 | X | Y0 | Y1 | Z | |
|---|---|---|---|---|---|---|
| a | 0 | 0 | 0 | 0 | 0 | 0 |
| a | 0 | 0 | 1 | 0 | 1 | 0 |
| b | 0 | 1 | 0 | 0 | 0 | 0 |
| b | 0 | 1 | 1 | 1 | 0 | 0 |
| c | 1 | 0 | 0 | 0 | 0 | 0 |
| c | 1 | 0 | 1 | 1 | 1 | 0 |
| d | 1 | 1 | 0 | 0 | 0 | 0 |
| d | 1 | 1 | 1 | 1 | 1 | 1 |
K-MAP:
K-map Groups:
For Y0
| (3,7) | y1X |
| (5,7) | y0X |
Boolean expression: Y0 = y1X + y0X = X(y0 + y1)
Kmap groups for Y1:
| (1,5) | y'1X |
| (5,7) | y0X |
Boolean expression: Y1 = y1X + y0X = X(y0 + y'1)
Kmap groups for Z:
| (7) | y0 y1X |
Boolean expression: Z = y0 y1X
(b) Circuit Diagram:
