This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

logical-gates-ts
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

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
0 0 0
0 1 0
1 0 0
1 1 1

Example:

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

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

OR

INPUT OUTPUT
0 0 0
0 1 1
1 0 1
1 1 1

Example:

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

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

XOR

INPUT OUTPUT
0 0 0
0 1 1
1 0 1
1 1 0

Example:

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

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

NAND

INPUT OUTPUT
0 0 1
0 1 1
1 0 1
1 1 0

Example:

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

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

NOR

INPUT OUTPUT
0 0 1
0 1 0
1 0 0
1 1 0

Example:

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

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

XNOR

INPUT OUTPUT
0 0 0
0 1 1
1 0 1
1 1 0

Example:

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

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

Package Sidebar

Install

npm i logical-gates-ts

Weekly Downloads

8

Version

1.2.0

License

GPL-3.0

Unpacked Size

88.3 kB

Total Files

14

Last publish

Collaborators

  • kbedeveloper