Introduction
This assignment is to build a modulo 4 up/down counter.
The Assignment
Set Up The Project
Create a directory under My Projects named Assignment_04 for this project. Unzip another copy of the support files for Assignment 3 into this new directory. Change the name of DE1_Testbed.bdf to Modulo-4_Testbed.bdf, and create a new Quartus project in this directory using this schematic file as the top-level design. Create a schematic for the device, named Modulo_4_counter. The inputs to this schematic are clock, up, and dn; the only required output is Z, but for debugging, you should add two more output pins named S1 and S0. All of these I/O pins are just one bit each. Without implementing the schematic, create a symbol for it. Then edit the testbed to replace the Device Under Test symbol with this symbol for Modulo_4_counter. Edit the schematic for the testbed as follows:
- Eliminate all the seven segment displays. (If you added the hex2sevenseg.v file from Assignment 3, you can delete it from this project, but it will do no harm if you do not remove it.)
- Remove the Clock input pin. Connect Key[3] to the clock pin, Key[1] to the dn input, and Key[0] to the up pin of the counter module. Connect the Z output of the counter to Red Led 0. Connect the S1 and S0 outputs to Red Leds 9 and 8. Keep the four Key inputs connected to Green Leds 0-3 to help make sure they are operating as you expect.
Create The Project
Implementing the Modulo-4 counter is a matter of connecting two D flip-flops to the clock input, and implementing the state table (truth table for the combinational logic) developed in class on March 6. Testing is a matter of making sure the flip-flops make the correct state transitions each time you generate a clock pulse by pressing Key[3] while holding the various combinations of Key[1] and Key[0].
If you would like to get credit for an extra homework assignment, you may create another project in a directory named Assignment_04a. In it, implement a modulo-32 up/down counter using the technique outlined in class on March 11. The design would consist of five T flip-flops, each of which has a 4×1 multiplexer controlled by the up and dn inputs. Use two seven segment displays to show the current state.
The extra-credit assignment is due by midnight March 18, and will not be accepted after that. Send me a separate email to submit the extra-credit assignment.
Submit The Assignment
When you have built and tested your circuit, be sure to log out of your account so your project will be saved on the server. Then send an email message to me saying your project is ready; I will get a copy from your account on the server and check it out. Send your email to:
Christopher.VickeryATqc.cuny.eduBe sure the Subject Line of your email says CS-343 Assignment 4, just like that, to be sure your message does not get trapped by my spam filters.
Be sure to sign your email so I can tell who sent it!