# Spring 2002 ENGR 212 / CSCI 311 Homework 8

This assignment is due 3 April.

This is assignment is based on NCSU ECE 212 Homework 6. However,
the numbers have been changed.

## Problem 1

For the FSM (Finite State Machine) specified by the state table below,
give the next-state and output equations (also show your
K-maps), assuming D flip-flops.
Use the following state assignment for Q1, Q2, and Q3:
A = 000, B = 100, C = 010, and D = 001.

state | input |

| 0 | 1 |

A | C/1 | D/0 |

B | C/0 | A/0 |

C | B/0 | C/1 |

D | A/0 | B/1 |

## Problem 2

Construct the equivalent state diagram for the
FSM specified in problem 1.

## Problem 3

Using the state table from problem #1, construct a state sequence chart
for the input sequence `x` is 0 1 1 0 1 1 0 0 0 1.
Assume the initial state is A.
Note: A state sequence chart shows input, current state, next state,
and output each cycle. For example, here is the first cycle done for you:

cycle 1 2 3 4 5 6 7 8 9 10
------------------------------------
x (input) 0 1 1 0 1 1 0 0 0 1
current state A C
next state C
z (output) 1

## Problem 4

Design a Mealy state machine that will detect each of the following
sequences. When the sequence is detected, a single output "z" is set to 1.
Your design should include a state diagram and a state table for each
machine.

- Sequence = 10001. Overlapping sequences are allowed.
- Sequence = 1001. Overlapping sequences are not allowed.