Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
/ logical-gates-ts Public archive

A simple (zero-deps) educational-oriented library for JavaScript/TypeScript to implement logic gates operations

License

Notifications You must be signed in to change notification settings

KBeDevel/logical-gates-ts

Repository files navigation

Logical Gates

A simple (zero-dependencies) library to implement logic gates in JavaScript/TypeScript.

CircleCI types GitHub code size in bytes Codacy Badge Codacy Badge

Installation

Using NPM:

npm install logical-gates-ts

Using Yarn:

yarn add logical-gates-ts

Using pnpm:

pnpm add logical-gates-ts

How it works

This section provide the mathematical/logical description scheme for each logic gate

AND

INPUT OUTPUT
000
010
100
111

Example:

import { LogicalGates } from 'logical-gates-ts'

LogicalGates.AND(true, false) // -> false

OR

INPUT OUTPUT
000
011
101
111

Example:

import { LogicalGates } from 'logical-gates-ts'

LogicalGates.OR(true, false) // -> true

XOR

INPUT OUTPUT
000
011
101
110

Example:

import { LogicalGates } from 'logical-gates-ts'

LogicalGates.XOR(true, false) // -> true

NAND

INPUT OUTPUT
001
011
101
110

Example:

import { LogicalGates } from 'logical-gates-ts'

LogicalGates.NAND(true, false) // -> true

NOR

INPUT OUTPUT
001
010
100
110

Example:

import { LogicalGates } from 'logical-gates-ts'

LogicalGates.NOR(true, false) // -> false

XNOR

INPUT OUTPUT
000
011
101
110

Example:

import { LogicalGates } from 'logical-gates-ts'

LogicalGates.XNOR(true, false) // -> true

About

A simple (zero-deps) educational-oriented library for JavaScript/TypeScript to implement logic gates operations

Topics

Resources

License

Stars

Watchers

Forks