Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Logic gates are the basic building blocks of digital computers, calculators, phones, and many electronic control systems. Each gate takes one or more binary inputs, usually 0 or 1, and produces a binary output. By combining simple gates, engineers build circuits that add numbers, store data, compare values, and make decisions.

Truth tables matter because they show every possible input combination and the exact output for each case.

A digital circuit can be understood as a flow of logical conditions through connected gates. AND requires all inputs to be 1, OR requires at least one input to be 1, and NOT flips a value from 0 to 1 or from 1 to 0. NAND, NOR, and XOR are especially important because they can simplify circuit designs or create useful behaviors like comparison.

Reading a truth table helps you predict a circuit's output before building or programming it.

Understanding Logic Gates and Truth Tables

Inside an electronic device, a logic value is represented by a range of voltages rather than a perfectly exact number. A circuit treats a low voltage as zero and a high voltage as one. Transistors act like tiny controlled switches to create these voltage changes.

Real circuits need a safety margin between low and high ranges, since electrical noise can slightly disturb a signal. This is one reason digital systems are reliable. Small disturbances usually do not change the logical result.

A signal still takes a short time to travel through a gate. This delay is tiny, yet it becomes important when millions of gates work together at high speed.

When gates are connected, the output from one gate becomes an input for another. To work out a larger circuit, start with the gates closest to the original inputs. Record each intermediate result, then use it in the next gate.

This prevents guesses and makes mistakes easier to find. The shape of the circuit matters. Two circuits can use different groups of gates yet produce the same final output for every input row.

Engineers use logic rules to replace a complicated group with a simpler equivalent group. Fewer gates can reduce cost, power use, and delay.

NAND and NOR have a special place in circuit design. A NAND gate produces zero only for the case where every input is one. A NOR gate produces one only when every input is zero.

Either NAND gates alone or NOR gates alone can be combined to make any logical operation. These are called universal gates. XOR is useful when a circuit must detect a difference between two signals.

In a binary adder, XOR gives the sum bit for two input bits, while another part of the circuit determines whether a carry bit is needed. XOR is also used in error checking, where a result can show whether a group of bits contains an odd or even number of ones.

Truth tables are more than lists to memorise. They are a testing method. For two inputs, there are four possible rows because each input has two possible values.

For three inputs, there are eight rows. The number of rows doubles whenever another input is added. A careful table must include every case, even cases that seem unimportant.

Students often confuse inclusive OR with XOR. Inclusive OR accepts the case where both inputs are one, while XOR rejects that case. Another common error is applying a NOT operation too early.

Follow the circuit order and keep intermediate columns clear. The same habits are useful in programming conditions, such as deciding when a door alarm activates or when a game grants access to an action.

Key Facts

  • Binary logic uses only two values: 0 means false or off, and 1 means true or on.
  • AND gate: A AND B = 1 only when A = 1 and B = 1.
  • OR gate: A OR B = 1 when A = 1, B = 1, or both are 1.
  • NOT gate: NOT A = 1 when A = 0, and NOT A = 0 when A = 1.
  • NAND is the opposite of AND: A NAND B = NOT(A AND B).
  • XOR gate: A XOR B = 1 when A and B are different, and 0 when they are the same.

Vocabulary

Logic gate
A logic gate is a digital circuit element that applies a logical rule to binary inputs to produce one binary output.
Truth table
A truth table is a chart that lists every possible input combination and the output produced by a logic expression or circuit.
Binary
Binary is a number and signal system that uses only two values, 0 and 1.
Input
An input is a binary value sent into a logic gate or circuit for processing.
Output
An output is the binary value produced after a logic gate or circuit applies its rule.

Common Mistakes to Avoid

  • Treating XOR like OR is wrong because XOR outputs 1 only when the inputs are different, not when both inputs are 1.
  • Forgetting that NAND and NOR are inverted gates is wrong because NAND is NOT AND and NOR is NOT OR, so their outputs are the opposite of the basic gate results.
  • Skipping input combinations in a truth table is wrong because a complete table must include every possible row, which is 2^n rows for n inputs.
  • Reading a circuit only from left to right without following connections is wrong because outputs from one gate may feed into several later gates or loop through labeled paths.

Practice Questions

  1. 1 Complete the truth table for A AND B using all four input pairs: 00, 01, 10, and 11.
  2. 2 For inputs A = 1, B = 0, and C = 1, find the output of the circuit (A OR B) AND C.
  3. 3 A security light turns on only when motion is detected and the room is dark. Which logic gate best models this situation, and why?