Skip to content
← All projects

Team project — C++, object-oriented design

Completed · 2026

Logic Gate Circuit Simulator

A C++ event-driven simulator for digital logic circuits, a team project built by hand for an Object-Oriented Design course.

  • C++
  • OOP
  • Digital Logic
Schematic of the flip-flop circuit — two cross-coupled NOR gates. Inputs R and S each feed one gate; each gate's output feeds the other gate's second input; outputs are O and wire 4.

The assignment

The final project for my Object-Oriented Design course was for me and my partner, Mark St. Michell, to build a command line program in C++ capabable of simulating digital logic. This was the culmination of two C++ classes and a digital logic design course we had taken.

MultiGate, traced

Schematic of the MultiGate circuit — a NOT gate feeding an AND gate (with input B), feeding an OR gate (with input C), producing output E.

The above image is a graphical example of a circuit we simulated. Each gate has its own propigation delay we had to account for. Shown below is the waveform we generated for this circuit, inputs are in white, outputs are in blue.

The flip-flop

The above waveform was quite simple compared to implementing a flip-flop. Flip-flops are cross-coupled, the output of both gates feed back into the input of the other gate. This posed a significant design challenge because we dealt with both cross coupling and propagation delay. We reworked our code multiple times but in the end we made it work.

The flip-flop, traced

Schematic of the flip-flop circuit — two cross-coupled NOR gates. Inputs R and S each feed one gate; each gate's output feeds the other gate's second input; outputs are O and wire 4.

Because we were creating a waveform for a flip-flop, our output would have continued flipping back and forth between high and low for eternity so we had to added a maximum simulation length of 50 ns.

Once we solved the flip flop we were certain our program could handle any circuit our proffesor would throw at it.

How it wrapped

After about 10 hours of work a piece, we finished our logic gate circuit simulator. We earned an 100% on the assignment. This was the first time either of us had worked with Git and learning how to involve a teammate in a coding project was one of the most valuable things learned. This assignment also taught us how to design classes in C++, abstract away logic with functions, and deal with pointers. For a more technical explanation of this project, view our source code on GitHub.

More projects