PHPackages                             jan-wennrich/logic-gates - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jan-wennrich/logic-gates

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

jan-wennrich/logic-gates
========================

Library to simulate circuits using gates like AND, OR, XOR.

1.0.0(7mo ago)00[1 issues](https://github.com/JanWennrich/Logic-Gates/issues)GPL-3.0-or-laterPHPPHP &gt;=8CI passing

Since Oct 5Pushed 7mo agoCompare

[ Source](https://github.com/JanWennrich/Logic-Gates)[ Packagist](https://packagist.org/packages/jan-wennrich/logic-gates)[ RSS](/packages/jan-wennrich-logic-gates/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (2)Used By (0)

Logic Gates
===========

[](#logic-gates)

A tiny PHP library for building and simulating digital circuits from simple logic gates (e.g., `AND`, `OR`, `NOT`, `XOR`) and composing them into larger combinational networks.

✨ Features
----------

[](#-features)

- All common boolean gates:
    - `AND` &amp; `NAND`
    - `OR` &amp; `NOR`
    - `XOR` &amp; `XNOR`
    - `NOT` &amp; `BUFFER`
    - `IMPLY` &amp; `NIMPLY`
    - `TRUE` &amp; `FALSE`
- Compose gates into circuits by wiring outputs to inputs
- Zero dependencies
- Unit tested

📦 Installation
--------------

[](#-installation)

This project is a standard Composer library.

```
composer require jan-wennrich/logic-gates
```

🚀 Example
---------

[](#-example)

The example shows how the `AND` gate works:

```
