PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Continue with similar topics in this category — or all 48 in Engineering.

View category →
FeaturedSchool

Logic Gate Simulator

Launch Simulator

AND, OR, NOT, NAND, XOR. Drag, drop, connect, see output.

NewSchool

RRT Path Planner (grid)

Launch Simulator

Same 40×28 wall map as A*: random samples, nearest-neighbor steer, goal bias, collision-checked edges; grow an RRT and compare summary stats with one-click Manhattan A* baseline.

NewSchool

Finite State Machine

Launch Simulator

Traffic-light Moore machine: timed green–yellow–red cycle or manual step; state graph.

NewSchool

Maze Generators + A* (Grid)

Launch Simulator

Perfect mazes on the same 40×28 cell lattice as the pathfinding lab: recursive backtracker, Wilson, Eller, or randomized Prim; then solve with Manhattan A* (4-neighbors). Paint walls or erase passages and move S/G.

NewSchool

A* / Dijkstra Pathfinding (Grid)

Launch Simulator

Interactive 40×28 grid pathfinder: A* (f=g+h), Dijkstra, or greedy best-first; Manhattan / octile / Euclidean heuristics, 4- vs 8-connectivity, paint walls + weighted cells, watch open / closed sets expand.

NewSchool

Beam Deflection: Unit Load Method

Launch Simulator

Simply supported Euler-Bernoulli beam with point load P and UDL w: closed-form deflection vs virtual-work unit-load integral.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Engineering/Truth Table Generator

Truth Table Generator

Build a circuit, auto-generate the truth table.

Inputs

2

Operators: ! NOT, & AND, | OR, ^ XOR. Use parentheses as needed.

Boolean expression

Presets

Measured values

Rows4
Expression validyes

Truth table

f = A & B
ABOUT
000
010
100
111

About this model

Digital logic circuits form the foundation of modern computing, built from fundamental gates that perform Boolean operations on binary inputs. This simulator models the behavior of combinational logic circuits, where the output depends solely on the current combination of input values. The core physics involves representing binary states (0 or 1, FALSE or TRUE, LOW or HIGH voltage) and their transformation through logic gates like AND, OR, NOT, NAND, NOR, and XOR. Each gate implements a specific Boolean algebra function. For example, an AND gate outputs 1 only if all its inputs are 1, modeled by the Boolean expression Q = A · B. An OR gate outputs 1 if at least one input is 1 (Q = A + B), while a NOT gate inverts its single input (Q = Ā). The simulator abstracts away the underlying electronic implementation—such as transistors, voltage levels, and propagation delays—to focus on the ideal, instantaneous logical relationship. By constructing circuits and observing the auto-generated truth table, students learn to predict circuit behavior, verify Boolean identities like De Morgan's Laws (e.g., ¬(A ∧ B) = ¬A ∨ ¬B), and understand how complex functions are built from simple gates. This process directly illustrates the principle of functional completeness, demonstrating how a small set of gate types (like just NAND or NOR) can be used to construct any logical function.

Who it's for: High school and undergraduate students in computer science, electrical engineering, or digital electronics courses learning Boolean algebra and combinational logic design.

Key terms

  • Boolean Algebra
  • Logic Gate
  • Truth Table
  • Combinational Logic
  • Binary
  • Boolean Expression
  • De Morgan's Laws
  • Functional Completeness

How it works

Type a combinational Boolean expression using A, B, and optionally C. The simulator parses NOT (!), AND (&), OR (|), and XOR (^), then lists every input combination and the output bit — the full truth table for your function.

Key equations

XOR: A ⊕ B = (A ∨ B) ∧ ¬(A ∧ B)

Frequently asked questions

Why does my circuit's truth table show the same output for different inputs? Isn't that a mistake?
This is likely not a mistake but a feature of your specific circuit's logic function. Some circuits are designed to detect specific input patterns, producing a '1' only for those combinations and a '0' for all others. For example, a circuit that checks if two bits are equal will output 1 for (0,0) and (1,1), and 0 for (0,1) and (1,0). Review your Boolean expression to understand the logical condition your circuit implements.
How is this abstract logic related to real physical computers?
The logic gates you build with are abstractions of physical electronic components, primarily transistors arranged into circuits called CMOS. A '1' typically represents a high voltage (e.g., 3.3V) and a '0' a low voltage (e.g., 0V). The simulator ignores real-world timing delays and power consumption, but the logical relationships are identical. Every operation in your computer's processor is ultimately performed by vast networks of these microscopic logic gates.
What is the difference between a truth table and a Boolean expression?
A truth table and a Boolean expression are two equivalent ways to define the same logical function. The truth table is an exhaustive list of all possible input combinations and their corresponding outputs. The Boolean expression is a compact algebraic formula using variables and operators (AND, OR, NOT). The simulator automatically derives one from the other, showing their direct equivalence. For complex circuits, the expression is more concise, while the truth table makes the function's behavior completely explicit.
Can I build a circuit that 'remembers' a state, like a light switch, with this simulator?
No, this simulator specifically models *combinational* logic, where outputs depend only on current inputs. A circuit that remembers or stores state requires *sequential* logic, which incorporates feedback loops and clock signals to create elements like flip-flops and latches. These are fundamental for building memory and are a crucial next topic after mastering the combinational circuits modeled here.