Skip to content

ahuth/emitter-gates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emitter-gates

Logic gate simulation based on Node EventEmitters.

While logic gates can be implemented as pure functions (see Logic Gates in JavaScript and https://github.com/ahuth/bit-adder), they can't easily model circuits that require a delay.

For example, an oscsillator generally requires a feedback loop, and therefore a delay, for it to work. This project is an exploration of APIs that better support such circuits. By basing the simulation on events emitters, we can easily introduce slight a slight delay between the time a logic gate receives a signal, and the time the output signal is sent.

Working through this reminded me of the A Simulator for Digital Circuits exercise in Structure and Interpretation of Computer Programs.

Usage

Tests can be ran with the following command:

yarn test

About

EventEmitter-based logic gates

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages