Child pages
  • Marius Orehovschi's CS 232 Project 1: Combinational Circuits
Skip to end of metadata
Go to start of metadata

In this project, I learned to build simple combinational circuits using AND, OR, and NOT gates. Using Quartus, a program for simulating circuits, I implemented a prime counter in range 0-15, a 4-way traffic light simulator, and as an extension a black key detector for piano keys.

Prime finder

In this task, the inputs were numbers in range 0-15, represented as binary numbers using switches on the Altera DE1 board. The task of the circuit was to light up an LED whenever the input was a prime number. Below is a GTKWave plot of my testbench for this task:

The output F is high whenever the 4 binary inputs correspond to a prime number.

4-Way Traffic Lights

In this task, the input increments by one the value of a counter with range 0-15. Each number output by the counter corresponds to a certain light setting, described by this table:

Below is a video demonstrating my traffic light simulation on the Altera board:

Extension: Black Key Detector

As an extension, I implemented a circuit that, based on the input value  – a 4-bit binary number corresponding to a note starting at C0 – lights up when the input note corresponds to a black key on the piano. Here is a GTKWave plot of my circuit with all 16 inputs and the corresponding notes:

The output F is high whenever the input value shows a black key.


This project was an introduction to logic gates and combinational circuits. I learned how to use Quartus to program simple combinational circuits on the Altera board.

In this project, I received help and suggestions from Lolo Niemec, Max Perello, and Tivis Hall.