TechKnowSurge
CompTIA Tech+ 4.2
InteractiveComputeFree

Logic Gate Truth Table Explorer

Pick a logic gate, flip the input switches, and watch the output lamp and the truth table agree with each other in real time.

Complete this interactive to capture a CTF flag worth 1 point.

About this interactive

What you're seeing: a palette of the seven logic gates, a schematic with switches on its inputs and a lamp on its output, and that gate's complete truth table sitting beside it with the current row highlighted. A second mode wires three gates of your choosing into one circuit and shows the intermediate values on the wires. Why it matters: gates are normally met as seven tables to memorize, and memorized tables are exactly the wrong tool — they look alike, NAND and NOR are trivially swapped, and none of it survives contact with a circuit that has more than one gate in it. The tables here are not something to hold in your head; they are generated in front of you from the gate you picked, and the row you are standing on lights up as you flip the switches, so the table stops being a thing to remember and becomes a thing to read. The gate symbols are the real distinctive shapes rather than labelled boxes, which does a specific job: the inversion bubble on NAND's output is drawn in the same place as the bubble on NOR's and on NOT's, so the family relationship between AND and NAND is visible rather than asserted. A student who has seen that bubble three times does not need to memorize NAND's table at all — they can derive it from AND's. XOR earns its own back arc for the same reason. The compound mode is where the ideas stop being about single gates. It fixes three gates in a topology with one deliberate fan-out — G1 takes A and B, G2 takes B and C, and G3 takes the two results — and writes the intermediate values X and Y directly on the wires that carry them. That is the whole of what makes a processor possible: a gate's output is an input like any other, and complicated behaviour is a lot of very simple behaviour wired in series. Reusing B across two gates is not an accident of layout; fan-out is how a real circuit avoids duplicating a signal, and the junction dot is drawn so it can be seen happening. How to use it: start in single mode and make a prediction before flipping anything — say out loud what AND will do with 1 and 0, then flip and check. Do it for all seven gates, and pay particular attention to the pairs: AND against NAND, OR against NOR, XOR against XNOR. Then switch to compound mode, set all three gates to something and try to predict Z from the input switches alone before you look at the table. This sits directly on top of the module's Gates lesson, and it is a useful thing to have open while working through the Half-adder lesson that follows it: a half-adder is XOR and AND fed by the same two inputs, which is exactly the fan-out shape the compound mode draws.

How to use this tool

A logic gate takes one or two binary inputs and produces exactly one binary output. Its truth table lists every input it could ever be given, next to the output it produces for each — so the table is not a summary of the gate, it is the gate.

Single gate mode:

  • Pick a gate from the palette — AND, OR, NOT, NAND, NOR, XOR, XNOR.
  • Flip the A and B switches. The wires light up teal for 1 and stay grey for 0.
  • Watch the highlighted row in the truth table move to match the switches you just set. The lamp and the highlighted row always agree, because they are computed the same way.
  • NOT is the only gate with a single input, so its table has two rows instead of four.

Compound circuit mode chains three gates together: G1 takes A and B, G2 takes B and C, and G3 takes the two results — X and Y — and produces the final output Z. Choose a gate for each of the three positions, then flip the switches and follow the lit wires from left to right. The table shows X, Y and Z for all eight input combinations at once.

Nothing here is graded and there is nothing to submit. Try to predict the output before you flip a switch, then check yourself against the lamp.

What you'll learn

Aligned to

CompTIA Tech+
4.2 Given a scenario, use programming organizational techniques and interpret logic.

Key terms

Logic Gate
A basic electronic circuit that performs a Boolean operation on one or more binary inputs to produce a single binary output.
Truth Table
A table that lists all possible input combinations for a logic gate and their corresponding output values.
AND Gate
A logic gate that outputs 1 only when all inputs are 1; outputs 0 in all other cases.
OR Gate
A logic gate that outputs 1 when at least one input is 1; outputs 0 only when all inputs are 0.
NOT Gate
A logic gate that inverts its single input, outputting 1 when the input is 0 and 0 when the input is 1.
Binary
The base-2 number system that uses only the digits 0 and 1; the native language of digital computers, which store and process data as electrical on/off states.
Bit
Short for binary digit, the smallest unit of data in computing, holding a single value of 0 or 1; all digital information is ultimately composed of bits.
Transistor
A microscopic electronic switch found in microprocessors that represents a binary one (on) or zero (off) using electrical voltage.

Topics

Logic Gates Boolean Logic Truth Tables Binary Digital Logic And Or Xor Circuits

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →