SimonBuxx / LogiJS

Discover and create logic circuits
https://logijs.com
GNU General Public License v3.0
42 stars 6 forks source link

Support for Trinary or Quaterary values #105

Open OracularSpy opened 1 year ago

OracularSpy commented 1 year ago

the first two can be the same as-is, but the third value can be a "no-connect" or "disconnected" signal.

an idea for colors:

0xFF0000 - on 0x7F0000 - off 0x000000 - disconnected

an unknown connection can be shown as a wire flashing between "on" and "off", but the three mentioned are sufficient. the fourth value can be substituted by logically ORing all its inputs, just like how the current version does it

with the "disconnected" state, a new buffer type can be added: it has 2 inputs, the first input can be a bus input. the output depends on the second input. if the second input is false, then the output is "disconnected". if the second input is true, the first input is copied to the output

otherwise a "disconnected" state is sent to the output. this can also take advantage of the bus input

buttons and switches will simulate connections when editing a circuit

also, please add a bus output

OracularSpy commented 1 year ago

now that i think about it, a nullable boolean can accomodate for null being the third state. also allows for easy high-Z scanning