Project 1: Combinational Circuits
Purpose: to give you experience with basic digital design components.
Tasks
-
Create a circuit with 4 inputs, treated as a 4-bit positive binary
integer. The circuit should output a 1 if the input is a prime number
and 0 otherwise.
Simluate your circuit by testing all possible combinations of inputs, similar to the way we tested the circuit in the lab exercise. Take a screen shot of both your final circuit design and your simulation.
-
Create a circuit that has two components. One component should be a
counter, which is available as a module. The important inputs to the
counter are a clock and a reset button.
The second part of the circuit should be a combinational circuit that controls the six lights of a 4-way traffic light. There are NS-red, NS-green, and NS-yellow, EW-red, EW-green, and EW-yellow. They should follow the timings below, given the 4-bit input from the counter.
Input Values Light setting 0 N/S Red, E/W Red 1-5 N/S Green, E/W Red 6-7 N/S Yellow, E/W Red 8 N/S Red, E/W Red 9-13 N/S Red, E/W Green 14-15 N/S Red, E/W Yellow Test your circuit by driving the counter with a clock. Demonstrate your six output signals for all possible inputs.
Hint: To include a counter in your circuit use the LPM_COUNTER. In the symbol library, under megafunctions, under arithmetic, there is a gate called lpm_counter. Select it. it will pop up a wizard. For the most part, you can accept the default values so when it asks you to choose the width for the q bus, select the right number, then click finish (unless you want to see the remaining options). You will be prompted with a question about automatically adding Quartus II IP files to all projects. I say no. You can too. Then connect an input pin to the clock input as we talked about in lab. You can connect to each of components out the output bus by labeling your wires with things like q[0], q[1], etc.
Take a screen capture of your final circuit and your simulation.
Extensions
- Demonstrate that one or more of your outputs are generated by a minimal logic circuit.
- Extend the prime numbers circuit to 5 bits.
- Do something interesting with the traffic light circuit, like add a walk button (this is challengine).
- Explore the capabilities of Quartus or ModelSim. Here is the ModelSim tutorial.
Writeup
Create a wiki page with your writeup. For each task, write a short description of the task, in your own words.
- Include a picture of your final design.
- Include a picture of your simulation.
- Describe why the simulation proves your circuit works.
- Include a description, and pictures, of any extensions.
Handin
Give your wiki page the label cs232s14project1.
Put your bdf files in a folder called project1 in your private subdirectory on the Courses server in /COMP/CS232.