Logic circuit
A logic circuit is given by a list of connections, each either
- from a logic gate X to an input n of another logic gate Y as: X => Y.n;
- or from an input I to an input n of a logic gate Y as: I => Y.n;
- or from a logic gate X to an output O as: X => O;
Undefined elements
I,O are treated as inputs or outputs, respectively. The remaining elements, i.e., logic gates, are defined in the declarations, e.g.:
components = A:NOT, B:XOR-nnin, C:XOR, D:AND, E:AND, F:OR;More than two inputs are defined by a series of
n and
i (cf.
B in the example) for 'normal' and 'inverted' inputs, respectively.
Hint: Combine rules on left side, right side or both:
| A | => | B | C; |
| A | B | => | C; |
| A | B | => | C | D; |