# Computing Machinery II Assignment 2 Solution

\$30.00

Category:

## Description

Synchronous Sequential Logic: Gray Code Up/Down Counter

A 3-bit Gray Code counts upward (from 0 to 7) using the following pattern:

000, 001, 011, 010, 110, 111, 101, 100

Once 100 (7 in decimal) is reached, the code “wraps around” to 000 (0 in decimal).

Create a synchronous sequential logic circuit that implements a Gray Code counter. The circuit will have two inputs:

1. Direction: If 0, the counter counts up. If 1, it counts down.

2. Enable: If 0, then the counter does not count up or down, but remains at the same number. If 1, then the counter will, on each clock signal, count up or down, depending on the value of the Direction input.

The circuit will have 3 outputs, one for each bit in the Gray Code. Implement your design using JK flip-flops.

Use the design method outlined in class, and create a report showing all steps:

1. State the problem in words.

2. Create a state diagram for the design.

3. Determine the inputs, outputs, number of flip-flops needed and their type.

4. Derive the excitation table for the state machine.

5. Derive the circuit output functions and flip-flop input functions, using the map method.

6. Draw the logic diagram for the circuit.

This report should be printed out and submitted on paper. Your diagrams and tables can be hand written or created using a graphics program.

Circuit Simulation

Implement your design in the Logisim application, using three LEDs for the output (one for each bit of the Gray Code). Arrange things so that the two inputs appear on the left, the synchronous circuitry in the middle, and the display LEDs on the right. Save your design in a file called assign2.circ, which will be submitted electronically using D2L.

Bonus (20% if fully implemented)

Reimplement your design using T flip-flops instead of JK flip-flops. Document this second design in your report, showing steps 3 – 6 from the design procedure above. Implement this design using Logisim and save it in a file called assign2bonus.circ, which will be submitted electronically using D2L.

New Skills Needed for this Assignment:

• Ability to work with flip-flops and their characteristic tables and equations

• Ability to create a state diagram

• Understanding of flip-flop excitation tables

• Ability to design clocked sequential circuits following the prescribed design procedure

Submit the following:

1. Your report on paper. Submit this using the assignment boxes located on the main floor of the Math Sciences Building (in the main floor Computer Science lab area).

2. Your Logisim file: assign2.circ (and assign2bonus.circ if doing the bonus) submitted using D2L.

Computing Machinery II

Student:__________________________________________

Report

Statement of problem 4 ______

State diagram 16 ______

Determine input/output variables/flip-flops 6 ______

Excitation table 14 ______

Output & flip-flop input functions 12 ______

Logic diagram 12 ______

Circuit simulation in Logisim 10 ______

Total 74 ______ _____%

Bonus (20% if fully implemented) _____%