This Gist is experimental logic circuit description with C#.
I think, using Reactive Extension(Rx), we can write electrical circuit easily.
Previous Gist Code
This class means logic wire. Logic gates are defined as operator override. "Vcc" and "GND" are defined. Factory method "CreateWithDefault" also defined.
This class means logic bus, set of ligic wire. Logic gates, Vcc, GND and factory methods are defined like LogicLine class. Notice : Using ImmutableArray, Immuable Collection Package is required.
If we define component once, we can use it everywhere.
- HalfAdder.cs FullAdder.cs
Half Adder and Full Adder are simple combinational logic circuits. - NbitAdder.cs
NbitAdder is a group of FullAdder. Input and Output are Bus. - Selector.cs
Selector is a simple selector. Nbit Selector is simple, too.
Circuit description sample. bus A, B are changed by timer and circuit results are changed immediately.