Skip to content

Latest commit

 

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Logic-Emulator

Overview

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.

Key Points

  • Fully object-oriented structure
  • Uses inheritance to extend logic components
  • Simple, clear class hierarchy for learning OOP fundamentals

Purpose

This project was created to learn and demonstrate:

  • Class design
  • Inheritance and polymorphism
  • Modular C++ code organization
  • Github Workflows
  • Writing Tests

Modern C++ Design

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)

Build

  • Clone project
  • Open Project in CLion
  • Build & Run

File Structure

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

About

Logic-Emulator is a C++ object-oriented simulator for digital logic circuits, including gates, buses, and ALUs. It demonstrates clean design patterns and includes tests for logic components.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages