Use this interactive logic gates simulator to test binary inputs, compare outputs, and see the matching boolean expression and truth table for each gate.

How to use the logic gates simulator

1

Choose a gate

Select AND, OR, NOT, NAND, NOR, XOR, or XNOR. The circuit rule changes instantly.

2

Switch inputs

Turn input A and input B on or off. For NOT, only input A is needed.

3

Read the expression

The boolean expression updates automatically for the selected logic gate.

4

Check the truth table

The truth table highlights the row that matches the current input values.

Core idea

Logic gates are the building blocks of digital circuits. Each gate follows a rule that changes one or two binary inputs into one binary output. A boolean expression writes the rule in symbols, and a truth table lists every possible result.

Boolean expressions used

GateBoolean expressionMeaning
ANDY = A · BOutput is 1 only when A and B are both 1.
ORY = A + BOutput is 1 when at least one input is 1.
NOTY = ĀOutput is the opposite of A.
NANDY = (A · B)̄Output is the opposite of AND.
NORY = (A + B)̄Output is the opposite of OR.
XORY = A ⊕ BOutput is 1 when the inputs are different.
XNORY = A ⊙ BOutput is 1 when the inputs are the same.

What students should notice

Binary values

Digital circuits use 0 and 1. These can also be read as false and true, or off and on.

Opposite gates

NAND is the inverse of AND, NOR is the inverse of OR, and XNOR is the inverse of XOR.

Truth tables

A two-input gate has four possible input rows: 00, 01, 10, and 11.

NOT is different

The NOT gate has one input, so its truth table has only two rows.

Frequently asked questions

What are logic gates?

Logic gates are basic digital circuit parts that use binary inputs to create a binary output.

What is a boolean expression?

A boolean expression is a symbolic rule for a logic gate, such as Y = A · B for an AND gate.

Why does the NOT gate use only one input?

NOT is an inverter. It changes one input into its opposite value, so it does not need a second input.

What is the difference between XOR and XNOR?

XOR is 1 when the inputs are different. XNOR is 1 when the inputs are the same.

Leave a Comment