# digital-logic

> A collection of digital logic utilities

Latest version **0.2.0** (published 2022-10-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install digital-logic
pnpm add digital-logic
yarn add digital-logic
bun add digital-logic
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-10-11 |
| First published | 2022-09-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 69.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Archaeopteryx1 |
| Maintainers | snowflake7 |
| Keywords | digital, logic, logic-gates, digital-logic, circuit |

## Links

- npm: https://www.npmjs.com/package/digital-logic
- Repository: https://github.com/Archaeopteryx1/digital-logic
- Homepage: https://github.com/Archaeopteryx1/digital-logic#readme
- Issues: https://github.com/Archaeopteryx1/digital-logic/issues
- npm.io page: https://npm.io/package/digital-logic

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2022-10-11
- 0.1.1 — 2022-10-01
- 0.1.0 — 2022-09-30

## README

# Digital Logic

A collection of digital logic utilities

# Installation

```sh
$ npm install digital-logic
```

# Included Utilities
* ✅ Logic gates
* ✅ Half adder
* ✅ Full adder
* ✅ Half subtractor
* ✅ Full subtractor
* ✅ Logic gates - truth table generator
* ✅ Signal generator
* ✅ Encoder
* ✅ Decoder
* ✅ Bits utilities
* ✅ Number system utilities
* ✅ Multiplexer
* ✅ Demultiplexer
* ✅ Magnitude Comparator

# TODO
* K-Map Utilities
* and more...

# Examples

## Logic Gates

```js
const { LogicGates } = require("digital-logic");

LogicGates.AND(0, 0); // 0
LogicGates.AND(0, 1); // 0
LogicGates.AND(1, 0); // 0
LogicGates.AND(1, 1); // 1
```

## Full Adder

```js
const { Adder } = require("digital-logic");

const values = {
    input1: 1,
    input2: 1,
    carry: 1
};

Adder.fullAdder(values.input1, values.input2, values.carry); // { sum: 1, carry: 1 }
```

## Generate 3-bit signals

```js
const { BitsUtil } = require("digital-logic");

BitsUtil.generateSignals(3);
/*
[
    [0, 0, 0],
    [0, 0, 1],
    [0, 1, 0],
    [0, 1, 1],
    [1, 0, 0],
    [1, 0, 1],
    [1, 1, 0],
    [1, 1, 1]
]
*/
```

# Contributing

Please see the **[Contributing Guide](https://github.com/Archaeopteryx1/digital-logic/blob/main/CONTRIBUTING.md)** for this project.

---
_Source: https://npm.io/package/digital-logic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
