Skip to content

konstantinoszoropoulos/Half_Adder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Digital Circuits: Half Adder C++ Module


Overview

This repository contains a modular, "plug-and-play" simulation of a Half Adder digital circuit implemented in C++. It is designed to be easily dropped into larger digital logic simulation projects.

The module encapsulates logic within the DigitalCircuits namespace to prevent naming conflicts and utilizes static methods for efficient, stateless computation.


Features

  • Plug & Play: Encapsulated in a header-only file (.hpp) for easy inclusion.

  • Namespace Protection: All logic is contained within the DigitalCircuits namespace.

  • Efficient: Uses bitwise operators for $\mathcal{O}(1)$ simulation of logic gates.

  • Demo Included: Comes with a main.cpp driver to demonstrate functionality and input validation.


File Structure

  • HalfAdder.hpp: The core module containing the logic class.

  • main.cpp: A demonstration program that accepts user input and simulates the circuit.


Logic Theory

A Half Adder is a combinational arithmetic circuit that adds two numbers and produces a sum bit ($S$) and carry bit ($C$).


Releases

No releases published

Packages

 
 
 

Contributors