CS 232: Project #1

Project 1: Combinational Circuits

Purpose: to give you experience with basic digital design components.

1. 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.

2. 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 ValuesLight setting
0N/S Red, E/W Red
1-5N/S Green, E/W Red
6-7N/S Yellow, E/W Red
8N/S Red, E/W Red
9-13N/S Red, E/W Green
14-15N/S Red, E/W Yellow

Test your circuit by driving the counter with a clock. Be sure to reset the clock at the beginning of the simulation by setting the reset input to high for a short period of time. Demonstrate your six output signals for all possible inputs.

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.