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
└── …