Inspiration
Having worked with the Logisim program in the assemble course, I wanted to try and implement my own logic circuit emulator.
What it does
Emulate logic gates and logic circuits, only triggering the update logic for downstream gates when the state of upstream gates actually change, for example if the inputs for an and gate change from 0, 0 to 0, 1 the output of the and gate is still 0, thus gates that take the utput of the and gate as an input do not need to be updated.
How I built it
Using C++ vectors, iterators, smart pointers, inheritance, polymorphism, and QtCreator.
Challenges I ran into
Almost all of the logic gates produced a weird linker error when split as header file and source file (.cpp), but the code works just fine so long as it is the header file. This was also the first time I made C++ smart pointers a major part of a project, so I had to spend some time making sure that they were working the way that I intended them to. Also, there is a weird bug involving the Nand gate, the nand gates logic works correctly, however, the initial test of the Nand gate has the output node displaying the wrong output, however, later in the program when giving the Nand gate the same inputs the result displayed by the output node is correct.
Accomplishments that I'm proud of
The fact that it works at all.
What I learned
I gained experience working with smart pointers and that sometimes just sticking everything in header files can solve problems in C++.
What's next for Logic Sim
Stamping out the weird bug involving the Nand gate and cleaning up the code. Also potentially a graphical user interface.
Log in or sign up for Devpost to join the conversation.