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