#1 India's Top IT Training Institute

×

About Uncodemy

Know more about who we are and what we stand for.

About Us

About Us

Discover our mission to equip individuals with essential IT skills and industry expertise.

Read More →
UnCodeMy Gallery

UnCodeMy Gallery

Explore highlights from our IT training sessions and success stories.

Read More →
×

Free Resources

Learn, practice and plan your career — bilkul free.

Tutorials

Tutorials

Step-by-step written tutorials to learn any technology at your own pace.

Read More →
Free Counselling

Free Counselling

Book a free video counselling session and pick the right course for you.

Read More →
Online Compiler

Online Compiler

Write, run and test your code online — no setup required.

Read More →
⚡ FREE · 7 GATES + CIRCUITS

Logic Gate Simulator: Flip the Switches, Watch the Output

Try every logic gate with clickable inputs, or build a circuit from Boolean expressions.

  • 🔌 Clickable input switches
  • ➕ Half and full adder
  • 📋 Truth tables

How to use the Logic Gate Simulator

  1. 1. Pick a gate or a circuitOne gate with 2–4 inputs, or expressions like S = A ^ B.
  2. 2. Flip the inputsClick the switches or Tab to them and press Space.
  3. 3. Get the truth tableSee every input combination and the outputs.

The seven gates

  • AND: 1 only when all inputs are 1.
  • OR: 1 when any input is 1.
  • NOT: flips its single input.
  • NAND and NOR: AND and OR followed by NOT. Each one alone can build any circuit, so they're called universal gates.
  • XOR: 1 when an odd number of inputs are 1; with two inputs, when they differ.
  • XNOR: the opposite of XOR; 1 when the inputs match.

In circuit mode you write one output per line. Operators include ! or ' for NOT, & or · for AND, | or + for OR, ^ for XOR, and the words AND, OR, NOT, XOR, NAND, NOR and XNOR. NOT binds tightest, then AND, XOR and OR, and writing letters side by side, like AB, means AND. The expressions are read by a small parser in your browser, never run as code.

Worked example: a full adder

Pick the Full adder preset:

S = A ^ B ^ Cin
Cout = (A & B) | (Cin & (A ^ B))

Set A = 1, B = 1 and Cin = 1: S = 1 and Cout = 1, because 1 + 1 + 1 = 3 = binary 11. The truth table has 8 rows; Cout reads 0, 0, 0, 1, 0, 1, 1, 1 down the column, which is 1 whenever at least two inputs are 1.

Chain four of these together and you have a 4-bit ripple-carry adder, the circuit inside every CPU's arithmetic unit. Other presets include a half adder, a 2-to-1 multiplexer, NAND built from AND and NOT, and XOR built from basic gates.

Frequently asked questions

Can I write A'B + AB'?

Yes. ' after a variable means NOT, and AB means A AND B, so that's XOR.

How many inputs can a circuit have?

Up to 6 variables, which gives a 64-row truth table.

Can it simplify my expression?

Not here. Use the K-Map Solver to simplify Boolean expressions.

Is the logic gate simulator free to use?

Yes, the logic gate simulator is free and costs nothing. Showing your first truth table shows a short form for your name and WhatsApp number one time; once that's done, this tool and every other Uncodemy tool open with no form.

More free tools

See all free tools