-
Notifications
You must be signed in to change notification settings - Fork 1
1. Expressions
Currently, 8 operators are supported.
-
AND,&,. -
OR,|,+ -
NOT,!,¬ XORNANDNORXNOR-
IMPLIES,=>
Aliases can be used interchangeably in the same expression.
Of course, you can use brackets to group expressions. Every type of bracket can be used, which may help distinguish groupings: () [] {}.
Any characters in an expression which aren't operators or brackets are considered variables. Variables can be any length, this allows for numbered variables (i.e., D_0).
To provide an order in which the variables should be printed, give a comma separated list of variables after your expression, separating these parts with a semicolon (;). If this isn't given, the variables are stored in the order they appear in the expression.
For example,
-
D0.!S + D1.Swould be orderedD0,S,D1 -
D0.!S + D1.S;S,D0,D1would be orderedS,D0,D1
As the same parser class is used throughout every project, these rules apply in both the CLI and Web UI.
Here are a few example expressions.
-
A & B- A simple AND gate
-
A OR B- A simple OR gate
-
!S . D_0 + D_1 . S- A 2-1 multiplexer
-
(!S0 AND ¬S1 . D0) | (NOT{S0} . S1 . D1) + (S0 . {¬S1 & D2}) OR [S0 . S1 AND D3]- A 4-1 multiplexer, using several aliases for operators and brackets