Menu

Truth tables

Two-Input Truth Tables

A two-input truth table shows the output of an expression such as A AND B for every combination of its two inputs. Two inputs give 2 × 2 = four rows: 00, 01, 10 and 11.

AND and OR

AND gives 1 only when both inputs are 1. OR gives 1 when at least one input is 1, including when both are, so it is 0 only in the row where both inputs are 0.

ABA AND BA OR B
0000
0101
1001
1111

A quick check: the AND column has a single 1, in the last row, and the OR column has a single 0, in the first.

NOT with two inputs

NOT works on one value, turning 1 into 0 and 0 into 1. In a two-input expression it applies to just the input or bracket it is written in front of. For A AND NOT B, work out NOT B in its own column first, then AND it with A.

ABNOT BA AND NOT B
0010
0100
1011
1100

For example, a games console lets you play online when you are signed in (A) and you are NOT banned (B). Only the row where A is 1 and B is 0 gives 1, so that is the only situation in which you can play online.

Practise this