# Truth Tables and resulting outputs... Classic List Threaded 10 messages Open this post in threaded view
|

## Truth Tables and resulting outputs...

 I have created chips for the first group of chips: AND, OR, NOT, XOR.  I'm attempting to move onto the Mux. I understand the truth table at a basic level, but for example on Figure 1.8, I do not understand how the "out" column was determined. I understand that you have 2 1-bit inputs and a selection bit.  If I were to draw out the truth table, I might have something like this: A B S OUT 0 0 0 ? 0 0 1 ? 0 1 0 ? 0 1 1 ? 1 0 0 ? 1 0 1 ? 1 1 0 ? 1 1 1 ? A = input 1 B = input 2 S = "selector" bit OUT = result of the boolean expression/algebra of this multiplexer gate as a whole (NB I could rearrange this truth table visually so S bits with a value of "0" are grouped together and "1" are grouped together for easy reading, of course). What I don't understand is: How am I to determine what the OUT is *supposed* to be, with regard to the Multiplexer chip as asked for at Chapter 1 page 20 (specifically the top-left of page 21)?  I already see values here under the "out" column, but I'm not sure how these values were determined in order to explain this chip in the first place. My understanding is that from this truth table, I could take the rows of this table that have the Output value of "1", build a boolean expression, simplify that expression and then attempt to build a visual representation of that expression using logic gates.
Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

This post was updated on .
Start with the small truth table that shows functionally what the multiplexor does.

 sel out | 0 | a 1 | b

In words, when sel is 0, out should have the same value as a, and when sel is 1, out should have the same value as b. In the three-variable truth table, highlighting the a and b values that are used for the given value of sel should make it easier to see where the out values come from.

 sel a b out | 0000 0011 0101 |||| 0011 1111 0011 0101 |||| 0101

--Mark

Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

 Thanks, Mark.  I'm beginning to understand I think.  Some followup questions: * How do I determine that this particular truth table fits this multiplexor?  Is it the fact that we've defined it as such in the grey box on page 20 as so? * I see that you're highlighting the A and OUT bits above and then B and the OUT bits below it.  To determine the OUT bit, are we supposed to determine the value of (A AND SEL) = OUT and then (B AND SEL) = OUT?  The only thing I see is that OUT = the value of A if S = 0 and OUT = the value of B if S = 1. In other words, if I had a truth table, with n bits of input and (maybe?) n bits of output, how would I know what the OUT bit should be?  Would we always be given the boolean expression or some other information ahead of time?
Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

 echoes wrote * How do I determine that this particular truth table fits this multiplexor?  Is it the fact that we've defined it as such in the grey box on page 20 as so? Yes. The truth table represents the specified functionality of the chip, and the boolean function itself, which is an abstraction of the chip's functionality, so to speak. Note the direct correlation between a boolean function and a chip's behavior -- they are the same. echoes wrote * I see that you're highlighting the A and OUT bits above and then B and the OUT bits below it.  To determine the OUT bit, are we supposed to determine the value of (A AND SEL) = OUT and then (B AND SEL) = OUT?  The only thing I see is that OUT = the value of A if S = 0 and OUT = the value of B if S = 1. * In other words, if I had a truth table, with n bits of input and (maybe?) n bits of output, how would I know what the OUT bit should be?  Would we always be given the boolean expression or some other information ahead of time? The bottom line is that, to design a chip given a truth table, you can use what we call the "canonical representation" of the truth table. This means that you look at the truth table lines where the output is 1. In what cases is the output 1? "row 3" OR "row 4" OR "row X" and so on. For example, for the truth table Mark posted above, I'll do the third and fourth rows (you do the rest): (sel' AND a AND b) OR (sel' AND a AND b) OR ... Now, what we're imagining here is the logic that would cause out to be 1 when all the inputs are 1. When is the output of the truth table 1? When sel is 0 AND a is 1 and b is 1. So we negate sel, hence the sel' (think "sel not" or "not sel"). Now think of that boolean expression as a chip... hmm, some words match some chips you have: AND, OR, NOT, etc. You now see exactly how to implement the chip given its truth table. Try it -- it works!
Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

In reply to this post by echoes
echoes wrote
* I see that you're highlighting the A and OUT bits above and then B and the OUT bits below it. To determine the OUT bit, are we supposed to determine the value of (A AND SEL) = OUT and then (B AND SEL) = OUT? The only thing I see is that OUT = the value of A if S = 0 and OUT = the value of B if S = 1.
When sel is 0, a AND sel is always 0, You need to do something to sel to get a variable that will work correctly with AND and a.

Sometimes it helps to add columns with intermediate results to your truth table:

 sel a b x  (x a)  (sel b) out | | 0 0 0 | 1 0 0 | 0 0 0 1 | 1 0 0 | 0 0 1 0 | 1 1 0 | 1 0 1 1 | 1 1 0 | 1 1 0 0 | 0 0 0 | 0 1 0 1 | 0 0 1 | 1 1 1 0 | 0 0 0 | 0 1 1 1 | 0 0 1 | 1

What logical operation do you use to get x from sel?
What logical operation do you use to combine (x AND a) and (sel AND b)?

--Mark

Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

 In reply to this post by cadet1620 When sel is 0, a AND sel is always 0, You need to do something to sel to get a variable that will work correctly with AND and a. Sometimes it helps to add columns with intermediate results to your truth table: By what rule do I start to interpret a truth table?  In other words, for example, on page 20 do I take this - Does it mean "to get OUT, you and solve for a AND b or does it say solve for A OR B ? Or does say solve for A XNOR B ?"
Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

 ... or maybe I'm just missing it entirely - is the the rule to read the truth table just that it IS on page 20, and I can draw the truth table from that question that needs answering to the right of the word "Function:"?
Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

 In reply to this post by cadet1620 When sel is 0, a AND sel is always 0, You need to do something to sel to get a variable that will work correctly with AND and a. Sometimes it helps to add columns with intermediate results to your truth table:         sel a b | x (x a) (sel b) | out         0 0 0 | 1 0 0 | 0         0 0 1 | 1 0 0 | 0         0 1 0 | 1 1 0 | 1         0 1 1 | 1 1 0 | 1         1 0 0 | 0 0 0 | 0         1 0 1 | 0 0 1 | 1         1 1 0 | 0 0 0 | 0         1 1 1 | 0 0 1 | 1 What logical operation do you use to get x from sel? What logical operation do you use to combine (x AND a) and (sel AND b)? Ok so I understand the left side of this diagram.  I also understand the diagram on the right and the missing rows that should be here - that is, they are the other two possible "combinations" required?  Is that it? If so... then what happens after that?  In this case, do I start from the left and AND all the columns in one row together and come up with the answer of "0" because ANDing all 8 columns (for the combinations of A and B) is the question to answer (with as I said above would be 0 in all rows except for the last one which is all 1's, so ANDing all of the columns again I would have 0 (since it's only 1's in all columns in the 8 combinations of the choices that could happen?
Open this post in threaded view
|

## Re: Truth Tables and resulting outputs...

There is no computation implied by truth tables. They are just a way to display data that may help you see how to create the required Boolean expression for a function.

Let's step back to High School Algebra for a minute. How do you fill in a function table like

y = 3a - 5b a, b y | -2, 1 | ? 0, -3 | ? 3, 0 | ? 7, 5 | ?
The function y = 3a - 5b defines what values need to appear in each row of the table. Put the a and b values from each row of the table into the function and evaluate to get the y value.

A truth table is exactly the same as a function table, except that instead of a math formula, you are given a description of the function, and since this is Boolean arithmetic instead of decimal arithmetic the only results are 0 and 1.

What is the truth table for the "Three Input Majority Function." This function's output is 1 if and only if two or more of the three inputs are 1.

The only difference from the function table above is that instead of the function y = 3a - 5b, the function is "output is 1 if and only if two or more of the three inputs are 1."

3-InputMajority a, b, c out | 0 0 0 | ? 0 0 1 | ? 0 1 0 | ? 0 1 1 | ? 1 0 0 | ? 1 0 1 | ? 1 1 0 | ? 1 1 1 | ?
The first row has no ones so the function evaluates to 0.
"0 1 1" is the first row that evaluates to 1, since it has two or more 1s.
"1 0 0" does not have two or more 1s; it evaluates to 0.
The remaining rows all have 2 or more 1s so they evaluate to 1.

--Mark