How to build a truth table

List the inputs as columns and write every input combination as a row, usually in binary counting order from all zeros to all ones, then add one column per output. With n inputs there are 2ⁿ rows. A two-input XOR, for example, has four rows and outputs 1 only for 01 and 10. A circuit with several outputs, such as a half adder with sum and carry, simply gets several output columns sharing the same input rows.

From table to Boolean expression

Every row whose output is 1 corresponds to a minterm, a product of all inputs in true or complemented form. ORing those minterms gives the canonical sum-of-products expression. Working from the 0 rows instead gives maxterms and the product-of-sums form. These canonical expressions are correct but usually far from minimal, so the next step is simplification with Boolean algebra, a Karnaugh map or a software minimizer.

Don't-care entries

Some input combinations can never occur or have outputs that do not matter. A circuit that decodes binary-coded decimal (BCD) digits, for instance, never sees the patterns 1010 through 1111. Such rows are marked X, a don't-care. During simplification each X can be treated as 0 or 1, whichever produces larger groups and a smaller circuit, so recording don't-cares explicitly often saves gates.

Why truth tables stop scaling

Because the row count doubles with every input, exhaustive tables are practical only for small blocks. A 32-bit adder has 64 inputs and would need 2⁶⁴ rows. Large designs are therefore described hierarchically with Boolean expressions or a hardware description language (HDL) and verified by simulation and formal equivalence checking. Sequential circuits also need more than a plain truth table: their state tables add the present state as an input and the next state as an output.

Try it: questions about Truth table

How many rows does the truth table of a 3-input logic circuit have?

  1. A6
  2. B9
  3. C8
Show answer and explanation

Answer: C. 8

Each input is either 0 or 1, so three inputs have 2³ = 8 combinations and the truth table has eight rows. With n inputs it grows exponentially to 2ⁿ rows; a 32-bit adder (64 inputs) would need 2⁶⁴ rows, which is impractical. Large circuits are therefore built from small blocks and described and verified with Boolean expressions or HDL.

FAQ

How many rows are in a truth table with n inputs?

2ⁿ rows, since each input can be 0 or 1. Three inputs give 8 rows, four give 16 and so on.

What is the difference between a truth table and a Karnaugh map?

They hold the same information. A Karnaugh map rearranges the rows into a grid in Gray-code order so that logically adjacent combinations sit next to each other and can be grouped for simplification.

Can a truth table describe a flip-flop?

Not as a plain combinational table. Flip-flops are described with characteristic or state tables that include the present state as an input column and the next state as an output.

Questions that mention Truth table (1)

Truth table appears in 2 practice questions across 1 topic, including Logic circuits.

  1. What is the main use of a Karnaugh map?

Books on Logic circuits Ad

Learn hands-on: parts and kits

Building real circuits is a good way to check what you learned in the questions.

As an Amazon Associate I earn from qualifying purchases.

Semiconductor, Electronics and Computing Calculators

This page was drafted with AI and fact-checked by a separate AI review before publication. Our Editorial policy explains how we write and check content. If you spot an error, please tell us on our Contact page.

Back to the glossary