# How to make a Truth Table and turn Truth table into A Circuit.

Background

I'm a novice student learning some mathematics (Programming background) and I'm currently learning how to construct Truth Tables from Logical Statements and then use that Truth Table to make a circuit.

In the last few months I've had exam studying and also had to consturct two mobile apps (One in C# and another in Java)

I've been asked to construct a Truth table from a statement such as:

"(R.B.(Not G)) + (R (Doesn't affect outcome).B.G) + (R.(Not B).(Not G))"

The Issue:

Although I made every class, I really don't know where to start as in:

• how would I obtain the "1"'s and "0"'s contained within a truth table.
• how would I use this to create the circuitry?

In short, I'm having incredible difficulty figuring out where to start. The "Process" of taking the statement, and gathering the Truth Table data from it confuses me.

Thanks if you have time to help, I'll be working on this all day. I don't see my tutor again until friday afternoon so I can't ask for direct assistance.

• This might clear things up – Ben Grossmann Apr 29 '14 at 13:47
• Which columns of the truth table do you have problems filling in? – hmakholm left over Monica Apr 29 '14 at 13:50
• Pretty much them all, I'm confused at where to start the Truth table itself, confused at how to even begin finding the 0's and 1's needed to begin the process of building the table and circuit. – user3486320 Apr 29 '14 at 13:57

You have $3$ variables here: R, G and B.

So your table should consist of $2^3+1$ rows and $3+1$ columns: R.B.(Not G) + R (Doesn't affect outcome).B.G + R.(Not B).(Not G) is equivalent to:

$(R \wedge B \wedge \neg G) \vee (B \wedge G) \vee (R \wedge \neg B \wedge \neg G)$

So simply go over each row in the table, assign the ones and zeros to the formula above, and write down the result in the res column on the same row.

For example, in the $4$th row you have $R=0,G=1,B=1$.

Therefore, res $= (0 \wedge 1 \wedge \neg 1) \vee (1 \wedge 1) \vee (0 \wedge \neg 1 \wedge \neg 1) = 1$.

• "Go over each row in the table" "Assign the ones and Zeros to the forumula above" Could I please have an example of one row so I know how to do this for the others? Thanks if you could, I'm very new to this. – user3486320 Apr 29 '14 at 14:16
• @user3486320: See example added at the bottom of the answer. – barak manos Apr 29 '14 at 14:20
• Is it normal that I have a really hard time reading this? I mean, I still really don't know how you achieved the "Res = 1" I understand that you substitute the letters for the numbers contained within the table, but how did you reach the outcome? – user3486320 Apr 29 '14 at 14:26
• @user3486320: First of all, do you understand the logical operators $\vee,\wedge,\neg$? If not, then you must begin by studying them. Since the question above was given to you as homework, I assumed that you already have. Second, I noticed that you changed your question according to my answer. Please do not do so, because: $1$. It invalidates my answer and makes it irrelevant. $2$. If my answer is wrong, then you have effectively embedded the error in your question. In short, you should put the R.B.(Not G) + R (Doesn't affect outcome).B.G + R.(Not B).(Not G) statement back into the question. – barak manos Apr 29 '14 at 14:56
• I'm sorry, it was edited by another user, I just accepted his edit to clean up what was there already so it made more sense, and although I understand what the symbols mean I don't fully understand your outcome or how you got there. I'll revert it back. – user3486320 Apr 29 '14 at 15:18

Are you familiar with the Boolean Normal Forms? You can write the truth table in the disjunctive or conjunctive normal form. With the Dijsunctive Normal Form, you take a row and apply the AND operation to each variable and its negation if the function evaluates that row to $1$.

So for example if $f(0, 1, 0) = 1$, then you take $\overline{x_{1}}x_{2}\overline{x_{3}}$ as your minterm. You add (apply the OR operation) to the minterms. So it is a sum of products.

You could instead use the Conjunctive Normal Form, which takes rows that evaluate to $0$ under the function and OR the elements together. Then AND the minterms together. So if $f(1, 1, 0) = 0$, then your minterm is $x_{1} \vee x_{2} \vee \overline{x_{3}}$.

John Savage has a good explanation in his book in Chapter Two. He hosts it online for free: http://cs.brown.edu/~jes/book/pdfs/ModelsOfComputation.pdf