【文件属性】:
文件名称:logic-circuit.js
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-06 00:02:08
JavaScript
逻辑电路模拟器
例子
// y = (x1 + !x2) * x3
import { HIGH , LOW , And , Or , Not , Pin } from 'logic' ;
let or = new Or ( 2 ) ;
let and = new And ( 2 ) ;
let not = new Not ;
let x1 = new Pin ( LOW ) ;
let x2 = new Pin ( LOW ) ;
let x3 = new Pin ( LOW ) ;
let y = new Pin ;
x1 . connectTo ( or . inputPinAt ( 0 ) ) ;
x2 . connectTo ( not . inputPinAt ( 0 ) ) ;
not . connectTo ( or . inputPinAt ( 1 ) ) ;
or . c
【文件预览】:
logic-circuit.js-master
----test()
--------logic-test.js(901B)
----README.md(627B)
----.gitignore(27B)
----index.js(4KB)
----package.json(315B)