Logout

Home Topic 2 Last Next

2.1.12

Construct truth tables using the above operators. (AND, OR, NOT, NAND, NOR and XOR)

 

Teaching Note:

For example, Maria won’t go to school if it is cold and raining or she has not done her homework.

Not more than three inputs are used.

LINK Thinking logically.

TOK Reason as a way of knowing.


 

Sample Question:

sdfsdfsf

Representing Outcomes of Two Inputs With Truth Tables

The last assessment statement was aimed at defining, as a dictionary would, AND, OR etc. logic gates. This assessment statement is about visually showing all the possible outputs of particular logic gates, depending on the inputs. We do so via "truth tables".

When there are only two possible boolean inputs, that makes for four possible variations of inputs.

The four possible inputs with two boolean on/off switches or states are:

 

At this point it would be a good idea to at least take a peak at circuit diagrams to make the connection between truth tables and circuits.

  In context of circuits / booleans / binary
 

Input / variable / digit
A

Input / variable / digit
B

1st possible combo: off / false / 0 off / false / 0
2nd possible combo: off / false / 0 on / true / 1
3rd possible combo: on / true / 1 off / false / 0
4th possible combo: on / true / 1 on / true / 1

 

We can show these facts in summary form with simple "truth tables"

The diagram below shows the AND and OR truth tables, and also their equivalent circuit representations.

Here are the boolean operation symbols we use in truth tables:

AND:   a thick dot
OR:    a + sign
NOT:   a line over top
XOR:   a + with a circle around it

Note that when doing "two step" tables like below, for example getting to NAND from AND, or NOR from OR, it's alway best to explicitly show the first step in a column of its own (rather than just do the intermediate step in your head.)


AND and NAND Truth Tables

 

A

 

B

 

table 1

 

table 2

0

0

0

1

0

1

0

1

1

0

0

1

1

1

1

0




OR and NOR Truth Tables

 

A

 

B

 

table 3

 

table 4

0

0

0

1

0

1

1

0

1

0

1

0

1

1

1

0



OR and XOR Truth Tables

 

A

 

B

 

table 3

 

AB

0

0

0

0

0

1

1

1

1

0

1

1

1

1

1

0



NOT Truth Table

 

A

_

A

0

1

1

0

 

Full Examples With THREE Inputs:

When there are three possible boolean inputs, that makes for eight possible variations.

The eight possible inputs with three boolean on/off switches or states are:

We typically write these eight combinations for our three-input truth tables as follows:

0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

There is a trick to writing down all these eight combinations correctly, and in conventional order.

Step 1: first write, down the page 4 zeros and 4 ones:

0
0
0
0
1
1
1
1

Step 2: then, beside the 2 zeros and 2 ones, like this:

0 0
0 0
0 1
0 1
1 0
1 0
1 1
1 1

Step 3: and then, beside those, alternating 1s and 0s, like this:

0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1

 

Truth Table Exercises - Three Inputs

In terms of exercises that get you to construct truth tables, you could be asked to reproduce any of the two input truth tables above, or you could be asked to construct a truth table for a particular three input situation. For example, "Construct a truth table to show the various outputs of the following circuit: A and B or C".

The goal is to show the outputs for each of the eight possible inputs. Even without the inclusion of parentheses and NOT operators, there will be at least two steps to solve each exercise, but there may be as many as three or four steps (see examples below).

You'll need to keep in mind order of operations, as you go step by step through these.

Boolean Order of Operations

Plus parentheses can be used to group expressions to be resolved first.

 

The goal with these is to show, via a truth table, the expected outputs based on each of the eight possible inputs.

For example, below, for A and B or C, if the three inputs are all off, then the output is off, whereas if A and B are off, but C is on, there will be current coming out the other end. And so on.

 

truth table example

 

 

For each of these, you take them one step at a time, following the order of operations. So in the below case, you do A or B first, due to the parentheses, and then you do ***that result*** and C. That gives you your final set of results.

truth table example

 

truth table example

 

truth table example

 

 

With a NOT thrown in, in the example below, it will be the first thing evaluated. Then, it's the A and B. So finally the result of A and B is combined through OR with the NOT C result.

truth table example with a not also

 

 

With the next example, the NOT is done first, but to know what to negate, we need to solve A OR B.

truth table example

truth table example