COSC3201.03 Laboratory #3

Sequential Logic

Due Date: Mar 19th in class
10:30 no exceptions

Notes:         In the lab reports students should have documentation as follows: PART A Flip-Flops

Construct a level sensitive J-K flip flop using NAND gates.  Determine the behaviour of the circuit for all possible combinations of the inputs. Using the logic and data switches on the tester (to create the clock pulse and inputs) determine what happens when the clock pulse is extended. Convert your circuit into a master slave version (hint one circuit should suffice for both of these designs with minor wiring changes). Draw a timing diagram (before the lab) predicting the values of the outputs of each stage for the following sequence of JK inputs (synchronous with the clock) 01, 11, 11, 10, 00, 00, 11. Compare your predicted pattern with the actual behaviour of the circuit.

PART B Gray Code Counter

Construct a counter to count up in three bit Gray code (see page 21 of Mano) using standard sequential logic techniques and JK flip flops. For the report only, design an equivalent circuit using 7474 flip-flops and compare the designs.

PART C Pseudo-Random Sequence Generator

A pseudo-random sequence is a sequence of bits (bit stream) which approximates a randomly distributed binary variable. The sequence is apparently random but repeats at a regular interval (usually a large interval). These circuits are useful in a variety of applications (toys, communications, cryptography, test equipment ...). Build a six flip-flop pseudo-random sequence generator using 7474  D flip flops (we also have a limited supply of 74175 quad D-type but you will be limited in ability to preset). This circuit has the output of stage one connected to the input of stage 2 and so on, as in a shift register. The input to the first flip-flop is the output of the fifth and sixth flops XORed together. Start the sequence with a given code by connecting the preset and clear inputs appropriately (connect them to a switch which can be momentarily closed to reset the . What is the length of the pseudo random sequence (hint to find the trend a two, three and four stage generator have the following outputs XORed respectively for the input to stage1: 1&2, 2&3 and 3&4)? Are any states problematic?

For the report only, design a nine stage pseudo random sequence generator (outputs 5 and 9 XORed) using a 74164 shift register and other logic. Include a control inputs to shift in a given pattern directly (known as the seed) over nine clock cycles.

PART D Shift Registers and Serial Code Converter

i) This question was taken from page 463 of Mano. Design but do not implement a four bit bi-directional shift register with parallel load using a 74195 shift register and a 74157 multiplexor. The circuit should be able to perform shift left and right, parallel load and both synchronous and asynchronous clear. Document your design and provide a functional description.

ii) A n-bit parallel binary to gray code converter works as follows: output bit 0 is the XOR of the inputs 0 and 1,  output bit 1 is the XOR of the inputs 1 and 2, ...  output bit n-1 is the XOR of the inputs n-1 and n, output n is simply input n. Design a serial version of this convertor to convert an n-bit binary number to a gray code number starting with the most significant bit. Use a JK flip-flop, and an XOR gate to perform the conversion along with a switch to reset and start the conversion (note that a flip-flop can act as a one bit delay). Concern yourself primarily with the data conversion - assume that the output serial stream is stored in a serial-in parallel-out shift register and that external counter/sequencer circuitry gates the clock off after all n bits have been converted.

OR, OR, OR, OR (postulate 0: four ORs don't make an AND)

PART E Counters

i) Design (but do not implement), using ********* 74161 counters and other logic as necessary, a mod 10 counter that counts up 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100 and then restarts at 0011 or counts down in the reverse order. Up/down direction is controlled by an input and the circuit has an input for synchronous resetting or loading to initialize to a known count. Document your design.

ii) Compare the speed of a four bit ripple counter design based on 7476 JK flip-flops with a four bit synchronous counter using the 7476 and any other logic you require. What is the maximum clocking rate for each circuit? Can you explain how a ripple counter can easily (trivially) be used as a frequency divider?