####
UMBC CMSC 313, Computer Organization & Assembly Language,
Spring 2002, Section 0101

# DigSim Assignment 2: A Finite State Machine

Also available in PDF.
### Due: Tuesday April 30, 2002

### Objective

The objective of this assignment is to design and implement a simple finite
state machine.

### Assignment

Design a finite state machine with two inputs X1 X0 and two outputs Z1,
Z0. We will think of X1 X0 and Z1 Z0 also as unsigned 2-bit binary
numbers. The output Z1 is 1 if X1 X0 as a binary number is less than the
previous cycle's output Z1 Z0. If X1 X0 is greater than or equal to the
previous Z1 Z0, then the output Z1 is 0. Similarly, Z0 is 1 if X1 X0 is
greater than the previous Z1 Z0; and Z0 is 0 if X1 X0 is less than or
equal to the previous Z1 Z0. Note that Z1 and Z0 are not complements of
each other, since they can both be zero.

### Implementation Notes

- You may assume that during the first cycle of operation that the
"previous" outputs were zeroes.

- Write out the truth table for a Boolean function with 4
inputs X1, X0 and Q1, Q0 and two outputs Z1, Z0 such that Z1 and
Z0 are as defined above with Q1 and Q0 in place of the previous
cycle's Z1 and Z0.
- Produce the sum-of-products Boolean formulas for Z1 and
Z0. Simplify the Boolean formulas for Z1 and Z0 using the properties
of Boolean Algebra in Table A-1 of Murdocca & Heuring. (Dont
expect a very simple result.)
- Implement a combinational circuit in DigSim using the
simplified Boolean formulas.
- Transform the combinational circuit into a finite state
machine by connecting the outputs Z1Z0 to the inputs Q1 Q0 through
two D flip-flops. Recall that the D flip-flops have an output pin
Q as well as the complement of Q. This might simplify your design
somewhat.
- Connect manual switches (powered & grounded) to the
inputs X1 and X0. Use another manual switch to simulate a clock
for the D flip-flops.
- Test your finite state machine to make sure that it conforms
to the specifications above.

### Turning in your program

Save your circuit as you did in DigSim Assignment 1. In addition,
prepare a text file called README with the simplified Boolean
formulas for Z1 and Z0. Any comments you might have for the grader
should also be placed in the README file.
Submit the circuit file and the README file using the Unix submit
command as in previous assignments. The submission name for this
assignment is: `digsim2`.

Last Modified:
8 May 2002 23:38:21 EDT
by
Richard Chang
to Spring 2002 CMSC 313 Section Homepage