Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/twlite/digital-logic
A collection of digital logic utilities
https://github.com/twlite/digital-logic
api digital-logic hacktoberfest logic-gates
Last synced: about 1 month ago
JSON representation
A collection of digital logic utilities
- Host: GitHub
- URL: https://github.com/twlite/digital-logic
- Owner: twlite
- License: mit
- Created: 2022-09-30T17:18:06.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-27T16:18:49.000Z (over 1 year ago)
- Last Synced: 2024-10-08T16:38:42.837Z (about 1 month ago)
- Topics: api, digital-logic, hacktoberfest, logic-gates
- Language: TypeScript
- Homepage:
- Size: 52.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
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.