Skip to content

Logic simulator

Type a Boolean expression. Toggle the inputs to see the output change, read the full truth table, get the SOP and POS forms, export Verilog, or check two expressions for equivalence.

Operators: ~ ! NOT a' · & * AND NAND · ^ XOR ~^ XNOR · | + OR NOR · && ||. Names start with a letter. Up to 8 inputs.

Inputs: click to toggle

Output y

0

Inputs
3
Rows where y = 1
4 of 8
#abciny
00000
10010
20100
30111
41000
51011
61101
71111

Syntax

What you can type

Operators bind in Verilog's order: NOT first, then AND and NAND, then XOR and XNOR, then OR and NOR, then && and finally ||. Use parentheses whenever you mean something else.

Accepted forms, highest precedence first
NOT~a !a NOT a a'
ANDa & b a * b a · b a AND b
NANDa NAND b
XORa ^ b a XOR b
XNORa ~^ b a ^~ b a XNOR b
ORa | b a + b a OR b
NORa NOR b
Logicala && b a || b

Names start with a letter and may contain digits and underscores (cin, d0, sel_n). Upper and lower case are different inputs. Writing two names side by side (ab) is not AND: use a * b. New to this? Start with logic gates or the Verilog operator reference.