CSCI 210: Lab 6

Four Bit Counter
Due: 11:59 PM on Sunday, April 4th.

Partners

You may work with a partner for this lab. If you work with a partner, please submit a single assignment through circuitverse.org - you should be able to add a partner to your assignment using the "Add Collaborator" button when you start the assignment.

If you choose to work with a partner, you and your partner must complete the entire lab together. Dividing the lab up into pieces and having each partner complete a part of it on their own will be considered a violation of the honor code. Both you and your partner are expected to fully understand all of the code you submit.

Counter

We will be using circuitverse.org for this assignment, just like we did for Lab 4 and 5.

In this lab, you will

  • Build a clocked S-R latch
  • Build a J-K flipflop out of S-R latches
  • Build an four-bit counter out of 4 J-K flipflops

Clocked S-R Latch

You should first build a clocked S-R Latch as a subcircuit. Lectures 20 and 21, as well as section 3.7 of the Zybook should be helpful to you here. Your subcircuit should take in inputs S, R and C (for clock), and have outputs Q and Not Q. (Note that for this subcircuit, you should make the clock an input value, and not actually hook up the clock to the circuit.)

JK FlipFlop

Next you will build a JK Flipflop out of two clocked S-R latches, also as a subcircuit. Problem Set 8 and the beginning of lecture 24 should be helpful here. Your subcircuit inputs should be J, K and C (for clock again), and your outputs can either be Q and Not Q, or just Q.

4-Bit Counter

Finally, you will build an 4 bit counter out of JK FlipFlops. (The beginning of lecture 24 should help with this.) This circuit should not require any input from the user/viewer of the circuit - you should use the clock as input, and it should automatically make your counter increase by one for every clock cycle. Your output should be a binary number displaying the current count. You can either display this as 4 individual 1-bit outputs, or 1 four-bit output. Your counter should count through 0000, 0001, 0010, 0011, . . . . , 1110, 1111 and then start over at 0000.

You must build your own JK FlipFlops and SR latches. Using the circuitverse latches or flipflops will result in a failing grade for this lab.


C. Taylor