Skip to content
BetterDL

Evaluating a Boolean expression

Also called: evaluate, evaluation, evaluating expressions, evaluating an expression, expression evaluation

Finding an expression's 0 or 1 value for given inputs: substitute the values, then do NOT, then AND, then OR.

To evaluate an expression, you substitute 0s and 1s for its variables and work out the result, following operator precedence:

  1. Brackets and long bars first, from the inside out.
  2. NOT: flip every barred letter.
  3. AND: work out each product. A product is 1 only if every factor is 1.
  4. OR: the sum is 1 if any term is 1.

Two shortcuts save time:

  • An OR is 1 as soon as you find one term equal to 1, so you can stop early.
  • A product is 0 as soon as you find one factor equal to 0.

Evaluating is how you fill in a truth table row by row, how you check a simplification, and how you find a counterexample. It is also exactly what the circuit does: each gate computes its part as soon as its inputs settle.

Worked examples

Example

A long bar and a product

Evaluate when A = 1, B = 0, C = 1.

  1. 1.

    Under the long bar: = 1 + 0 = 1, so = 0.

  2. 2.

    First product: 0 · C = 0.

  3. 3.

    Second product: = 1, so = 1 · 1 = 1.

  4. 4.

    OR: 0 + 1 = 1. Result: 1.

Example

Flip first

Evaluate when A = 0, B = 0, C = 1.

  1. 1.

    NOT: = 1 and = 0.

  2. 2.

    AND: = 0 · 1 = 0.

  3. 3.

    OR: 0 + 0 = 0.

  4. 4.

    Result: 0. Forgetting to flip C would wrongly give 1.

Common mistakes

  • Forgetting to flip a barred letter before using it.

  • Doing OR before AND, which regroups the expression.

  • Flipping each letter under a long bar separately instead of evaluating what is under it first and then flipping once.

Practice Evaluating a Boolean expression

Interactive questions with instant feedback and a worked solution for every wrong answer.

Learn it step by step

Evaluating a Boolean expression is taught in Boolean Algebra.