Skip to content

casatir/Logic-Circuit-Simulator

 
 

Repository files navigation

Logic Circuit Simulator

A logic circuit simulator useful for educational use.

This is a fork followed by an almost complete rewrite of drendog's Logic-Circuit-Simuator.

Demo

See https://jp.pellet.name/hep/logiga/

Development

  • Checkout with git
  • npm install
  • Open VS Code and open folder
  • npm run compile-watch to run the TypeScript compiler (without output) to check for errors
  • npm run lint-watch to run eslint to check for linting errors
  • npm run bundle-watch to build the bundle with esbuild (can be done on every save because esbuild is so fast)
  • npm run server to serve locally for testing on port 8080

Differences with Original Version

  • This fork is completely written in TypeScript
  • Based on web components so that it can easily be embedded by pulling in a single JS file
  • Dependency on p5 was removed
  • Interface is drawn differently, all with canvas calls and no external images
  • Screen is only refreshed when needed and not 60 times per second no matter what
  • Clocks can be paused
  • Components have been added: bit display, segment display, nibble display, half adder, muxes, register, RAM, counter, various decoders, etc.
  • Mouseover tooltips have been added
  • Components can be edited to be faulty, for educational exercises
  • Editor can be in several modes with different capabilities
  • Component buttons can be hidden or shown for educational purposes with URL parameters
  • Loading and saving using JSON is much cleaner and does not include unnecessary properties
  • Demo circuits are predefined and can be loaded from the JavaScript console
  • Circuits can be loaded from a JSON export by drag-n-drop
  • An animated propagation delay can be set
  • UI is in French (for now, could be translated upon request)

License

MIT

About

A logic circuit simulator for educational purposes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 96.8%
  • HTML 1.3%
  • Other 1.9%