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
| # | a | b | cin | y |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 |
| 2 | 0 | 1 | 0 | 0 |
| 3 | 0 | 1 | 1 | 1 |
| 4 | 1 | 0 | 0 | 0 |
| 5 | 1 | 0 | 1 | 1 |
| 6 | 1 | 1 | 0 | 1 |
| 7 | 1 | 1 | 1 | 1 |
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.
| NOT | ~a !a NOT a a' |
|---|---|
| AND | a & b a * b a · b a AND b |
| NAND | a NAND b |
| XOR | a ^ b a XOR b |
| XNOR | a ~^ b a ^~ b a XNOR b |
| OR | a | b a + b a OR b |
| NOR | a NOR b |
| Logical | a && 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.