Logic-Emulator is a small C++ project built to practice object-oriented programming. The system models logical operations using classes, inheritance, and clean modular design.
- Fully object-oriented structure
- Uses inheritance to extend logic components
- Simple, clear class hierarchy for learning OOP fundamentals
This project was created to learn and demonstrate:
- Class design
- Inheritance and polymorphism
- Modular C++ code organization
- Github Workflows
- Writing Tests
The project leverages advanced C++ techniques to create highly adaptable logic components:
- Templates
(src/BasicGates/Gate.h:25, src/IntermediateGates/FullSubN.h:10) - concept DataType
(src/BasicGates/Gate.h:15) - Variadic constructors
(src/BasicGates/Gate.h:26)
- Clone project
- Open Project in CLion
- Build & Run
src/
βββ main.cpp # entry point
βββ BasicGates/ # basic logic gates
β βββ AND.h
β βββ Gate.h
β βββ NAND.h
β βββ β¦
βββ Core/ # core components
β βββ Bit.h
β βββ Bus.h
β βββ Input.h
β βββ β¦
βββ Extended/ # extended components: CPU, memory, registers
β βββ Memory.h
β βββ CPU.h
β βββ Register.h
β βββ ControlUnit.h
β βββ Assembler.h
βββ IntermediateGates/ # intermediate logic, ALU, adders, multiplexers
β βββ ArithmeticLogicUnit.h
β βββ ArithmeticLogicUnitN.h
β βββ Fulladd.h
β βββ FulladderN.h
β βββ FullSubN.h
β βββ Halfadd.h
β βββ Multiplexer/
β β βββ Multiplexer2to1.h
β β βββ Multiplexer4to1.h
β β βββ Multiplexer8to1.h
β βββ β¦
βββ lib/ # external libraries
β βββ doctest.h
βββ Tests/ # unit tests
βββ ALU_Test.cpp
βββ BasicGates_Test.cpp
βββ Bus_Test.cpp
βββ β¦