Explore the behavior of a single logic gate
This logic gate simulator lets you choose AND, OR, NOT, XOR, NAND or NOR and toggle the inputs between low and high. It shows the current operation and its binary output. Use it to check a gate definition, learn the difference between inclusive OR and XOR, or verify one small step while solving a Boolean logic exercise.
The page evaluates one selected gate at a time. It does not provide a circuit canvas, connected wires, flip-flops, clocked state or an exportable schematic. That makes it a focused place to inspect a gate without setting up a larger digital circuit. For a full expression with several operators, use the truth table generator.
What AND, OR and NOT mean
For Boolean inputs, AND is written Y = A ∧ B and is high only when both inputs are high. OR is Y = A ∨ B and is high when either input is high, including the case where both are high. NOT is Y = ¬A and reverses the value of its single input.
These are logical states rather than simulated voltages. A zero on this page means false or low, and a one means true or high. Real hardware defines valid voltage ranges and noise margins in its datasheet; the simulator does not infer an IC family, supply voltage or electrical threshold from the selected gate.
When you choose NOT, Input B disappears because the operation depends only on A. A previously selected B value has no effect on the output in this mode. Change A and check that the output always becomes its opposite before moving on to the two-input operations.
XOR, NAND and NOR formulas
XOR is Y = A ⊕ B. For the two-input gate here, it is high when the inputs differ and low when they match. This differs from OR only when both inputs are high: OR remains high, while XOR becomes low. Toggling that particular combination is a useful way to remember the distinction.
NAND is Y = ¬(A ∧ B), which means it inverts the AND result. NOR is Y = ¬(A ∨ B), which inverts the OR result. The negation applies to the complete expression inside the parentheses, not just one input. Read the gate name before predicting the output; otherwise it is easy to answer the underlying AND or OR question and forget the inversion.
Worked truth table for the supported gates
The rows below were evaluated with the simulator's own gate expressions. Select a gate, set A and B to match a row, then compare the displayed output with that column.
| A | B | AND | OR | XOR | NAND | NOR |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 |
For NOT, A = 0 gives Y = 1, and A = 1 gives Y = 0. No second input is needed. For a worked comparison, set A = 1 and B = 1, then switch between AND, XOR and NAND. Their results are respectively 1, 0 and 0, showing how changing the operation changes the answer without changing either input.
The logic gates guide develops these truth tables and their interpretation. The table on this page is a reference for checking combinations; the interactive panel displays the selected combination rather than automatically listing every row.
Building intuition without confusing operations
Think of AND as requiring simultaneous conditions and OR as accepting alternatives. XOR answers a different question: do the inputs disagree? For a larger set of bits, repeated XOR can describe parity, but this page has only the two-input XOR operation and does not generate a parity bit for an entire message.
NAND and NOR are each functionally complete: suitably connected gates of either type can express other Boolean functions. You can illustrate inversion by considering a NAND with identical inputs, or a NOR with identical inputs. This simulator lets you check those input cases individually; it does not wire multiple gates together to construct the complete replacement circuit.
For operations across corresponding positions in binary words, use the binary calculator. A bitwise AND applies the same gate rule independently to each aligned bit position, while arithmetic addition also needs carries. The single-gate view is a useful foundation, but it is not itself a binary adder.
Common mistakes and where to go next
Do not interpret the word OR as excluding the both-high case; that exclusion belongs to XOR. Do not treat NAND as AND with a permanently inverted input; its output is the complement of the complete AND operation. Finally, check the truth table of a proposed expression rather than assuming a similar-looking symbol means the same function.
The model has no propagation delay, transient glitches, unknown state or floating input. Its inputs are explicitly chosen Boolean values, and changing one does not model the analog transition between voltage levels. Hardware timing and electrical compatibility require device data and an appropriate circuit analysis.
When the next task is simplifying a Boolean function instead of checking one gate, use the Karnaugh map solver. First establish which input combinations should produce a high output, then simplify that function. Correct truth-table rows are the starting point for a useful simplified expression.